Python Exporter example?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 30/03/2012 at 11:20, xxxxxxxx wrote:

    Hi All
    I have had some requests to do an exporter for Cinema 4D for a system I have created and being a new user for Cinema 4D I was wondering if there are handy example python scripts to show how to build a simple exporter, and python examples of how to extract the Morph data for an object.
    Thanks
    Chris



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 31/03/2012 at 06:47, xxxxxxxx wrote:

    Hi, C4D differs between a Python script and a Python plugin (same for coffee). A script is most used to simplify the workflow or to automate tasks. The entire scope of the script will be destroyed after it has been executed. You can use a script where you extract the data from the scene and save it via a save-dialog to a file.

    However, a plugin might be more useful here because there are hooks that allow you to place the exporter in the exporter submenu of "File->Export". Take a look at the documentation and the class c4d.plugins.SceneSaverData. Inherit from this class and overwrite the Save function which is called when the user wants to export the file.

    There is also an example in the examples folder of the documentation called "Py-IESMeta.pyp" which exports information of IES files to a human-readable text file.

    Btw, what exactly do you mean by morph data?

    Cheers, Sebastian



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 31/03/2012 at 06:57, xxxxxxxx wrote:

    Thank you for clearing that up, I am a total newbie with C4D, having looked further I think I will try COFFEE. I need the morph/blendshape data so that I can export it to Unity via my system, I have already written exporters for Max, Maya and Blender and I am getting a fair few requests for me to support Cinema 4D. You can see the system I am talking about at http://www.west-racing.com/mf/?page_id=257
    Thanks again.
    Chris


Log in to reply