I'm trying to create a simple script to use in Cinema 4D that will push the render settings to an external render manager called Smedge. The script is in Python. I haven't really done any programing in python, so I'm sort of stuck right now. Right now my script kicks out a file with my collected data in it, but I'm not sure how to make it execute. I've tried exec and eval. I don't really need it to kick out a file, I just did that so I could see how the information was getting formated. This is the code I've come up with so far. Any help would be appreciated. I can format it as a command line too if that would be easier.
-bsides
Code:
import c4d import os from c4d import documents,storage fps = doc.GetFps() scenename = doc.GetDocumentName() pathname = doc.GetDocumentPath() rd = doc.GetActiveRenderData() sizeX = int(rd[c4d.RDATA_XRES_VIRTUAL]) sizeY = int(rd[c4d.RDATA_YRES_VIRTUAL]) sf = (rd[c4d.RDATA_FRAMEFROM]).GetFrame(fps) ef = (rd[c4d.RDATA_FRAMETO]).GetFrame(fps) sm ='"C:\\Program Files (x86)\\Smedge\\submit.exe"' #Fix Os Path fn = os.path.join(pathname,scenename) sj = str(sm) + "\n" sj += "Type = 986184cd-04c1-451f-af66-f2947e405434\n" sj += "Scene = " + str(fn) + "\n" sj += "Range = " + str(sf) + " - " + str(ef) + "\n" sj += "Name = " + str(scenename) + "\n" sj += "PacketSize = 10\n" sj += "Pool = 68c19473-625f-4e7b-9fd3-a3ee79d331e1\n" sj += "CPUs = 4\n" #write to Disk same path file = open(doc.GetDocumentPath()+'/'+scenename+'.sj','w') file.write(sj) file.close() # Execute for send to render Farm exp = os.path.join(pathname,scenename+'.sj') ex = storage.GeExecuteFile(exp)
Comment