Example #1
0
        public static PumkinsBlendshapePreset CreatePreset(string presetName, GameObject avatar)
        {
            PumkinsBlendshapePreset preset = CreateInstance <PumkinsBlendshapePreset>();

            preset.SetupPreset(presetName, avatar);
            return(preset);
        }
Example #2
0
        public static void ShowWindow(PumkinsBlendshapePreset newPreset = null)
        {
            AssignOrCreatePreset <PumkinsBlendshapePreset>(newPreset);
            newPreset = (PumkinsBlendshapePreset)preset;

            if (PumkinsAvatarTools.SelectedAvatar)
            {
                newPreset.SetupPreset("", PumkinsAvatarTools.SelectedAvatar);
            }

            if (!_window)
            {
                _window = CreateInstance <CreateBlendshapePopup>();
                _window.autoRepaintOnSceneChange = true;
            }

            if (editingExistingPreset)
            {
                _window.titleContent = new GUIContent(Strings.Presets.editBlendshapePreset);
                _overwriteFile       = true;
            }
            else
            {
                _window.titleContent = new GUIContent(Strings.Presets.createBlendshapePreset);
            }

            _window.ShowUtility();
        }
Example #3
0
        private void SetupPreset()
        {
            PumkinsBlendshapePreset preset = (PumkinsBlendshapePreset)CreatePresetPopupBase.preset;

            preset.SetupPreset(preset.name, PumkinsAvatarTools.SelectedAvatar);
            CreatePresetPopupBase.preset = preset;
        }
        public static void ShowWindow(PumkinsBlendshapePreset newPreset = null)
        {
            AssignOrCreatePreset <PumkinsBlendshapePreset>(newPreset);
            newPreset = (PumkinsBlendshapePreset)preset;

            if (PumkinsAvatarTools.SelectedAvatar)
            {
                newPreset.SetupPreset("", PumkinsAvatarTools.SelectedAvatar);
            }

            if (!_window || _window.GetType() != typeof(CreateBlendshapePopup))
            {
                _window = CreateInstance <CreateBlendshapePopup>();
                _window.autoRepaintOnSceneChange = true;

                if (minWindowSize.magnitude > Vector2.zero.magnitude)
                {
                    float maxX = Mathf.Max(_window.minSize.x, minWindowSize.x);
                    float maxY = Mathf.Max(_window.minSize.y, minWindowSize.y);
                    _window.minSize = new Vector2(maxX, maxY);
                }
            }

            if (editingExistingPreset)
            {
                _window.titleContent = new GUIContent(Strings.Presets.editBlendshapePreset);
                _overwriteFile       = true;
            }
            else
            {
                _window.titleContent = new GUIContent(Strings.Presets.createBlendshapePreset);
            }

            _window.ShowUtility();
        }