예제 #1
0
        public override IEnumerable <EditorCurveBinding> GetConstrainedCurveBindings(RigBuilder rigBuilder, MultiParentConstraint constraint)
        {
            var bindings = new List <EditorCurveBinding>();

            EditorCurveBindingUtils.CollectPositionBindings(rigBuilder.transform, constraint.data.constrainedObject, bindings);
            EditorCurveBindingUtils.CollectRotationBindings(rigBuilder.transform, constraint.data.constrainedObject, bindings);
            return(bindings);
        }
        public override IEnumerable <EditorCurveBinding> GetSourceCurveBindings(RigBuilder rigBuilder, TwistCorrection constraint)
        {
            var bindings = new List <EditorCurveBinding>();

            EditorCurveBindingUtils.CollectRotationBindings(rigBuilder.transform, constraint.data.sourceObject, bindings);

            return(bindings);
        }
        public override IEnumerable <EditorCurveBinding> GetConstrainedCurveBindings(RigBuilder rigBuilder, TwistCorrection constraint)
        {
            var bindings = new List <EditorCurveBinding>();

            foreach (var node in constraint.data.twistNodes)
            {
                EditorCurveBindingUtils.CollectRotationBindings(rigBuilder.transform, node.transform, bindings);
            }

            return(bindings);
        }
        public override IEnumerable <EditorCurveBinding> GetConstrainedCurveBindings(RigBuilder rigBuilder, TwistChainConstraint constraint)
        {
            var bindings = new List <EditorCurveBinding>();

            // Retrieve chain in-between root and tip transforms.
            Transform[] chain = ConstraintsUtils.ExtractChain(constraint.data.root, constraint.data.tip);

            for (int i = 0; i < chain.Length; ++i)
            {
                EditorCurveBindingUtils.CollectRotationBindings(rigBuilder.transform, chain[i], bindings);
            }

            return(bindings);
        }
        public override IEnumerable <EditorCurveBinding> GetConstrainedCurveBindings(RigBuilder rigBuilder, TwoBoneIKConstraint constraint)
        {
            var bindings = new List <EditorCurveBinding>();

            var root = constraint.data.root;
            var mid  = constraint.data.mid;
            var tip  = constraint.data.tip;

            EditorCurveBindingUtils.CollectRotationBindings(rigBuilder.transform, root, bindings);
            EditorCurveBindingUtils.CollectRotationBindings(rigBuilder.transform, mid, bindings);
            EditorCurveBindingUtils.CollectRotationBindings(rigBuilder.transform, tip, bindings);

            return(bindings);
        }
예제 #6
0
        public override IEnumerable <EditorCurveBinding> GetSourceCurveBindings(RigBuilder rigBuilder, MultiRotationConstraint constraint)
        {
            var bindings = new List <EditorCurveBinding>();

            for (int i = 0; i < constraint.data.sourceObjects.Count; ++i)
            {
                var sourceObject = constraint.data.sourceObjects[i];

                EditorCurveBindingUtils.CollectRotationBindings(rigBuilder.transform, sourceObject.transform, bindings);
                EditorCurveBindingUtils.CollectPropertyBindings(rigBuilder.transform, constraint, ((IMultiRotationConstraintData)constraint.data).sourceObjectsProperty + ".m_Item" + i + ".weight", bindings);
            }

            return(bindings);
        }
        public override IEnumerable <EditorCurveBinding> GetConstrainedCurveBindings(RigBuilder rigBuilder, BlendConstraint constraint)
        {
            var bindings    = new List <EditorCurveBinding>();
            var constrained = constraint.data.constrainedObject;

            if (constraint.data.blendPosition)
            {
                EditorCurveBindingUtils.CollectPositionBindings(rigBuilder.transform, constrained, bindings);
            }

            if (constraint.data.blendRotation)
            {
                EditorCurveBindingUtils.CollectRotationBindings(rigBuilder.transform, constrained, bindings);
            }

            return(bindings);
        }
        public override IEnumerable <EditorCurveBinding> GetConstrainedCurveBindings(RigBuilder rigBuilder, ChainIKConstraint constraint)
        {
            var bindings = new List <EditorCurveBinding>();

            var root = constraint.data.root;
            var tip  = constraint.data.tip;

            var tmp = tip;

            while (tmp != root)
            {
                EditorCurveBindingUtils.CollectRotationBindings(rigBuilder.transform, tmp, bindings);
                tmp = tmp.parent;
            }
            EditorCurveBindingUtils.CollectRotationBindings(rigBuilder.transform, root, bindings);

            return(bindings);
        }
        public override IEnumerable <EditorCurveBinding> GetSourceCurveBindings(RigBuilder rigBuilder, BlendConstraint constraint)
        {
            var bindings = new List <EditorCurveBinding>();
            var sourceA  = constraint.data.sourceObjectA;
            var sourceB  = constraint.data.sourceObjectB;

            if (constraint.data.blendPosition)
            {
                EditorCurveBindingUtils.CollectPositionBindings(rigBuilder.transform, sourceA, bindings);
                EditorCurveBindingUtils.CollectPositionBindings(rigBuilder.transform, sourceB, bindings);
            }

            if (constraint.data.blendRotation)
            {
                EditorCurveBindingUtils.CollectRotationBindings(rigBuilder.transform, sourceA, bindings);
                EditorCurveBindingUtils.CollectRotationBindings(rigBuilder.transform, sourceB, bindings);
            }

            return(bindings);
        }