Export FBX files

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  11 November 2011
Export FBX files

Hi all,
I was wondering if there is a way from c4d (r13) to save a fbx file. You can save a scene in other formats with the

c4d.documents.SaveDocument(doc, fn, saveflags, format)
format :
 - FORMAT_Q3DEXPORT	QuickDraw 3D export
 - FORMAT_D3DEXPORT	Direct3D import

python command.

Since I'm fairly new with those API, perhaps am I missing something?

Any help will be really appreciated
  11 November 2011
Try this:

 import os
 import c4d
 from c4d import storage
 def main():
 	path = c4d.storage.GeGetC4DPath(c4d.C4D_PATH_DESKTOP)
 	path = os.path.join(path,'testscene.fbx')
 	c4d.documents.SaveDocument(doc,path,c4d.SAVEDOCUME  NTFLAGS_DONTADDTORECENTLIST,1026370) #Exports using the FBX exporter
 if __name__=='__main__':

You'll have to remove the empty space between the letter "E" and "N" in the SaveDocument code. This forum sometimes mangles the code we post.

*Note to R12 users that the ID# to export .fbx 2010.2 is:1023841

My Gallery

Last edited by Scott Ayers : 11 November 2011 at 03:48 AM.
  11 November 2011
Thank you Scott!
This works smoothly.
Just one question, where did you find that ID? Could you point me to the right direction? For example, if I would like to export this time in COLLADA, where should I search for the correct ID?

Otherwise, I would have to summon you everytime I don't find something

Thank you again Scott.
  11 November 2011
They are undocumented ID's.
I found them by using a C++ routine Matthias provided at the plugincafe.com.

Python does have a similar function to look them up:
dest = plugins.FilterPluginList(c4d.PLUGINTYPE_SCENESAVER, True)

But unfortunately it only returns the string name for the exporters. Which is useless to us.
The C++ code I have uses GetID() in it.Which I don't see available in Python.

Here's an image with the other R13 exporter ID#'s

My Gallery
  11 November 2011
Thank you very much Scott, you have been VERY helpful.
It's time for me to look up some IDs by myself now

I think I will configure a C++ "helper" project so I should be able to find the "latest" information directly from the SDK library.


Last edited by inglobetechnologies : 11 November 2011 at 08:47 AM.
  05 May 2012
I have another question regarding exporting fbx files, so I use my old thread instead of creating a new one.

The problem is the following:
I can access the BaseContainer object of the FBX plugin by using this python line:
 container = c4d.plugins.GetWorldPluginData(fbx_plugin_id)

this object contains all parameters to configure the FBX export process, like exporting normals, file format (ASCII or Binary) and so on.
Now, my goal is to configure the FBX exporter, so I use the following code to modify the container object

 for id, value in container:
        if id == c4d.FBXEXPORT_ASCII: container[id] = 1
        elif id == c4d.FBXEXPORT_BAKE_ALL_FRAMES: container[id] = 0
        elif id == c4d.FBXEXPORT_SAVE_NORMALS: container[id] = 1
        elif id == c4d.FBXEXPORT_ANIMATION: container[id] = 1
        elif id == c4d.FBXEXPORT_TEXTURES: container[id] = 1
        elif id == c4d.FBXEXPORT_EMBED_TEXTURES: container[id] = 1

and then I assign this updated container to the FBX plugin like this and create the fbx file:

c4d.plugins.SetWorldPluginData(fbx_plugin_id, container)
c4d.documents.SaveDocument(doc,fbx_filepath, c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST, fbx_plugin_id)

the problem is: even if the container object is correctly updated, the fbx file is not created respecting it
Maybe this container is not the one responsible for the proper FBX plugin configuration?

Anyone can help me about that? Maybe am I missing something crucial?

Thanks in advance for the answers
  05 May 2012
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 08:07 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.