Example #1
0
        public void PrintObject(FbxObject obj, TextWriter writer)
        {
            writer.WriteLine("${0}", PrintObjectID(obj));  // extra $ for easy text search
            writer.WriteLine("    Name = {0}", quote(obj.GetName()));
            writer.WriteLine("    ClassId = {0}", obj.GetType().Name /*obj.GetRuntimeClassId().GetName()*/);
            writer.WriteLine("    UniqueId = {0}", obj.GetUniqueID());
            writer.WriteLine("    GetScene() = {0}", PrintObjectID(obj.GetScene()));
//            writer.Write("    GetDocument() = {0}", PrintObjectID(obj.GetDocument()));
//            writer.Write("    GetRootDocument() = {0}", PrintObjectID(obj.GetRootDocument()));
            writer.WriteLine("    SrcObjectCount = {0}", obj.GetSrcObjectCount());

            int i;

            for (i = 0; i < obj.GetSrcObjectCount(); i++)
            {
                FbxObject srcObj = obj.GetSrcObject(i);
                writer.WriteLine("        #{0} {1}", i, PrintObjectID(srcObj));
            }
            writer.Write("    DstObjectCount = {0}", obj.GetDstObjectCount());
            for (i = 0; i < obj.GetDstObjectCount(); i++)
            {
                FbxObject dstObj = obj.GetDstObject(i);
                writer.WriteLine("        #{0} {1}", i, PrintObjectID(dstObj));
            }

            var prop = obj.GetFirstProperty();
            int n    = 0;

            while (prop != null && prop.IsValid())
            {
                n++;
                prop = obj.GetNextProperty(prop);
            }
            writer.WriteLine("    Properties {0}", n);

            prop = obj.GetFirstProperty();
            n    = 0;
            while (prop != null && prop.IsValid())
            {
                writer.WriteLine("        #{0} {1}", n, PrintPropertyID(prop));
                PrintProperty(prop, true);
                n++;
                prop = obj.GetNextProperty(prop);
            }

            writer.WriteLine("    SrcPropertyCount = {0}", obj.GetSrcPropertyCount());
            for (i = 0; i < obj.GetSrcPropertyCount(); i++)
            {
                prop = obj.GetSrcProperty(i);
                writer.Write("        #{0} ", i);
                PrintPropertyID(prop);
                writer.WriteLine();
            }
            writer.WriteLine("    DstPropertyCount = {0}", obj.GetDstPropertyCount());
            for (i = 0; i < obj.GetDstPropertyCount(); i++)
            {
                prop = obj.GetDstProperty(i);
                writer.Write("        #{0} ", i);
                PrintPropertyID(prop);
                writer.WriteLine();
            }
            if (obj.RootProperty.IsValid())
            {
                writer.Write("    RootProperty ");
                PrintPropertyID(obj.RootProperty);
                writer.WriteLine();
                PrintProperty(obj.RootProperty);
            }


//            if (obj is Collection)
//                PrintCollection(obj as Collection);
//            else
            if (obj is FbxAnimCurve)
            {
                PrintAnimCurve(obj as FbxAnimCurve);
            }
//            else if (obj is AnimCurveNode)
//                PrintAnimCurveNode(obj as AnimCurveNode);
//            else if (obj is Deformer)
//                PrintDeformer(obj as Deformer);
//            else if (obj is Node)
//                PrintNode(obj as Node);
//            else if (obj is NodeAttribute)
//                PrintNodeAttribute(obj as NodeAttribute);
//            else if (obj is Pose)
//                PrintPose(obj as Pose);
//            else if (obj is SubDeformer)
//                PrintSubDeformer(obj as SubDeformer);
//            else if (obj is SurfaceMaterial)
//                PrintSurfaceMaterial(obj as SurfaceMaterial);
//            else if (obj is Texture)
//                PrintTexture(obj as Texture);
//            else if (obj is Video)
//                PrintVideo(obj as Video);
            else
            {
                writer.WriteLine("Unknown object class: {0}", obj.GetType().Name /*obj.GetRuntimeClassId().GetName()*/);
            }

            writer.WriteLine();
        }
Example #2
0
        public void _PrintFbxObject(FbxObject obj, TextWriter writer)
        {
            writer.WriteLine("${0}", PrintObjectID(obj));  // extra $ for easy text search
            writer.WriteLine("    Name = {0}", quote(obj.GetName()));
            writer.WriteLine("    ClassId = {0}", obj.GetType().Name /*obj.GetRuntimeClassId().GetName()*/);
            writer.WriteLine("    UniqueId = {0}", obj.GetUniqueID());
            writer.WriteLine("    GetScene() = {0}", PrintObjectID(obj.GetScene()));
//            writer.Write("    GetDocument() = {0}", PrintObjectID(obj.GetDocument()));
//            writer.Write("    GetRootDocument() = {0}", PrintObjectID(obj.GetRootDocument()));
            writer.WriteLine("    SrcObjectCount = {0}", obj.GetSrcObjectCount());

            int i;

            for (i = 0; i < obj.GetSrcObjectCount(); i++)
            {
                FbxObject srcObj = obj.GetSrcObject(i);
                writer.WriteLine("        #{0} {1}", i, PrintObjectID(srcObj));
            }
            writer.WriteLine("    DstObjectCount = {0}", obj.GetDstObjectCount());
            for (i = 0; i < obj.GetDstObjectCount(); i++)
            {
                FbxObject dstObj = obj.GetDstObject(i);
                writer.WriteLine("        #{0} {1}", i, PrintObjectID(dstObj));
            }

            var prop = obj.GetFirstProperty();
            int n    = 0;

            while (prop != null && prop.IsValid())
            {
                n++;
                prop = obj.GetNextProperty(prop);
            }
            writer.WriteLine("    Properties {0}", n);

            prop = obj.GetFirstProperty();
            n    = 0;
            while (prop != null && prop.IsValid())
            {
                writer.WriteLine("        #{0} {1}", n, PrintPropertyID(prop));
                PrintProperty(prop, writer, true);
                n++;
                prop = obj.GetNextProperty(prop);
            }

            writer.WriteLine("    SrcPropertyCount = {0}", obj.GetSrcPropertyCount());
            for (i = 0; i < obj.GetSrcPropertyCount(); i++)
            {
                prop = obj.GetSrcProperty(i);
                writer.WriteLine("        #{0} {1}", i, PrintPropertyID(prop));
            }
            writer.WriteLine("    DstPropertyCount = {0}", obj.GetDstPropertyCount());
            for (i = 0; i < obj.GetDstPropertyCount(); i++)
            {
                prop = obj.GetDstProperty(i);
                writer.WriteLine("        #{0} {1}", i, PrintPropertyID(prop));
            }
            if (obj.RootProperty.IsValid())
            {
                writer.WriteLine("    RootProperty = {0}", PrintPropertyID(obj.RootProperty));
                PrintProperty(obj.RootProperty, writer);
            }
        }