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).
I have a dialog button which hangs when I click it but it only hangs for a specific scene.
From looking at the printout in the python console window, it appears that when I click the 'Submit' button, it never reaches the call to Command()
TTR_PLUGIN_ID = 999121032 TTR_CANCEL_BUTTON = 12003 TTR_SUBMIT_BUTTON = 12004
def Command(self, id, msg): print('TurnTableRenderDialog::Command()') print('id = {}'.format(id)) print('TTR_SUBMIT_BUTTON = {}'.format(TTR_SUBMIT_BUTTON)) if (id == TTR_SUBMIT_BUTTON): print('TTR_SUBMIT_BUTTON')
def CreateLayout(self): ''' Frame Chunk size, Render folder prefix Frame range (start, end) ''' self.SetTitle('Submit turn table to Tractor (PlutoWithDamage)') self.GroupBegin(id=1013, flags=c4d.BFH_SCALEFIT, cols=1) # self.GroupBegin(id=1014, flags=c4d.BFH_SCALEFIT, cols=2) self.AddStaticText(TTR_COMMENT_LABEL, c4d.BFV_MASK | c4d.BFH_RIGHT, name="Comments") self.AddEditText(TTR_COMMENT_EDIT, c4d.BFV_MASK | c4d.BFH_LEFT, initw=400) self.AddStaticText(TTR_FRAME_RANGE_LABEL, c4d.BFV_MASK | c4d.BFH_RIGHT, name="Frame range (start,end,step)") self.GroupBegin(id=1015, flags=c4d.BFH_SCALEFIT, cols=3) self.AddEditNumberArrows(TTR_FRAME_RANGE_START, c4d.BFV_MASK, initw=100) self.AddEditNumberArrows(TTR_FRAME_RANGE_END, c4d.BFV_MASK, initw=100) self.AddEditNumberArrows(TTR_FRAME_RANGE_STEP, c4d.BFV_MASK, initw=100) self.GroupEnd() self.GroupEnd() # self.GroupBegin(id=1016, flags=c4d.BFV_MASK | c4d.BFH_RIGHT, cols=2) self.AddButton(TTR_CANCEL_BUTTON, c4d.BFV_MASK | c4d.BFH_RIGHT, initw=100, name="Cancel") self.AddButton(TTR_SUBMIT_BUTTON, c4d.BFV_MASK | c4d.BFH_RIGHT, initw=100, name="Submit") self.GroupEnd()
Hi @nicholas_yue,
what @m_adam meant with his posting (he did the edit on my post), was that you should get a proper plugin id for TTR_PLUGIN_ID (new plugin ids are currently roughly in the 1,000,000 range, which is why yours does stand out). Probably with the assumption that TTR_PLUGIN_ID is somewhere used as an id to register a plugin.
TTR_PLUGIN_ID
GeDialog
Int32
To get to the ground of your problem, you should post your modified code and any exceptions Cinema does raise in its console.
Cheers, Ferdinand
thank you for reaching out to us. It is a bit unclear to us what you mean by hanging on specific scenes, i.e. we are not able to reproduce this. However, you made the mistake of not conforming to the signatures of both GeDialog.Command and GeDialog.CreateLayout, both being defined as methods with a boolean return type (see docs for details). When fixing that, the code will run as one would expect here on my machine. Below you will find a "fixed" version (I just added an explicit return value to both functions, conforming to signatures).
GeDialog.Command
GeDialog.CreateLayout
import c4d TTR_PLUGIN_ID = 999121032 TTR_CANCEL_BUTTON = 12003 TTR_SUBMIT_BUTTON = 12004 TTR_COMMENT_LABEL = 0 TTR_COMMENT_EDIT = 1 TTR_FRAME_RANGE_LABEL = 2 TTR_FRAME_RANGE_START = 3 TTR_FRAME_RANGE_END = 4 TTR_FRAME_RANGE_STEP = 5 class MyDialog(c4d.gui.GeDialog): """ """ def Command(self, id, msg): print('TurnTableRenderDialog::Command()') print('id = {}'.format(id)) print('TTR_SUBMIT_BUTTON = {}'.format(TTR_SUBMIT_BUTTON)) if (id == TTR_SUBMIT_BUTTON): print('TTR_SUBMIT_BUTTON') return True def CreateLayout(self): ''' Frame Chunk size, Render folder prefix Frame range (start, end) ''' self.SetTitle('Submit turn table to Tractor (PlutoWithDamage)') self.GroupBegin(id=1013, flags=c4d.BFH_SCALEFIT, cols=1) # self.GroupBegin(id=1014, flags=c4d.BFH_SCALEFIT, cols=2) self.AddStaticText(TTR_COMMENT_LABEL, c4d.BFV_MASK | c4d.BFH_RIGHT, name="Comments") self.AddEditText(TTR_COMMENT_EDIT, c4d.BFV_MASK | c4d.BFH_LEFT, initw=400) self.AddStaticText(TTR_FRAME_RANGE_LABEL, c4d.BFV_MASK | c4d.BFH_RIGHT, name="Frame range (start,end,step)") self.GroupBegin(id=1015, flags=c4d.BFH_SCALEFIT, cols=3) self.AddEditNumberArrows( TTR_FRAME_RANGE_START, c4d.BFV_MASK, initw=100) self.AddEditNumberArrows(TTR_FRAME_RANGE_END, c4d.BFV_MASK, initw=100) self.AddEditNumberArrows(TTR_FRAME_RANGE_STEP, c4d.BFV_MASK, initw=100) self.GroupEnd() self.GroupEnd() # self.GroupBegin(id=1016, flags=c4d.BFV_MASK | c4d.BFH_RIGHT, cols=2) self.AddButton(TTR_CANCEL_BUTTON, c4d.BFV_MASK | c4d.BFH_RIGHT, initw=100, name="Cancel") self.AddButton(TTR_SUBMIT_BUTTON, c4d.BFV_MASK | c4d.BFH_RIGHT, initw=100, name="Submit") self.GroupEnd() return True if __name__ == "__main__": dlg = MyDialog() dlg.Open(c4d.DLG_TYPE_ASYNC, xpos=-1, ypos=-1, defaultw=500, defaulth=500)
EDIT: Please ensure your Plugin Id come from https://plugincafe.maxon.net/c4dpluginid_cp in order to be sure this is a real Unique ID and nobody else will use it.
I have generated the IDs from the site you recommended.
When I replace the plugin IDs with those generated from https://plugincafe.maxon.net/c4dpluginid_cp the menu would not even load.
Cheers
@zipit There was a typo when updating to use the new IDs generated from Maxon, it has since been resolved and the plugins are loading.
Hi,
without further feedback, we will consider this thread as solved by Monday and flag it accordingly.