On 19/02/2015 at 08:56, xxxxxxxx wrote:
Hello All,
I have been working on a python script in C4D which has been progressing nicely. The script is part of the document, which automatically gets executed when there is a screen update, etc. I use this script to modify colors of mats, set timeline propterties, etc, based on a file input.
This works fine when I execute it within the GUI, however, when I want to render a movie or image of that same project via the commandline:
"...\CINEMA 4D R16\Commandline.exe" -render "...\TestComp_3Dmap.c4d" -frame 0 0
I see in the commandline an error with the script:
Traceback (most recent call last) :
...(some error)...
Printing useful details like the document works fine:
doc = 4d.documents.GetFirstDocument()
print doc
<c4d.documents.BaseDocument object called '' with ID 110059 at 0x0000007F9C4FC170>
however, when I try to print the doc's objects:
objs = doc.GetObjects()
print objs
[]
it returns with an empty list, where in the GUI it returns all the objects in the doc.
My question is, what am I doing wrong here, why does it behave differently in CommandLine vs the GUI? Perhaps I can place/start the script elsewhere to make it work?
Looking forward to possible answers,
David