Пример #1
0
        public void SelectDummy(ExpressionEditorPreviewable dummy)
        {
            if (!dummy.IsValid())
            {
                return;
            }

            _state.Altered(_previewHandler).DummySelected(dummy);
        }
        internal void EnsureActivePreviewInitialized()
        {
            if (_state.ActivePreview != null)
            {
                return;
            }

            _bufferActive = new Texture2D(EeMetadata.StandardWidth, EeMetadata.StandardHeight, TextureFormat.RGB24, false);

            _state.Altered(this).TEMP_ActivePreviewEnsured();
        }
        public void AddBlendshape(string path, string property)
        {
            Undo.RecordObject(_state.CurrentClip, "EE - Add blendshape");

            var binding = ToBlendshapeBinding(path, property);

            if (AnimationUtility.GetCurveBindings(_state.CurrentClip).Contains(binding))
            {
                var keyframes = AnimationUtility.GetEditorCurve(_state.CurrentClip, binding).keys
                                .Select(keyframe =>
                {
                    keyframe.value = 100;
                    return(keyframe);
                })
                                .ToArray();
                AnimationUtility.SetEditorCurve(_state.CurrentClip, binding, new AnimationCurve(keyframes));
            }
            else
            {
                AnimationUtility.SetEditorCurve(_state.CurrentClip, binding, AnimationCurve.Constant(0f, 1 / 60f, 100f));
            }

            _state.Altered(_previewHandler).NewBlendshapeAdded(binding);
        }