Read fbx from python with cinema4d

I tried loading fbx using python with cinema4d. If you load fbx from gui, the dialog of read option will appear, but if you specify it from the script, you can prevent it from appearing, so use it as needed.

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()

reference

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

Recommended Posts

Read fbx from python with cinema4d
[Python] Read From Stdin
Read line by line from a file with Python
Read csv with python pandas
Let's write python with cinema4d.
With skype, notify with skype from python!
Read json data with python
Read QR code from image file with Python (Mac)
Call C from Python with DragonFFI
Install Python from source with Ansible
[python] Read information with Redmine API
Read files in parallel with Python
Call python from nim with Nimpy
Read a file in Python with a relative path from the program
I read "Reinforcement Learning with Python: From Introduction to Practice" Chapter 1
[python] Extract text from pdf and read characters aloud with Open-Jtalk
Collecting information from Twitter with Python (Twitter API)
Receive textual data from mysql with python
Get html from element with Python selenium
[Note] Get data from PostgreSQL with Python
Play audio files from Python with interrupts
Create wordcloud from your tweet with python3
Read CSV file with python (Download & parse CSV file)
Business efficiency starting from scratch with Python
Working with Azure CosmosDB from Python Part.2
Image acquisition from camera with Python + OpenCV
Getting started with Dynamo from Python boto
[Python] Read images with OpenCV (for beginners)
Try calling Python from Ruby with thrift
Scraping from an authenticated site with python
[Automation] Read a Word document with Python
Use C ++ functions from python with pybind11
Read text in images with python OCR
[Automation] Read mail (msg file) with Python
FizzBuzz with Python3
Scraping with Python
Statistics with python
Scraping with Python
Twilio with Python
Integrate with Python
Play with 2016-Python
sql from python
AES256 with python
python starts with ()
MeCab from Python
Bingo with python
Zundokokiyoshi with python
[Implementation example] Read the file line by line with Cython (Python) from the last line
Excel with Python
[python] Read data
Microcomputer with Python
Cast with python
Csv output from Google search with [Python]! 【Easy】
Extract text from PowerPoint with Python! (Compatible with tables)
Read data with python / netCDF> nc.variables [] / Check data size
Read Python csv data with Pandas ⇒ Graph with Matplotlib
Image processing from scratch with python (5) Fourier transform
Read JSON with Python and output as CSV
Medical image analysis with Python 1 (Read MRI image with SimpleITK)
Read table data in PDF file with Python
[Python] How to read data from CIFAR-10 and CIFAR-100