예제 #1
0
        private void UpdateShowControls()
        {
            var newDisplayMode = DisplayAs.Nothing;

            if (!Operator.Outputs.Any() || Operator.Outputs.Count < _shownOutputIndex)
            {
                DisplayMode = DisplayAs.Nothing;
                return;
            }
            var output = Operator.Outputs[_shownOutputIndex];

            if (Operator.InternalParts.Count > 0 && Operator.InternalParts[0].Func is ICurve)
            {
                var curve = Operator.InternalParts[0].Func as ICurve;
                XShowCurveControl.Curve = curve;
                newDisplayMode          = DisplayAs.Curve;
            }
            else if (output.Type == FunctionType.Image || output.Type == FunctionType.Scene || output.Type == FunctionType.Mesh || output.Type == FunctionType.Float)
            {
                newDisplayMode = DisplayAs.SceneContent;
                XShowContentControl.SetOperatorAndOutputIndex(Operator, _shownOutputIndex, _hoverTimeScrubbingOffset);
            }
            else if (output.Type == FunctionType.Generic ||
                     output.Type == FunctionType.Text)
            {
                newDisplayMode = DisplayAs.Text;
                XShowAsTextControl.SetOperatorAndOutput(Operator, _shownOutputIndex);
            }
            DisplayMode = newDisplayMode;
        }
예제 #2
0
        private void DiscardShownOperator()
        {
            DisplayMode = DisplayAs.Nothing;
            if (_shownOperatorWidget != null)
            {
                _shownOperatorWidget.Operator.Parent.OperatorRemovedEvent -= Parent_OperatorRemovedEventHandler;
            }

            _shownOperatorWidget       = null;
            XSelectedOperatorName.Text = "?";
            XLockedButton.IsChecked    = false;

            XShowCurveControl.Curve = null;
            XShowAsTextControl.SetOperatorAndOutput(null);
            XShowContentControl.SetOperatorAndOutputIndex(null);
        }