Is there a call to c4d to ascertain if there are unsaved changes in the current session. The current session was started from opening a file from disk.
I am using R21 on Windows and using Python.
I read that I can get the RenderData object via
rdata = doc.GetActiveRenderData()
I see that frame range values are documented here
I am reading the following
hoping there might be some directory browsing UI.
My intention is to allow the user to pick an output directory for some processing.
I have difficulty keeping the label for a edit UI component on the same line with the following code. I want the FRAME_CHUNK_EDIT to the right of FRAME_CHUNK_LABEL
def CreateLayout(self) : ''' Frame Chunk size, Render folder prefix Frame range (start, end) ''' self.GroupBegin(id=1013, flags=c4d.BFH_SCALEFIT, cols=1) # self.GroupBegin(id=1014, flags=c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT, cols=1) self.AddStaticText(FRAME_CHUNK_LABEL, c4d.BFV_MASK, name="Frame Chunk size") self.AddEditNumberArrows(FRAME_CHUNK_EDIT, c4d.BFV_MASK, initw=100) self.GroupEnd() # self.AddButton(SUBMIT_BUTTON, c4d.BFV_MASK, initw=100, name="Submit") self.GroupEnd() return True
Unfortunately, there is no built-in way to control MessageBox within Cinema4D.
The only way for you is to install a 3rd party python package, here a possible one https://github.com/asweigart/pyautogui.
But I am running the script with c4dpy, there is no UI.
Is there something I can call in c4dpy to tell the current active session to default to "Yes", it seems that c4dpy defaults to "No"
DESCFLAGS_SET_USERINTERACTION there was a prompt in my script.
Update XRef (Yes) or replace (No)?
How do I respond (Yes) in my script ?
I have the following code which was able to get the path but can't update the path
flags = c4d.SCENEFILTER_MERGESCENE | c4d.SCENEFILTER_OBJECTS | c4d.SCENEFILTER_MATERIALS active_doc = c4d.documents.GetActiveDocument() merge_status = c4d.documents.MergeDocument(active_doc, target_scene, flags) assert(merge_status) # Model[c4d.ID_CA_XREF_FILE] obj_name_to_search = 'Model' xref = active_doc.SearchObject(obj_name_to_search) alembic_path = xref.GetParameter(c4d.ID_CA_XREF_FILE, c4d.DESCFLAGS_GET_NONE) print(alembic_path) status = xref.SetParameter(c4d.ID_CA_XREF_FILE, animated_alembic_file, c4d.DESCFLAGS_SET_PARAM_SET) assert(status) if True: c4d.documents.SaveDocument(active_doc, target_scene, c4d.SAVEDOCUMENTFLAGS_0, c4d.FORMAT_C4DEXPORT)
I have been using GetNext() and GetDown() to perform depth first visit of the scene. That works fine.
I wish to now perform some operations a a given hierarchy level.
Is there some GetNodeListsAtCurrentLevel() type of methods ?
I am using the Python API with R21