Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
c4d studying...
I'm a Maya user. 3D Creator. mel, python,VBS
thank you for your reply.
If possible, I wanted to see the rendering results during rendering.
>If you want to display the result of the render while it's running, you will need to create your own GeDialog with a UserArea that will display the BMP. The BMP should be a global variable.
I wanna try!thank you!
Thank you for your comment! Yes. I want to queue several renders.
I also want to operate the screen while rendering.
CallCommand must be used inside the mainThread otherwise it will not work. Is that so. thank you.
I have another question. Is there an SDK to perform the rendering?
I want to perform rendering while looking at the rendering result like [Render to Picture Viewer].
Hello, I am always indebted to you. When rendering is finished, I want to perform rendering again. However, I am in trouble because the second command is not executed. I want you to tell me. Please.
import c4d from c4d import gui import datetime import time import threading PLUGIN_ID = 1058983 renderQ = 2 rdCheck = 0 class MainDialog(c4d.gui.GeDialog): def CreateLayout(self): self.SetTitle('Main Dialog') self.AddButton(1000, 0, name="RenderStart") self.AddButton(1001, 0, name="stop") return True def Command(self, Id, bc): global renderQ global rdCheck thread_rendercheck = threading.Thread(target=RenderCheck) if Id == 1000: RenderSetting() print('start Render') c4d.CallCommand(12099) thread_rendercheck.start() elif Id == 1001: renderQ = 0 rdCheck = 0 print('stop') def RenderSetting(): now = datetime.datetime.now() doc = c4d.documents.GetActiveDocument() renderData = doc.GetActiveRenderData() filename = 'path/test_'+str(now.microsecond)+'.png' renderData[c4d.RDATA_PATH] = filename renderData = doc.GetActiveRenderData().GetData() print(renderData[c4d.RDATA_PATH]) def RenderCheck(): global renderQ global rdCheck rdCheck = 1 while renderQ > 0: rdCheck = c4d.CheckIsRunning(c4d.CHECKISRUNNING_EXTERNALRENDERING) print("...now rendering") time.sleep(1) if rdCheck == 0: print('end') renderQ -= 1 print('render more… '+str(renderQ)) if renderQ > 0: RenderSetting() c4d.CallCommand(12099) print('start Render') return True class MainDialogCommand(c4d.plugins.CommandData): dialog = None def Execute(self, doc): if self.dialog is None: self.dialog = MainDialog() # Opens the dialog return self.dialog.Open(dlgtype=c4d.DLG_TYPE_ASYNC, pluginid=PLUGIN_ID, defaultw=400, defaulth=32) def RestoreLayout(self, sec_ref): if self.dialog is None: self.dialog = MainDialog() # Restores the layout return self.dialog.Restore(pluginid=PLUGIN_ID, secret=sec_ref) # main if __name__ == "__main__": # Registers the plugin c4d.plugins.RegisterCommandPlugin(id=PLUGIN_ID, str="Py-RenderShread_test_kt Dialog", info=0, help="RenderTest GUI", dat=MainDialogCommand(), icon=None)
Hello! @ferdinand ,@Cairyn
Thank you for politely teaching me!
I was able to solve the title problem. I will use an external editor. I also understood loading plugins!
I was restarting the software many times.
I have a new question, but if you study a little more and don't solve it, let me ask you another thread.
I'm really thankful to you!
I want to add another question.
Is there a rule for plug-in ID? What number or later should be used, etc ...
I feel it is dangerous because it may affect other functions.
https://developers.maxon.net/docs/Cinema4DPythonSDK/html/modules/c4d.plugins/BaseData/CommandData/index.html?highlight=commanddata#CommandData.Execute
Thank you for your reply! @Cairyn and @ferdinand
Thank you for your kind and polite reply.
I found that I need to program the CommandData plugin. I succeeded in saving the sample I received as a pyp and loading it as a plugin. I will study how to make it.
When I looked at Maxon's official website, I found a description that could create "Hallo CommandData!", But I couldn't find this window myself.
Is there a window in which you can create a program? Please tell me again. Thank you.
Nice to meet you.
I am not good at English. I have a question about pythonGUI.
windows10 Cinema4D S24.037
I created a window with buttons. I want to touch the “object manager” with the window open.
But, if you set the "dlgtype" of' “.open” to "DLG_TYPE_ASYNC", I can no longer click the button of the created window.
With the “DLG_TYPE_MODAL” setting, the button works, but I'm in trouble because other windows can't be touched.
Is there any other way? I would like you to tell me. Please.
import c4d from c4d import gui class MyDialogs(c4d.gui.GeDialog): def CreateLayout(self): self.AddButton(1201,c4d.BFH_LEFT,200,0,"button") return True def Command(self,id,msg): if id == 1201: print("push button") return True # Main function def main(): dlg = MyDialogs() dlg.Open(c4d.DLG_TYPE_ASYNC,0,-1,-1,100,100,0) c4d.EventAdd() # Execute main() if __name__=='__main__': main()