On 15/11/2015 at 14:58, xxxxxxxx wrote:
Hi all,
Not so much a plugin question, but a script question, hope I'm in the right place for this.
I need to export After Effects composition files for a *lot* of c4d files and I want to automate this. So in Script Manager, I made this little script that iterates through all c4d files in a directory, loads it, sets some render parameters, and now the script needs to click the 'Save Project File...' button and export the After Effects .aec file. But I can't find the command that actually clicks that button. It does not appear in the Script log.
Is there a neat way to click this button?
Any solutions will be rewarded with Belgian trappist ale
Here's what I got so far:
> import c4d
>
> from c4d import gui
>
> import os
>
> import sys
>
>
>
>
> #Welcome to the world of Python
>
>
>
>
>
>
>
> def main() :
>
> c4d.CallCommand(13957) # cls
>
> path=c4d.storage.LoadDialog(c4d.FILESELECTTYPE_ANYTHING, "Please choose a folder", c4d.FILESELECT_DIRECTORY)
>
> dirList=os.listdir(path)
>
> for fname in dirList:
>
> fullName = path + os.path.sep + fname
>
> if fullName.endswith("*.c4d") :
>
> c4d.documents.LoadFile(fullName)
>
> c4d.CallCommand(12161) # Edit Render Settings...
>
> renderdata()[c4d.RDATA_PROJECTFILE]=True
>
> renderdata()[c4d.RDATA_PROJECTFILELOCAL]=True
>
> renderdata()[c4d.RDATA_PROJECTFILEDATA]=True
>
> renderdata()[c4d.RDATA_PROJECTFILETYPE]=0 #Target app: After Effects
>
> # And now what?
>
>
>
> if __name__=='__main__':
>
> main()