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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    GetColorRGB fail on some values

    Scheduled Pinned Locked Moved Bugs
    6 Posts 0 Posters 1.8k 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 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

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

        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

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

          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()
          
          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            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

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

              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 ! 🙂

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

                On 13/12/2017 at 23:57, xxxxxxxx wrote:

                Hello,

                I filed a bug report.

                best wishes,
                Sebastian

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