I have a basic question, but I haven't been able to find an answer on the forums or internet search.
How do you open an GeDialog to its default width and height? I've tried using integers, 0, and gui.SizePix() (though I believe that is for UI gadgets) with defaultw and defaulth.
from c4d import gui
myDialog = MyDialog()
myDialog.Open(c4d.DLG_TYPE_MODAL, xpos=-2, ypos=-2, defaultw=528,
My dialog is opening as a square.
I found this post but it only mentions that DLG_TYPE_ASYNC types cannot have their sizes set.
How can I open a modal to its default width and height?
this is a knowed bug, please see this thread
Combined with this thread
you can end up with this kind of sript
from c4d import gui
this static function allow you to retrieve the id of the current script.
the name, must be the filename, not a custom name.
name = os.path.splitext(os.path.basename(__file__))
if name is None:
pluginList = c4d.plugins.FilterPluginList(c4d.PLUGINTYPE_COMMAND, True)
for plugin in pluginList:
if plugin.GetName() == name:
self.SetTitle('Dummy Dialog 700x200px')
self.AddMultiLineEditText(1000, c4d.BFH_SCALEFIT, inith=50, initw=500, style=c4d.DR_MULTILINE_READONLY)
self.SetString(1000, "Hello World!")
if self.GroupBegin(1001, c4d.BFH_CENTER, 2, 1):
self.ok = False
def Command(self, id, msg):
self.ok = True
pluginID = OptionsDialog.GetScriptIdByName()
if pluginID is None:
dlg = OptionsDialog()
dlg.Open(c4d.DLG_TYPE_MODAL, pluginid = pluginID , xpos=-2, ypos=-2, defaultw=700, defaulth=200)
your script works fine for me (I am on Win R20 and get a rectangle shaped dialog). What is your environment?
@zipit Thank you for checking.
I'm on a PC, Windows 10, Cinema 4D R21. I experienced this unpredictability in my Command Plugin, so then tried it again with this simple script in the Script Editor to the same results.
I'm wondering if window size preferences are getting set somehow. It's very bizarre (and frustrating!).
@m_magalhaes Thank you for this workaround. I hope to see that bug fixed soon! It seems like one that would affect many scripts & plugins.