In the mean time I will cycle through takes, AOVs and Frames manually to get the paths.
Is there a way to output all renderpaths? Perhaps via the token system?
I tried setting up the token system to get to the render paths, but it seems to me, like it is basically the same as building your own string replacement. You still have to manually input all the relevant stuff in to the dictionary, am I wrong?
If only something like $take is used that might be handy, but if you are e.g. trying to output all paths that have tokens like $take, $pass and $frame and you have to cycle through them manually changing the values in the dictionary then that's not really more practical than just searching for the token string and replacing it.
Am I missing some great functionality of the token system that would allow me to just print all the render output paths?
Thanks! I'll try that.
Thanks for your answer.
Is there a way to directly get that variable in Cinema, or is it basically just modifying the string into something that isn't recognized by Cinema? For me it looks like I now have to seperate the string by finding the '=' or something like that. Is that what I have to do?
I want to do pretty much what was proposed in this thread. That is passing a script via sys.argv.
It seems that Cinema is trying to load the file after I'm done with my stuff and since it doesn't recognize the filetype I get an error "Unrecognized file format!".
I tried consuming the path with sys.argv.remove(path), but that didn't really seem to do anything.
How can I prevent Cinema from attempting to open the path?
I'm just going to go ahead and mark this as solved.
Either using an empty Basecontainer or the set function solve the problem.
Thank you for explaining!
Interesting. What I was doing is this:
doc = c4d.documents.GetActiveDocument() fps = 25 docSettings = doc.GetDocumentData(c4d.DOCUMENTSETTINGS_GENERAL) docSettings[c4d.DOCUMENT_FPS] = fps doc.SetDocumentData(c4d.DOCUMENTSETTINGS_GENERAL, docSettings)
Which does cause the problem even if directly entered via the python console.
I don't know why that is bad exactly. At this point I was only changing the FPS, at another place a bunch of other stuff. It seemed logical to do it this way. Is using the get/set functions the better way to do that?
I am trying to change some stuff in reaction to the user changing settings.
To do that I catch c4d.EVMSG_CHANGE and change some document settings via SetDocumentData.
The problem I encountered is that SetDocumentData seems to switch the attribute editor to the active tool after it's done.
That means I can't get to any other attributes, because e.g. selecting an object triggers SetDocumentData and switches back from the object settings to the tool.
Maybe c4d.EVMSG_CHANGE is a little overkill to detect changes, but I don't know a better way.
How do I stop SetDocumentData from switching what is shown in the attribute editor?
Or if that's not possible how can I change something like the document framerate in reaction to something the user does?
Thanks for the input!
It's a shame you can't fiddle with the palettes. I think I'll just do it like x-particles and have a command that loads the palette and the user can dock it himself. Not the most elegant, but gets the job done.
Is it possible to have a command plugin insert an icon/button into the standard palette on startup?
I am aware that changing layouts would be something I would have to deal with seperately, but is it generally possible to do what you would normally do via the 'customize commands' menu from within the plugin code?
Turns out my issues are two seperate, but equally self inflicted problems :)
Inserting and activating works as expected, I am blocking the update with some custom UI stuff so I will have to find a solution for that. Calling EventAdd() in the closeEvent of the UI doesn't do anything. Is there another way to force Cinema to update everything?
Killing the document not only doesn't update, but actually crashes Cinema, because I am trying to kill the document from within a callback that is reacting to MSG_DOCUMENTINFO_TYPE_LOAD. I am doing some more involved environment management and sometimes I have to close a document after loading.
I have a workaround that will have to do for now. In the callback I change the document path to a string I can then look for in EVMSG_CHANGE. When I detect my string there, I can then kill the document. It's not very elegant and if anyone has a better solution I would be very happy, but otherwise consider this problem solved :)
When trying to close a document via killDocument the Cinema window doesn't update the editor views, the object manager etc. until you click them. EventAdd() does not seem to do the trick.
I also tried switching to a different document first via SetActiveDocument() to then kill the other document in the background, but it seems SetActiveDocument() has the same problem and does not automatically update the editor.
What is the correct way to switch documents and have the editor show the new one?
I just noticed, that searching for "EventAdd()" crashes the forum for me.
I don't know why that specific String does it, I couldn't reproduce it with other search queries.
The results load, but then I can't click anything and after a while Chrome tells me the page has crashed.