Hello. I recently hopped from R21 to R25 and noticed some weird behaviors with R25.
If I create a modal dialog with a color field in it and try to open the color picker window by clicking the color field, it doens't open in R25. This works in R21.
Code for the modal dialog setup:
import c4d
from c4d import gui
from c4d.gui import GeDialog
# Classes
class Dialog(GeDialog):
def __init__(self):
super(Dialog, self).__init__()
self.res = c4d.BaseContainer()
# Create Dialog
def CreateLayout(self):
self.SetTitle("Dialog")
self.GroupBegin(1000, c4d.BFH_CENTER, cols=1, rows=1, groupflags=1, initw=125, inith=0)
self.GroupBorderSpace(5, 5, 5, 5)
self.AddColorField(2002, c4d.BFH_FIT, initw=70, inith=13, colorflags=c4d.DR_COLORFIELD_POPUP)
self.SetColorField(2003, c4d.Vector(0,0,0), 1, 1, c4d.DR_COLORFIELD_ENABLE_COLORWHEEL)
self.GroupEnd()
return True
# Functions
def main():
dlg = Dialog() # Create dialog object
dlg.Open(c4d.DLG_TYPE_MODAL, 0, -1, -1, 0, 0) # Open dialog
# Execute main()
if __name__=='__main__':
main()
When creating an asynchronous dialog, the color chooser window will pop up correctly.
Code for the async dialog setup:
import c4d
from c4d import gui
from c4d.gui import GeDialog
# Classes
class Dialog(GeDialog):
def __init__(self):
super(Dialog, self).__init__()
self.res = c4d.BaseContainer()
# Create Dialog
def CreateLayout(self):
self.SetTitle("Dialog")
self.GroupBegin(1000, c4d.BFH_CENTER, cols=1, rows=1, groupflags=1, initw=125, inith=0)
self.GroupBorderSpace(5, 5, 5, 5)
self.AddColorField(2002, c4d.BFH_FIT, initw=70, inith=13, colorflags=c4d.DR_COLORFIELD_POPUP)
self.SetColorField(2003, c4d.Vector(0,0,0), 1, 1, c4d.DR_COLORFIELD_ENABLE_COLORWHEEL)
self.GroupEnd()
return True
# Open async dialog
dlg = Dialog() # Create dialog object
dlg.Open(c4d.DLG_TYPE_ASYNC, 0, -1, -1, 0, 0) # Open dialog
Is this a known bug or is something changed in the SDK that I should accomplish this an another way?
Btw, also the color picker doesn't work in the R25's color chooser window.
I'm running
Cinema 4D R25.010
Windows 10 (21H1)
Cheers,
Arttu