LoginSignup
0
1

More than 5 years have passed since last update.

cinema4dでpythonからfbxを読み込む

Last updated at Posted at 2016-05-03

cinema4dでpythonを使いfbxを読み込んでみた。fbxをgui上から読み込むと読み込みオプションのダイアログがでてしまうが、スクリプトから指定すると出ないようにできるので、必要に応じで使う。

savefbx.py
import c4d
from c4d import plugins

def main():

    # Find the FBX importer plugin
    plug = plugins.FindPlugin(1026369, c4d.PLUGINTYPE_SCENELOADER)
    if plug is None:
        return

    # Access the settings
    op = {}
    if plug.Message(c4d.MSG_RETRIEVEPRIVATEDATA, op):
        print op

    fbximport = op["imexporter"]
    if fbximport is None:
        return

    # Define the settings
    fbximport[c4d.FBXIMPORT_CAMERAS] = False

    # Import without dialogs
    c4d.documents.MergeDocument(doc, "/filepath/001.fbx", c4d.SCENEFILTER_OBJECTS|c4d.SCENEFILTER_MATERIALS, None)

    c4d.EventAdd()

if __name__=='__main__':
    main()

参考

How can I one-click the fbx import?
http://www.plugincafe.com/forum/forum_posts.asp?TID=11784

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1