예제 #1
0
        public static IValueIn CreateValueInput(this IPluginHost host, InputAttribute attribute, Type type)
        {
            attribute = NormalizePinAttribute(attribute, type);

            IValueIn result = null;

            host.CreateValueInput(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;
            result.AutoValidate = attribute.AutoValidate;
            return(result);
        }
예제 #2
0
        //this method is called by vvvv when the node is created
        public void SetPluginHost(IPluginHost Host)
        {
            //assign host
            FHost = Host;

            var guids = new System.Guid[1];

            guids[0] = SkeletonNodeIO.GUID;

            //create inputs
            FHost.CreateStringInput("Joint Name", TSliceMode.Single, TPinVisibility.True, out FJointNameInput);
            FHost.CreateTransformInput("Base Transform", TSliceMode.Single, TPinVisibility.True, out FBaseTransformInput);
            String[] dimensions = new String[2];
            dimensions[0] = "Min";
            dimensions[1] = "Max";
            FHost.CreateValueInput("Rotation Constraints", 2, dimensions, TSliceMode.Dynamic, TPinVisibility.True, out FRotationConstraintsInput);
            FRotationConstraintsInput.SetSubType2D(-1.0, 1.0, 0.1, -1.0, 1.0, false, false, false);
            INodeIn node;

            FHost.CreateNodeInput("Child1", TSliceMode.Single, TPinVisibility.True, out node);
            node.SetSubType(guids, "Skeleton");
            FChildPins.Add(node);

            FHost.CreateValueConfig("Children Count", 1, null, TSliceMode.Single, TPinVisibility.OnlyInspector, out FChildrenCountInput);
            FChildrenCountInput.SetSubType(0, 50, 1.0, 1.0, false, false, true);

            // create outputs
            FHost.CreateNodeOutput("Skeleton", TSliceMode.Single, TPinVisibility.True, out FSkeletonOutput);
            FSkeletonOutput.SetSubType(guids, "Skeleton");
            FSkeletonOutput.MarkPinAsChanged();
        }
예제 #3
0
        //this method is called by vvvv when the node is created
        public void SetPluginHost(IPluginHost Host)
        {
            //assign host
            FHost = Host;

            //create inputs
            FHost.CreateValueInput("Input ", 2, null, TSliceMode.Dynamic, TPinVisibility.True, out FPositionInput);
            FPositionInput.SetSubType2D(double.MinValue, double.MaxValue, 0.01, 0.5, 0.5, false, false, false);

            FHost.CreateValueInput("Upper Left Value ", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FP1Input);
            FP1Input.SetSubType(double.MinValue, double.MaxValue, 0.01, 0, false, false, false);

            FHost.CreateValueInput("Upper Right Value ", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FP2Input);
            FP2Input.SetSubType(double.MinValue, double.MaxValue, 0.01, 0, false, false, false);

            FHost.CreateValueInput("Lower Right Value ", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FP3Input);
            FP3Input.SetSubType(double.MinValue, double.MaxValue, 0.01, 1, false, false, false);

            FHost.CreateValueInput("Lower Left Value ", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FP4Input);
            FP4Input.SetSubType(double.MinValue, double.MaxValue, 0.01, 1, false, false, false);

            FHost.CreateValueInput("Vector Size", 1, null, TSliceMode.Single, TPinVisibility.True, out FVectorSizeInput);
            FVectorSizeInput.SetSubType(double.MinValue, double.MaxValue, 1, 1, false, false, true);

            //create outputs
            FHost.CreateValueOutput("Output", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FValueOutput);
            FValueOutput.SetSubType(double.MinValue, double.MaxValue, 0.01, 0.5, false, false, false);
        }
예제 #4
0
파일: SetJoint.cs 프로젝트: vnmone/vvvv-sdk
        //this method is called by vvvv when the node is created
        public void SetPluginHost(IPluginHost Host)
        {
            //assign host
            FHost = Host;

            System.Guid[] guids = new System.Guid[1];
            guids[0] = new Guid("AB312E34-8025-40F2-8241-1958793F3D39");

            //create inputs
            FHost.CreateNodeInput("Skeleton", TSliceMode.Single, TPinVisibility.True, out FSkeletonInput);
            FSkeletonInput.SetSubType(guids, "Skeleton");

            FHost.CreateStringInput("Parent Name", TSliceMode.Dynamic, TPinVisibility.True, out FParentNameInput);

            FHost.CreateValueInput("Constraints", 2, null, TSliceMode.Dynamic, TPinVisibility.False, out FConstraintsInput);
            FConstraintsInput.SetSubType2D(-1.0, 1.0, 0.01, -1.0, 1.0, false, false, false);

            FHost.CreateTransformInput("Base Transform", TSliceMode.Dynamic, TPinVisibility.True, out FBaseTransformInput);

            FHost.CreateTransformInput("Animation Transform", TSliceMode.Dynamic, TPinVisibility.True, out FAnimationTransformInput);

            //FHost.CreateValueInput("Rotation", 3, null, TSliceMode.Dynamic, TPinVisibility.True, out FRotationInput);

            FHost.CreateStringInput("Joint Name", TSliceMode.Dynamic, TPinVisibility.True, out FJointNameInput);

            // create outputs

            FHost.CreateNodeOutput("Skeleton", TSliceMode.Single, TPinVisibility.True, out FSkeletonOutput);
            FSkeletonOutput.SetSubType(guids, "Skeleton");
        }
예제 #5
0
        //this method is called by vvvv when the node is created
        public void SetPluginHost(IPluginHost Host)
        {
            //assign host
            FHost = Host;

            System.Guid[] guids = new System.Guid[1];
            guids[0] = new Guid("AB312E34-8025-40F2-8241-1958793F3D39");

            //create inputs

            FHost.CreateStringInput("Joint Name", TSliceMode.Dynamic, TPinVisibility.True, out FJointNameInput);

            FHost.CreateStringInput("Parent Name", TSliceMode.Dynamic, TPinVisibility.True, out FParentNameInput);

            FHost.CreateTransformInput("Base Transformation", TSliceMode.Dynamic, TPinVisibility.True, out FBaseTransformInput);

            String[] dimensions = new String[2];
            dimensions[0] = "Min";
            dimensions[1] = "Max";

            FHost.CreateValueInput("Constraints", 2, dimensions, TSliceMode.Dynamic, TPinVisibility.True, out FConstraintsInput);
            FConstraintsInput.SetSubType2D(-1.0, 1.0, 0.1, -1.0, 1.0, false, false, false);


            String[] offsetModes = new String[2];
            offsetModes[0] = "parent";
            offsetModes[1] = "world";
            FHost.UpdateEnum("OffsetModes", "parent", offsetModes);
            FHost.CreateEnumInput("Position relative to", TSliceMode.Single, TPinVisibility.True, out FOffsetModeInput);
            FOffsetModeInput.SetSubType("OffsetModes");

            FHost.CreateNodeOutput("Skeleton", TSliceMode.Single, TPinVisibility.True, out FSkeletonOutput);
            FSkeletonOutput.SetSubType(guids, "Skeleton");
        }
예제 #6
0
        //this method is called by vvvv when the node is created
        public void SetPluginHost(IPluginHost Host)
        {
            //assign host
            FHost = Host;

            //create inputs
            FHost.CreateValueInput("Vertices ", 2, null, TSliceMode.Dynamic, TPinVisibility.True, out FPinInVertices);
            FPinInVertices.SetSubType2D(double.MinValue, double.MaxValue, 0.01, 0, 0, false, false, false);
            FHost.CreateValueInput("Center ", 2, null, TSliceMode.Dynamic, TPinVisibility.True, out FPinInCenter);
            FPinInCenter.SetSubType2D(double.MinValue, double.MaxValue, 0.01, 0, 0, false, false, false);
            FHost.CreateValueInput("Radius ", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FPinInRadius);
            FPinInRadius.SetSubType(0.01, double.MaxValue, 0.01, 1, false, false, false);

            //create outputs
            FHost.CreateValueOutput("Value Output", 2, null, TSliceMode.Dynamic, TPinVisibility.True, out FPinOutVertices);
            FPinOutVertices.SetSubType2D(double.MinValue, double.MaxValue, 0.01, 0, 0, false, false, false);
        }