On 06/07/2015 at 07:09, xxxxxxxx wrote:
yes it's possible with GeDialog.GetColorRGB(), but it's just so inconvenient. GeDialog.SetDefaultColor()
wants a color vector, but GetColorRGB() returns a dictionary with values in RGB space.
def get_color(dlg, color_id) :
col = dlg.GetColorRGB(color_id)
return c4d.Vector(col['r'], col['g'], col['b']) * (1.0 / 255)
if engine in SUPPORTED_RENDERERS:
self.SetDefaultColor(res.STR_RENDERER, c4d.COLOR_TEXT, c4d.Vector(1.0, 0.2, 0.0))
self.SetDefaultColor(res.STR_RENDERER, c4d.COLOR_TEXT, get_color(self, c4d.COLOR_TEXT))
It would be nice if the SetDefaultColor() function would just accept None or the dialog would have a
function to get the color as a Vector already. This is just something that makes the programmers life
unpleasent and its only one part where I think things could be improved to make them easier. Passing
None would be logical, you could just pass None and if it works you're fine, but otherwise you have to
look into the SDK how to do it otherwise.