THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 09/09/2008 at 11:19, xxxxxxxx wrote:
Ok, this is incredible.
I have set up a Coffee script that enumerates all objects that I want to render, sets the document's playback time to match the number, activates the right object at the right time - but now I am stuck (well working on the next workaround after 2 other workarounds failed).
In theory, I only need to rename the image file. Sounds easy? It isn't. The first idea was to call a remote script after each frame which would simply rename the current image. Well that works in principle. But in order to make it work, I would need to pass some information to that script I want to run: the target's filename.
Well, so I tried to access that remote variable in Coffee. But right now, it seems impossible. The RDATA_EXTERNAL id seems to be used for something different. Or doesn't work. Or is not the right ID. I don't know, the filename object I retrieve is not containing anything meaningful it seems or at least I can't access it.
Ok, then the second idea was to write the current frame filename into a info.txt file and my remote-rename script would open that file and rename the file. But new(Filename) or new(BaseFile) just returned nil in my coffee script function. Ok, looks like it should not be done.
So I wrote a plugin coffee script which spits out the currently active object's name into a file. Works fine. But not if called from the coffee expression. C4d freezes then. Well, maybe not a good idea it seems.
Then I tried to invoke an OS command. Didn't work neither.
Actually I am now considering to write a plugin that spits out the full list of filenames into a file that is then processed by a single remote script. I only need to figure out in that remote script then which number is referring to which filename.... I think that plan is now failsafe.
I just want to say: the whole thing is horrible. The irony is that on the draft board it sounded perfectly easy and well suited for a scripting language: rendering a couple of objects into distinct files...
I wanted to avoid to install a C++ environment, downloading the SDK, setting all up just for this "simple" task - how wrong was I.
I really like c4d - but this whole experience is just ... disappointing.