Exemple #1
1
        public void FbxEporter()
        {
            //Generate an FBX document
            FbxDocument fbxDoc = new FbxDocument();
            FbxNode     t;

            //FBX Header Extension
            FbxHeaderExtension he = new FbxHeaderExtension();

            t = he.getFBXNode();
            fbxDoc.Nodes.Add(t);

            t       = new FbxNode();
            t.Name  = "Test";
            t.Value = (new List <int>()
            {
                0, 1, 2, 3, 4, 5, 6
            }).ToArray();

            fbxDoc.Nodes.Add(t);



            //Try to export
            FileStream     fs     = new FileStream("test.fbx", FileMode.Create);
            FbxAsciiWriter writer = new FbxAsciiWriter(fs);

            writer.Write(fbxDoc);
            fs.Close();
        }
Exemple #2
0
 /// <summary>
 /// Writes an FBX document
 /// </summary>
 /// <param name="document">The top level document node</param>
 /// <param name="path"></param>
 public static void WriteAscii(FbxDocument document, string path)
 {
     if (path == null)
     {
         throw new ArgumentNullException(nameof(path));
     }
     using (var stream = new FileStream(path, FileMode.Create))
     {
         var writer = new FbxAsciiWriter(stream);
         writer.Write(document);
     }
 }