I have a commanddata plugin that has options enabled using the PLUGINFLAG_COMMAND_OPTION_DIALOG flag.
On the pc everything is ok, I see the option icon in the command and I can select it.
However, on the mac (Catalina 10.15.6) I do not see the option icon and when I click the command (the commanddata plugin), it goes directly to ExecuteOptionID() and not to Execute()
Here the stripped code
import c4d
import os
import sys
from c4d import gui, plugins, bitmaps, documents
from c4d import utils
PLUGIN_ID_MESHBOOLEAN_COMMAND_SUBTRACT = 1039980
class MyOptionsDialogSUBSTRACT(gui.GeDialog):
OK = False
def InitValues(self):
return True
def CreateLayout(self):
self.SetTitle("MeshBoolean Command SUBSTRACT Test 01")
self.AddDlgGroup(c4d.DLG_OK | c4d.DLG_CANCEL)
return True
def Command(self, id, msg):
if (id == 1):
self.OK = True
self.Close()
if (id == 2):
self.OK = False
self.Close()
return True
class MESHBOOLEANSUBSTRACT(plugins.CommandData):
dialog = None
def Execute(self, doc):
print ("Execute")
print ("Done test")
return True #end plugin
def ExecuteOptionID(self, doc, plugid, subid):
print ("ExecuteOptionID")
if self.dialog is None: self.dialog = MyOptionsDialogSUBSTRACT()
self.dialog.Open(dlgtype=c4d.DLG_TYPE_MODAL, pluginid=PLUGIN_ID_MESHBOOLEAN_COMMAND_SUBTRACT, defaultw=500, defaulth=120)
print ("OK: ", self.dialog.OK)
if (self.dialog.OK):
self.Execute(doc)
self.dialog.OK = False
return True
if __name__ == "__main__":
pluginString = "MeshBoolean Command Subtract"
bmp = bitmaps.BaseBitmap()
dir, file = os.path.split(__file__)
fn = os.path.join(dir, "res", "command subtract.png")
bmp.InitWith(fn)
okyn = plugins.RegisterCommandPlugin(id=PLUGIN_ID_MESHBOOLEAN_COMMAND_SUBTRACT, str="#$1 " + pluginString, info=c4d.PLUGINFLAG_COMMAND_OPTION_DIALOG, help="MeshBoolean Command", dat=MESHBOOLEANSUBSTRACT(), icon=bmp)
if (not okyn):
print("Error initializing " + pluginString)