Exemplo n.º 1
0
        public FbxMatrix GetNodeLocalTransform(FbxNode pNode, FbxTime pTime, FbxNode.EPivotSet pPivotSet = FbxNode.EPivotSet.eSourcePivot, bool pApplyTarget = false, bool pForceEval = false)
        {
            var translation = GetNodeLocalTranslation(pNode, pTime, pPivotSet, pApplyTarget, pForceEval);
            var rotation    = GetNodeLocalRotation(pNode, pTime, pPivotSet, pApplyTarget, pForceEval);
            var scaling     = GetNodeLocalScaling(pNode, pTime, pPivotSet, pApplyTarget, pForceEval);
            var m           = new FbxMatrix(translation, rotation, scaling);

            return(m);
        }
Exemplo n.º 2
0
 //Add a child node and its underlying node tree.
 public bool AddChild(FbxNode pNode)
 {
     if (pNode == null)
     {
         return(false);
     }
     this.ConnectSrcObject(pNode);
     return(true);
 }
Exemplo n.º 3
0
 void DisconnectScene(FbxNode child)
 {
     if (child.Scene != null)
     {
         child.DisconnectDstObject(child.Scene);
     }
     foreach (var subchild in child.ChildNodes)
     {
         DisconnectScene(subchild);
     }
 }
Exemplo n.º 4
0
        public FbxMatrix GetNodeGlobalTransform(FbxNode pNode, FbxTime pTime, FbxNode.EPivotSet pPivotSet = FbxNode.EPivotSet.eSourcePivot, bool pApplyTarget = false, bool pForceEval = false)
        {
            var m = GetNodeLocalTransform(pNode, pTime, pPivotSet, pApplyTarget, pForceEval);

            if (pNode.GetParent() != null)
            {
                var p = GetNodeGlobalTransform(pNode.GetParent(), pTime, pPivotSet, pApplyTarget, pForceEval);
                m = p * m;
            }
            return(m);
        }
Exemplo n.º 5
0
        protected void _PrintFbxNodeAttribute(FbxNodeAttribute obj, TextWriter writer)
        {
            writer.WriteLine("    AttributeType = {0}", obj.GetAttributeType());
            int i;

            writer.WriteLine("    NodeCount = {0}", obj.GetNodeCount());
            for (i = 0; i < obj.GetNodeCount(); i++)
            {
                FbxNode node = obj.GetNode(i);
                writer.WriteLine("        #{0} {1}", i, PrintObjectID(node));
            }
        }
Exemplo n.º 6
0
        public FbxScene(string name = "")
            : base(name)
        {
            RootNode = new FbxNode();

            Poses     = SrcObjects.CreateCollectionView <FbxPose>();
            Materials = SrcObjects.CreateCollectionView <FbxSurfaceMaterial>();
            Textures  = SrcObjects.CreateCollectionView <FbxTexture>();
            Nodes     = SrcObjects.CreateCollectionView <FbxNode>();

            SrcObjects.Add(new FbxGlobalSettings());
            SetAnimationEvaluator(new FbxAnimEvaluator());
        }
Exemplo n.º 7
0
        public bool AddNode(FbxNode pNode)
        {
            if (!Nodes.Contains(pNode))
            {
                ConnectSrcObject(pNode);
                foreach (var child in pNode.ChildNodes)
                {
                    AddNode(child);
                }
                return(true);
            }

            return(false);
        }
Exemplo n.º 8
0
        public bool RemoveNode(FbxNode pNode)
        {
            if (Nodes.Contains(pNode))
            {
                DisconnectSrcObject(pNode);
                foreach (var child in pNode.ChildNodes)
                {
                    RemoveNode(child);
                }
                return(true);
            }

            return(false);
        }
Exemplo n.º 9
0
        public void SetLink(FbxNode pNode)
        {
            if (GetLink() == pNode)
            {
                return;
            }

            if (GetLink() != null)
            {
                DisconnectSrcObject(GetLink());
            }

            ConnectSrcObject(pNode);
        }
Exemplo n.º 10
0
        public int Add(FbxNode pNode, FbxMatrix pMatrix, bool pLocalMatrix = false /*, bool pMultipleBindPose=true*/)
        {
            var match = poseInfos.FindIndex(pi => pi.Node == pNode);

            if (match >= 0)
            {
                if (poseInfos[match].Matrix != pMatrix)
                {
                    return(-1);
                }
                return(match);
            }

            var p = new FbxPoseInfo(pNode, pMatrix, pLocalMatrix);

            poseInfos.Add(p);

            return(poseInfos.IndexOf(p));
        }
Exemplo n.º 11
0
        protected void AcceptNode(FbxNode node, ISet <object> visitedObjects)
        {
            AcceptFbxObject(node, visitedObjects);
            Visit(node);

            if (node.GetParent() != null)
            {
                Accept(node.GetParent(), visitedObjects);
            }

            int i;

            for (i = 0; i < node.GetChildCount(); i++)
            {
                Accept(node.GetChild(i), visitedObjects);
            }

            //if (node.GetTarget() != null)
            //{
            //    Accept(node.GetTarget());
            //}
            //if (node.GetTargetUp() != null)
            //{
            //    Accept(node.GetTargetUp());
            //}

            for (i = 0; i < node.GetNodeAttributeCount(); i++)
            {
                Accept(node.GetNodeAttributeByIndex(i), visitedObjects);
            }

            for (i = 0; i < node.GetMaterialCount(); i++)
            {
                Accept(node.GetMaterial(i), visitedObjects);
            }
        }
Exemplo n.º 12
0
 public virtual void Visit(FbxNode node)
 {
 }
Exemplo n.º 13
0
 public void SetAssociateModel(FbxNode pNode)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 14
0
 public FbxVector4 GetNodeLocalRotation(FbxNode pNode)
 {
     return(GetNodeLocalRotation(pNode, FbxTime.Infinite));
 }
Exemplo n.º 15
0
 public FbxVector4 GetNodeLocalScaling(FbxNode pNode)
 {
     return(GetNodeLocalScaling(pNode, FbxTime.Infinite));
 }
Exemplo n.º 16
0
 public FbxVector4 GetNodeLocalScaling(FbxNode pNode, FbxTime pTime, FbxNode.EPivotSet pPivotSet = FbxNode.EPivotSet.eSourcePivot, bool pApplyTarget = false, bool pForceEval = false)
 {
     return(GetPropertyValue <FbxVector4>(pNode.LclScaling, pTime, pForceEval));
 }
Exemplo n.º 17
0
 public FbxMatrix GetNodeGlobalTransform(FbxNode pNode)
 {
     return(GetNodeGlobalTransform(pNode, FbxTime.Infinite));
 }
Exemplo n.º 18
0
 public FbxPoseInfo(FbxNode node, FbxMatrix matrix, bool matrixIsLocal = false)
 {
     Node          = node;
     Matrix        = matrix;
     MatrixIsLocal = matrixIsLocal;
 }
Exemplo n.º 19
0
        protected void AcceptFbxNode(FbxNode obj, ISet <object> visitedObjects = null)
        {
            Visit(obj);

            _AcceptFbxNode(obj, visitedObjects);
        }
Exemplo n.º 20
0
 public virtual void Visit(FbxNode obj)
 {
 }
Exemplo n.º 21
0
 public void ComputeLocalTRSFromGlobal(out FbxVector4 pRetLT, out FbxVector4 pRetLR, out FbxVector4 pRetLS, FbxNode pNode, FbxMatrix pGX, FbxTime pTime, FbxNode.EPivotSet pPivotSet = FbxNode.EPivotSet.eSourcePivot, bool pApplyTarget = false, bool pForceEval = false)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 22
0
 public void Flush(FbxNode pNode)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 23
0
 protected void PrintFbxNode(FbxNode obj, TextWriter writer)
 {
     _PrintFbxNode(obj, writer);
 }
Exemplo n.º 24
0
 public void ComputeLocalTRSFromGlobal(out FbxVector4 pRetLT, out FbxVector4 pRetLR, out FbxVector4 pRetLS, FbxNode pNode, FbxMatrix pGX)
 {
     ComputeLocalTRSFromGlobal(out pRetLT, out pRetLR, out pRetLS, pNode, pGX, FbxTime.Infinite);
 }