Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Removing color picker from ColorField

    Cinema 4D SDK
    python r20
    5
    9
    1.4k
    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.
    • A
      aturtur
      last edited by r_gigante

      Hello!

      I'm creating simple GeDialog and I'm wondering is it possible to remove color picker that is now default in ColorField in C4D R20?

      For my use what I'm trying to achieve there is no need for color picker and it is taking too much space from my dialog.

      alt text

      Script:

      import c4d
      from c4d.gui import GeDialog
      
      class Dialog(GeDialog): 
          def __init__(self):
              super(Dialog, self).__init__()
       
          def CreateLayout(self):
              self.SetTitle("Dialog")
              self.GroupBegin(1000, c4d.BFH_LEFT, 0, 0)
              self.AddColorField(1001, c4d.BFH_CENTER)
              self.GroupEnd()
              return True
        
      dlg = Dialog()
      dlg.Open(c4d.DLG_TYPE_ASYNC, 0, -2, -2)
      
      1 Reply Last reply Reply Quote 1
      • S
        s_bach
        last edited by

        Hello,

        unfortunately it is currently not possible to hide the color picker icon in R20.

        best wishes,
        Sebastian

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • C4DSC
          C4DS
          last edited by C4DS

          I am with the OP.
          Can we please have an option in future updates where this color picker can be hidden (Python and C++ SDK please).
          Thanks

          1 Reply Last reply Reply Quote 0
          • kbarK
            kbar
            last edited by kbar

            I am resurrecting this post again. Is it possible yet to hide the color picker?

            Also I want to disable the expander arrow on the left that lets users expand to view other settings. All I want to show is a color on screen, when they click it then it should show the Color Picker dialog.

            Anything in R21 upwards?

            I may have to implement my own custom gui widget to simply draw a small square box it seems.

            1 Reply Last reply Reply Quote 0
            • M
              m_adam
              last edited by

              Hi Unfortunately this is still the same status, I will try to see what we can do in the future.
              Nevertheless, in case, we would implement a new flag, this will not be propagated to previous versions.

              Cheers,
              Maxime.

              MAXON SDK Specialist

              Development Blog, MAXON Registered Developer

              1 Reply Last reply Reply Quote 0
              • kbarK
                kbar
                last edited by kbar

                Thanks Maxime. I may write a custom gui, which would effectively be just a square for the color. Is there a way to bring up a colorchooser dialog? I can't seem to see one, but perhaps you know of an internal command we could call that would allow us to display the dialog and get the resulting color picked?

                Thanks,
                Kent

                1 Reply Last reply Reply Quote 0
                • M
                  m_adam
                  last edited by

                  Hi @kbar you can open a ColorCooser dialog with c4d.gui.ColorDialog in python and GeChooseColor or GeChooseColorAlpha in C++.

                  Cheers,
                  Maxime.

                  MAXON SDK Specialist

                  Development Blog, MAXON Registered Developer

                  1 Reply Last reply Reply Quote 1
                  • M
                    m_adam
                    last edited by m_adam

                    And sorry @kbar, @C4DS, @aturtur I should have found it earlier, but after looking at how to implement it, I figured out it's already possible since R21 with the flag DR_COLORFIELD_NO_SCREENPICKER

                    import c4d
                    
                    
                    class MyDialog (c4d.gui.GeDialog):
                        
                        def CreateLayout(self):
                            self.AddColorField(1000, c4d.BFH_LEFT | c4d.BFV_TOP, colorflags=c4d.DR_COLORFIELD_NO_SCREENPICKER)
                    
                            return True
                    
                    if __name__=='__main__':   
                        global dialog
                        dialog = MyDialog()
                        dialog.Open(c4d.DLG_TYPE_ASYNC, xpos=-2, ypos=-2)
                    

                    Cheers,
                    Maxime.

                    MAXON SDK Specialist

                    Development Blog, MAXON Registered Developer

                    1 Reply Last reply Reply Quote 1
                    • kbarK
                      kbar
                      last edited by kbar

                      This post is deleted!
                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post