GetColorRGB fail on some values
-
On 12/12/2017 at 02:22, xxxxxxxx wrote:
User Information:
Cinema 4D Version:
Platform:
Language(s) : PYTHON ;---------
data = c4d.gui.GeDialog().GetColorRGB(c4d.COLOR_TEXT) print data data = c4d.gui.GeDialog().GetColorRGB(c4d.COLOR_TEXTFOCUS) print data
The first one work, the second one return None
-
On 13/12/2017 at 04:35, xxxxxxxx wrote:
Hello,
can you explain what exactly you are doing? GeDialog is the base class for defining a custom dialog class. GetColorRGB() is a member function that is supposed to be used from within that dialog class. So creating a "GeDialog" instance is not really a thing.
best wishes,
Sebastian -
On 13/12/2017 at 05:01, xxxxxxxx wrote:
I just want to retrieve the color of the COLOR_TEXTFOCUS, in order to store it in some Constant class I made and there is no other way for doing it as I know.
Note that code produce the same things. (Pretty obvious since it's the the same code, since self is nothing more than the object)
So first one works, second return None.import c4d class test(c4d.gui.GeDialog) : def __init__(self) : print self.GetColorRGB(c4d.COLOR_TEXT) #Return rgb data print self.GetColorRGB(c4d.COLOR_TEXTFOCUS) # Return None test()
-
On 13/12/2017 at 09:28, xxxxxxxx wrote:
Hello,
the problem is that at __ini__() the dialog is not yet a real dialog; it hasn't allocated all resources. You actually have to display the dialog with .Open() to do that. If you call GetColorRGB() in the context of e.g. GeDialog.CreateLayout() you can obtain COLOR_TEXTFOCUS without problem.
best wishes,
Sebastian -
On 13/12/2017 at 10:13, xxxxxxxx wrote:
But I guess it's a bug, since it's not written, that the dialog has to be open to retrieve some values.
Color are not really related to GeDialog, imagine I would like to have this color into a bitmap?
The only way to retrieve that is to open an empty dialog, get the color and close the dialog.
It's a weird workflow...And again same enum, but fails on some, succes on others while this is just a color, it just read some values, and return them, nothing fanzy.
Anyway thanks you !
-
On 13/12/2017 at 23:57, xxxxxxxx wrote:
Hello,
I filed a bug report.
best wishes,
Sebastian