On 09/04/2014 at 14:20, xxxxxxxx wrote:
Hi,
For my script purpose i need to frame the first object that i have merged in my scene before rendering.
this 2 commands c4d.CallCommand(12148) # Frame Geometry c4d.CallCommand(13038) # Frame Selected Elements do not frame the object in the viewport. It seem over-zoomed on the object...
If i paste one of these command in the console , there it frame wellthe object...
Any idea how to make it works?
for infile in glob.glob(scenesPath+"\*.c4d") :
fname, ext = os.path.splitext(infile)
c4d.documents.LoadFile(refPath+'\param.c4d')
doc = c4d.documents.GetActiveDocument()
docview=doc.GetActiveBaseDraw()
c4d.documents.MergeDocument(doc,infile,c4d.SCENEFILTER_OBJECTS|c4d.SCENEFILTER_MATERIALS|c4d.SCENEFILTER_DIALOGSALLOWED|c4d.SCENEFILTER_MERGESCENE)
mycam=docview.GetSceneCamera(doc)
mycam.SetFocus(35)
obj=doc.GetFirstObject()
doc.SetActiveObject(obj)
obj.Message(c4d.MSG_UPDATE)
c4d.CallCommand(12148) # Frame Geometry
c4d.CallCommand(13038) # Frame Selected Elements
macam.SetFocus(25)
c4d.EventAdd()
return
...