Esempio n. 1
0
        public static INodeOut CreateNodeOutput(this IPluginHost host, OutputAttribute attribute, Type type)
        {
            INodeOut result = null;

            host.CreateNodeOutput(attribute.Name, (TSliceMode)attribute.SliceMode, (TPinVisibility)attribute.Visibility, out result);

            // Register all implemented interfaces and inherited classes of T
            // to support the assignment of ISpread<Apple> output to ISpread<Fruit> input.
            var guids = new List <Guid>();
            var typeT = type;

            foreach (var interf in typeT.GetInterfaces())
            {
                guids.Add(interf.GUID);
            }

            while (typeT != null)
            {
                guids.Add(typeT.GUID);
                typeT = typeT.BaseType;
            }

            result.SetSubType2(type, guids.ToArray(), type.GetCSharpName());
            result.Order = attribute.Order;
            return(result);
        }
Esempio n. 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;

            FHost.CreateValueConfig("Number of Input Poses", 1, null, TSliceMode.Single, TPinVisibility.OnlyInspector, out FPoseCount);
            FPoseCount.SetSubType(2, 10, 1, 2, false, false, true);

            //create inputs
            FHost.CreateValueInput("Input", 1, null, TSliceMode.Single, TPinVisibility.True, out FInput);
            FInput.SetSubType(0.0, 1.0, 0.01, 0.0, false, false, false);

            INodeIn currPoseNode;

            for (int i = 0; i < 2; i++)
            {
                FHost.CreateNodeInput("Pose " + (i + 1), TSliceMode.Single, TPinVisibility.True, out currPoseNode);
                currPoseNode.SetSubType(guids, "Skeleton");
                FPoseNodes.Add(currPoseNode);
                FPoses.Add(null);
            }

            // create outputs
            FHost.CreateNodeOutput("Mixed Pose", TSliceMode.Single, TPinVisibility.True, out FPoseOutput);
            FPoseOutput.SetSubType(guids, "Skeleton");
        }
Esempio n. 3
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();
        }
Esempio n. 4
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.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");
        }
Esempio n. 5
0
        //this method is called by vvvv when the node is created
        public void SetPluginHost(IPluginHost Host)
        {
            //assign host
            FHost = Host;

            //create inputs

            FHost.CreateStringInput("Filename", TSliceMode.Single, TPinVisibility.True, out FMyStringInput);
            FMyStringInput.SetSubType("rig.x", true);

            //create outputs

            FHost.CreateValueOutput("Bind Indices", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FBindIndicesOutput);
            FBindIndicesOutput.Order = 1;

            FHost.CreateValueOutput("Skin Weights", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FSkinWeightsOutput);
            FSkinWeightsOutput.Order = 2;

            FHost.CreateValueOutput("Indices", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FIndicesOutput);
            FIndicesOutput.Order = 3;

            FHost.CreateTransformOutput("Inverse Bind Pose", TSliceMode.Dynamic, TPinVisibility.True, out FInverseBindPoseOutput);
            FInverseBindPoseOutput.Order = 4;

            FHost.CreateNodeOutput("Skeleton", TSliceMode.Single, TPinVisibility.True, out FSkeletonOutput);
            System.Guid[] guids = new System.Guid[1];
            guids[0] = new Guid("AB312E34-8025-40F2-8241-1958793F3D39");
            FSkeletonOutput.SetSubType(guids, "Skeleton");
            FSkeletonOutput.Order = 5;
        }
Esempio n. 6
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");

            FHost.CreateValueConfig("Number of Input Poses", 1, null, TSliceMode.Single, TPinVisibility.OnlyInspector, out FPoseCount);
            FPoseCount.SetSubType(2, 10, 1, 2, false, false, true);

            INodeIn  currPoseNode;
            IValueIn currAmountNode;

            for (int i = 0; i < 2; 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(1 - i);
            }

            // create outputs

            FHost.CreateNodeOutput("Mixed Pose", TSliceMode.Single, TPinVisibility.True, out FPoseOutput);
            FPoseOutput.SetSubType(guids, "Skeleton");
        }
Esempio n. 7
0
        public void OnImportsSatisfied()
        {
            var guids = new[] { SkeletonNodeIO.GUID };

            FHost.CreateNodeOutput("V1 Skeleton", TSliceMode.Single, TPinVisibility.True, out V1SkeletonOut);
            V1SkeletonOut.SetSubType(guids, "Skeleton");
        }
Esempio n. 8
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");

            FHost.CreateNodeInput("Pose", TSliceMode.Single, TPinVisibility.True, out FPoseInput);
            FPoseInput.SetSubType(guids, "Skeleton");

            FHost.CreateStringInput("Start Joint", TSliceMode.Single, TPinVisibility.True, out FChainStart);

            FHost.CreateStringInput("End Joint", TSliceMode.Single, TPinVisibility.True, out FChainEnd);

            FHost.CreateValueInput("Target", 3, null, TSliceMode.Dynamic, TPinVisibility.True, out FTargetInput);

            FHost.CreateValueInput("Epsilon", 1, null, TSliceMode.Single, TPinVisibility.True, out FEpsilonInput);

            FHost.CreateValueInput("Velocity", 1, null, TSliceMode.Single, TPinVisibility.True, out FVelocityInput);
            FVelocityInput.SetSubType(0.0, 10.0, 0.1, 1.0, false, false, false);

            FHost.CreateValueInput("Pole Target", 3, null, TSliceMode.Dynamic, TPinVisibility.True, out FPoleTargetInput);

            FHost.CreateValueInput("Enable Pole Target", 1, null, TSliceMode.Single, TPinVisibility.True, out FEnablePoleTargetInput);
            FEnablePoleTargetInput.SetSubType(0.0, 1.0, 1.0, 0.0, false, false, true);

            // create outputs

            FHost.CreateNodeOutput("Output Pose", TSliceMode.Single, TPinVisibility.True, out FPoseOutput);
            FPoseOutput.SetSubType(guids, "Skeleton");

            FHost.CreateValueOutput("Debug", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FDebugOutput);
        }
Esempio n. 9
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");
        }
Esempio n. 10
0
        public AssimpSkeletonNode(IPluginHost host)
        {
            FSkeleton = new Skeleton();

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

            host.CreateNodeOutput("Skeleton", TSliceMode.Dynamic, TPinVisibility.True, out FSkeletonOutput);
            FSkeletonOutput.SetSubType(guids, "Skeleton");
        }
Esempio n. 11
0
        public AssimpSkeletonNode(IPluginHost host)
        {
            FSkeleton = new Skeleton();

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

            host.CreateNodeOutput("Skeleton", TSliceMode.Dynamic, TPinVisibility.True, out FSkeletonOutput);
            FSkeletonOutput.SetSubType(guids, "Skeleton");
        }
Esempio n. 12
0
        public ColladaSkeletonNode(IPluginHost host)
        {
            FSkeleton = new Skeleton();

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

            host.CreateNodeOutput("Skeleton", TSliceMode.Single, TPinVisibility.True, out FSkeletonOutput);
            FSkeletonOutput.SetSubType2(typeof(ISkeleton), guids, "Skeleton");
        }
Esempio n. 13
0
        public BVHNode(IPluginHost host)
        {
            //Create Skeleton Output
            System.Guid[] guids = new System.Guid[1];
            guids[0] = new Guid("AB312E34-8025-40F2-8241-1958793F3D39");

            host.CreateNodeOutput("Skeleton", TSliceMode.Single, TPinVisibility.True, out FSkeletonOutput);
            FSkeletonOutput.SetSubType(guids, "Skeleton");

            //init BVHLoader
            FBVHLoader = new BVHLoader();
        }
Esempio n. 14
0
        public BVHNode(IPluginHost host)
        {
            //Create Skeleton Output
            System.Guid[] guids = new System.Guid[1];
            guids[0] = new Guid("AB312E34-8025-40F2-8241-1958793F3D39");

            host.CreateNodeOutput("Skeleton", TSliceMode.Single, TPinVisibility.True, out FSkeletonOutput);
            FSkeletonOutput.SetSubType(guids, "Skeleton");


            //init BVHLoader
            FBVHLoader = new BVHLoader();
        }
Esempio n. 15
0
        public static INodeOut CreateNodeOutput(this IPluginHost host, OutputAttribute attribute, Type type)
        {
            INodeOut result = null;

            host.CreateNodeOutput(attribute.Name, (TSliceMode)attribute.SliceMode, (TPinVisibility)attribute.Visibility, out result);

            if (type != null)
            {
                // Register all implemented interfaces and inherited classes of T
                // to support the assignment of ISpread<Apple> output to ISpread<Fruit> input.
                var guids = new List <Guid>();

                RegisterID(host, guids, type);

                foreach (var interf in type.GetInterfaces())
                {
                    RegisterID(host, guids, interf);
                }

                var t = type.BaseType;
                while (t != null)
                {
                    RegisterID(host, guids, t);
                    t = t.BaseType;
                }

                result.SetSubType2(type, guids.ToArray(), type.GetCSharpName());
            }
            else
            {
                result.SetSubType(new Guid[] { }, "Variant");
            }

            SetOutputProperties(result, attribute);
            return(result);
        }