AddColorField Init Value

On 18/05/2014 at 15:14, xxxxxxxx wrote:

HI! How initialize the ColorField??? Thanks!!!

COLOR = 10009

class MyDialog(gui.GeDialog) :

def CreateLayout(self) :
        self.AddColorField (COLOR, c4d.BFH_SCALEFIT, 80, 12)
        return True

def InitValues(self) : 
        defaults=c4d.BaseContainer()
        defaults. SetVector (1, c4d.Vector(1,0,0))
        return True

On 19/05/2014 at 12:17, xxxxxxxx wrote:

Try it like this:

import c4d  
from c4d import gui  
  
MY_COLORFIELD = 10009  
  
class Dialog(c4d.gui.GeDialog) :  
  def CreateLayout(self) :          
      self.AddColorField(MY_COLORFIELD, c4d.BFH_LEFT | c4d.BFV_TOP, 40, 15)   
      return True  
   
  def InitValues(self) :          
      color = c4d.Vector(1,0,0)   #Red  
      brightness = 0.3            #Change this to change the brightness  
      maxBrightness = 1.0  
      self.SetColorField(MY_COLORFIELD, color, brightness, maxBrightness, c4d.DR_COLORFIELD_BODYPAINT)          
      return True  
  
def main() :  
  myDialog = Dialog()  
  myDialog.Open(c4d.DLG_TYPE_MODAL_RESIZEABLE)  
    
if __name__=='__main__':  
  main()

-ScottA

On 21/05/2014 at 02:27, xxxxxxxx wrote:

Thanks ScottA!!! 🙂