Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    AddColorField Init Value

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 304 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

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

          Thanks ScottA!!! 🙂

          1 Reply Last reply Reply Quote 0
          • First post
            Last post