How to run Python script at moment scene is opened?
wob last edited by
I'm trying to write cinema 4d python script, that will auto-run render function when scene is opened. How to run Python script at moment scene is opened?
zipit last edited by
unfortunately the is no feature in Cinema that will let you execute a script when a document has been loaded.
- Technically you could abuse one of the scripting nodes to do what you want to do, but I would not recommend this, due them being bound to a threaded execution and other pitfalls.
- You could write yourself a plugin that does what you want. A
MessageDataplugin could be used for that for example.
- When you are not interested Cinema's GUI, you could also use c4dpy. Here I have recently shown, how you could use c4dpy to execute scripts on documents from the command line.
m_magalhaes last edited by m_magalhaes
welcome to the forum and thanks for reaching us. :)
The workflow you are trying to achieve is a bit strange. Executing a script to launch a render when you open a scene is not something you always want to be active.
You could also create a script that ask for a folder and than open, launch the render and close the scene.
In our example you will find an example on how to launch a render
Using a MessageData will not really help since the message sent when you open a document need to be catched by the
Messagefunction and the MessageData only rely on CoreMessage.
Of course if you have any question feel free to ask. (we like to keep one thread per question)
I forgot in c++ you have the SceneHookData but it's not available in python.
m_magalhaes last edited by
i'll set that thread to solved tomorrow without further feedback