public Animations.AnimatableProperty <Transforms.SparseWeight8> UseMorphing()
        {
            if (_Morphings == null)
            {
                _Morphings       = new Animations.AnimatableProperty <Transforms.SparseWeight8>();
                _Morphings.Value = default;
            }

            return(_Morphings);
        }
Beispiel #2
0
        public Animations.AnimatableProperty <ArraySegment <float> > UseMorphing()
        {
            if (_Morphings == null)
            {
                _Morphings       = new Animations.AnimatableProperty <ArraySegment <float> >();
                _Morphings.Value = default;
            }

            return(_Morphings);
        }
Beispiel #3
0
        public void SetMorphAnimation(Node dstNode, Animations.AnimatableProperty <Transforms.SparseWeight8> animation)
        {
            if (animation == null)
            {
                return;
            }

            var dstMesh = dstNode.Mesh;

            dstMesh.SetMorphWeights(default);
Beispiel #4
0
        public Animations.AnimatableProperty <ArraySegment <float> > UseMorphing()
        {
            if (this is FixedTransformer)
            {
                throw new InvalidOperationException($"Internal {nameof(FixedTransformer)} does not support animations. Use {nameof(SceneBuilder.AddRigidMesh)}(MeshBuilder mesh, NodeBuilder node) to add an animatable instance");
            }

            if (_Morphings == null)
            {
                _Morphings       = new Animations.AnimatableProperty <ArraySegment <float> >();
                _Morphings.Value = default;
            }

            return(_Morphings);
        }
Beispiel #5
0
        public static void SetMorphAnimation(Node dstNode, Animations.AnimatableProperty <Transforms.SparseWeight8> animation)
        {
            if (animation == null)
            {
                return;
            }

            var dstMesh = dstNode.Mesh;

            dstMesh.SetMorphWeights(animation.Value);

            foreach (var t in animation.Tracks)
            {
                dstNode.WithMorphingAnimation(t.Key, t.Value);
            }
        }
Beispiel #6
0
        public static void SetMorphAnimation(Node dstNode, Animations.AnimatableProperty <Transforms.SparseWeight8> animation)
        {
            Guard.NotNull(dstNode, nameof(dstNode));
            Guard.NotNull(dstNode.Mesh, nameof(dstNode.Mesh), "call after IOperator.ApplyTo");

            if (animation == null)
            {
                return;
            }

            var dstMesh = dstNode.Mesh;

            dstMesh.SetMorphWeights(animation.Value);

            foreach (var t in animation.Tracks)
            {
                dstNode.WithMorphingAnimation(t.Key, t.Value);
            }
        }