Hello,
When the dialog of my CommandData is already opened and I re-execute my CommandData the InitValues() function for example it executed only the first time dialog open.
To re-execute the InitValues() each time I execute my CommandData I added self.dialog.Close() before the self.dialog.Open() function.
How can I do that without closing the dialog each time I execute my CommandData plugin?
class MyDlg(c4d.gui.GeDialog):
def CreateLayout(self):
...
def InitValues(self):
Print("Hello World!")
class MyCommandData(c4d.plugins.CommandData):
dialog = None
def Execute(self, doc):
# Creates the dialog if its not already exists
if self.dialog is None: self.dialog = MyDlg()
# Close the dialog if its open
self.dialog.Close()
# Opens the dialog
return self.dialog.Open(dlgtype=c4d.DLG_TYPE_ASYNC, pluginid=PLUGIN_ID, defaultw=500, defaulth=120,
xpos=512, ypos=128)