예제 #1
0
        public static IValueConfig CreateValueConfig(this IPluginHost host, ConfigAttribute attribute, Type type)
        {
            attribute = NormalizePinAttribute(attribute, type);

            IValueConfig result = null;

            host.CreateValueConfig(attribute.Name, attribute.Dimension, attribute.DimensionNames, (TSliceMode)attribute.SliceMode, (TPinVisibility)attribute.Visibility, out result);
            switch (attribute.Dimension)
            {
            case 2:
                result.SetSubType2D(attribute.MinValue, attribute.MaxValue, attribute.StepSize, attribute.DefaultValues[0], attribute.DefaultValues[1], attribute.IsBang, attribute.IsToggle, attribute.AsInt);
                break;

            case 3:
                result.SetSubType3D(attribute.MinValue, attribute.MaxValue, attribute.StepSize, attribute.DefaultValues[0], attribute.DefaultValues[1], attribute.DefaultValues[2], attribute.IsBang, attribute.IsToggle, attribute.AsInt);
                break;

            case 4:
                result.SetSubType4D(attribute.MinValue, attribute.MaxValue, attribute.StepSize, attribute.DefaultValues[0], attribute.DefaultValues[1], attribute.DefaultValues[2], attribute.DefaultValues[3], attribute.IsBang, attribute.IsToggle, attribute.AsInt);
                break;

            default:
                result.SetSubType(attribute.MinValue, attribute.MaxValue, attribute.StepSize, attribute.DefaultValue, attribute.IsBang, attribute.IsToggle, attribute.AsInt);
                break;
            }
            result.Order = attribute.Order;
            return(result);
        }
예제 #2
0
        public void Configurate(IPluginConfig Input)
        {
            //nothing to configure in this plugin
            //only used in conjunction with inputs of type cmpdConfigurate

            if (Input.Name == "Number of Input Poses")
            {
                IValueConfig valueInput = (IValueConfig)Input;
                valueInput.GetValue(0, out poseCount);

                FInput.SetSubType(0, poseCount - 1, 0.01, 0.0, false, false, false);

                int oldPoseCount = FPoseNodes.Count;
                for (int i = oldPoseCount - 1; i >= (int)poseCount; i--)
                {
                    FHost.DeletePin(FPoseNodes[i]);
                }
                for (int i = oldPoseCount - 1; i >= (int)poseCount; i--)
                {
                    FPoseNodes.RemoveAt(i);
                    FPoses.RemoveAt(i);
                }

                var guids = new System.Guid[1];
                guids[0] = SkeletonNodeIO.GUID;
                INodeIn currPoseNode;
                for (int i = oldPoseCount; i < (int)poseCount; i++)
                {
                    FHost.CreateNodeInput("Pose " + (i + 1), TSliceMode.Single, TPinVisibility.True, out currPoseNode);
                    currPoseNode.SetSubType(guids, "Skeleton");
                    FPoseNodes.Add(currPoseNode);
                    FPoses.Add(null);
                }
            }
        }
예제 #3
0
        public void Configurate(IPluginConfig Input)
        {
            if (Input.Name == "Children Count")
            {
                IValueConfig valueInput = (IValueConfig)Input;
                double       pinCount;
                valueInput.GetValue(0, out pinCount);

                int oldChildrenCount = FChildPins.Count;
                for (int i = oldChildrenCount - 1; i >= (int)pinCount; i--)
                {
                    FHost.DeletePin(FChildPins[i]);
                }
                for (int i = oldChildrenCount - 1; i >= (int)pinCount; i--)
                {
                    FChildPins.RemoveAt(i);
                }

                var guids = new System.Guid[1];
                guids[0] = SkeletonNodeIO.GUID;
                INodeIn node;
                for (int i = oldChildrenCount; i < pinCount; i++)
                {
                    FHost.CreateNodeInput("Child" + (i + 1), TSliceMode.Single, TPinVisibility.True, out node);
                    node.SetSubType(guids, "Skeleton");
                    FChildPins.Add(node);
                }
            }
        }
예제 #4
0
        public override void DestroyPins()
        {
            FHost.DeletePin(FKeyTime);
            FHost.DeletePin(FKeyColor);
            FKeyTime  = null;
            FKeyColor = null;

            FKeyFrames.Clear();
        }
예제 #5
0
        public override void DestroyPins()
        {
            FHost.DeletePin(FStateTime);
            FHost.DeletePin(FStateName);
            FHost.DeletePin(FStateEvents);
            FStateTime   = null;
            FStateName   = null;
            FStateEvents = null;

            FKeyFrames.Clear();
        }
예제 #6
0
        public override void DestroyPins()
        {
            FHost.DeletePin(FKeyTime);
            FHost.DeletePin(FKeyFlagY);
            FHost.DeletePin(FKeyValue);
            FKeyTime  = null;
            FKeyValue = null;
            FKeyFlagY = null;

            FKeyFrames.Clear();
        }
예제 #7
0
파일: MixPose.cs 프로젝트: vnmone/vvvv-sdk
        public void Configurate(IPluginConfig Input)
        {
            //nothing to configure in this plugin
            //only used in conjunction with inputs of type cmpdConfigurate

            if (Input.Name == "Number of Input Poses")
            {
                System.Guid[] guids = new System.Guid[1];
                guids[0] = new Guid("AB312E34-8025-40F2-8241-1958793F3D39");

                IValueConfig valueInput = (IValueConfig)Input;
                valueInput.GetValue(0, out poseCount);

                int oldPoseCount = poseNodes.Count;
                for (int i = oldPoseCount - 1; i >= (int)poseCount; i--)
                {
                    FHost.DeletePin(poseNodes[i]);
                    FHost.DeletePin(amountNodes[i]);
                }
                for (int i = oldPoseCount - 1; i >= (int)poseCount; i--)
                {
                    poseNodes.RemoveAt(i);
                    amountNodes.RemoveAt(i);
                    poses.RemoveAt(i);
                    amounts.RemoveAt(i);
                }

                INodeIn  currPoseNode;
                IValueIn currAmountNode;
                for (int i = oldPoseCount; i < (int)poseCount; i++)
                {
                    FHost.CreateNodeInput("Pose " + (i + 1), TSliceMode.Single, TPinVisibility.True, out currPoseNode);
                    currPoseNode.SetSubType(guids, "Skeleton");
                    poseNodes.Add(currPoseNode);

                    FHost.CreateValueInput("Amount " + (i + 1), 1, null, TSliceMode.Single, TPinVisibility.True, out currAmountNode);
                    currAmountNode.SetSubType(0.0, 1.0, 0.01, 0.0, false, false, false);
                    amountNodes.Add(currAmountNode);

                    poses.Add(null);
                    amounts.Add(0.0);
                }
            }
        }
예제 #8
0
 public ValueConfigStream(IValueConfig valueConfig)
     : base(valueConfig)
 {
     FValueConfig = valueConfig;
     FTypeCode    = Type.GetTypeCode(typeof(T));
 }
예제 #9
0
 static private Action <int> GetSetValueLengthAction(IValueConfig valueConfig)
 {
     return((int newLength) => {
         valueConfig.SliceCount = newLength;
     });
 }
예제 #10
0
 static private Func <bool> GetValidateFunc(IValueConfig valueConfig)
 {
     return(() => { return valueConfig.PinIsChanged; });
 }
예제 #11
0
        //called by the plugin the host can create a pin
        public void CreateValueConfig(string Name, int Dimension, string[] DimensionNames, TSliceMode SliceMode, TPinVisibility Visibility, out IValueConfig Pin)
        {
            Pin = new TValuePin(this, Name, Dimension, DimensionNames, TPinDirection.Configuration, new TOnConfigurate(ConfigurateCB), SliceMode, Visibility);

            AddPin(Pin as TBasePin);
        }
예제 #12
0
 public QuaternionConfigStream(IValueConfig valueConfig)
     : base(valueConfig)
 {
     FValueConfig = valueConfig;
 }
예제 #13
0
 public Vector4ConfigStream(IValueConfig valueConfig)
     : base(valueConfig)
 {
     FValueConfig = valueConfig;
 }