3

I have a ten frame .fbx file of an animal walking. This file includes a rigged model with textures, but I am only interested in the mesh of the model at each frame.

How can I use Python FBX SDK or Python Blender SDK to export each frame of the fbx file into an obj file?

Am I approaching this the wrong way? Should I try to find a way to do this manually in Maya/Blender first?

pcpetepete
  • 65
  • 2
  • 6

1 Answers1

8

its a example for fbx to obj import fbx

# Create an SDK manager                                                                                           
manager = fbx.FbxManager.Create()

# Create a scene
scene = fbx.FbxScene.Create(manager, "")

# Create an importer object                                                                                                  
importer = fbx.FbxImporter.Create(manager, "")

# Path to the .obj file
milfalcon = "samples/millenium-falcon/millenium-falcon.fbx"

# Specify the path and name of the file to be imported                                                                            
importstat = importer.Initialize(milfalcon, -1)

importstat = importer.Import(scene)

# Create an exporter object                                                                                                  
exporter = fbx.FbxExporter.Create(manager, "")

save_path = "samples/millenium-falcon/millenium-falcon.obj"

# Specify the path and name of the file to be imported                                                                            
exportstat = exporter.Initialize(save_path, -1)

exportstat = exporter.Export(scene)
Ari Gold
  • 1,528
  • 11
  • 18
  • Thank you very much @Ari, I will test this out later and see if it works for me. I appreciate your fast response. – pcpetepete Oct 19 '16 at 16:13
  • welcome, i think you will refactor here and there but it should work – Ari Gold Oct 19 '16 at 16:17
  • It works pretty well. However, it gives me one output file for ten frames. Also, @Ari, do you have a link to the documentation? – pcpetepete Oct 20 '16 at 02:24
  • sure, you will find all needed information here http://download.autodesk.com/us/fbx/20112/FBX_SDK_HELP/index.html?url=WS73099cc142f48755-751de9951262947c01c-6dc7.htm,topicNumber=d0e8430 – Ari Gold Oct 20 '16 at 09:01