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

    MSG_UPDATE is sent after pressing button in Material Data

    Cinema 4D SDK
    c++ r20
    2
    3
    741
    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.
    • P
      peterakos
      last edited by peterakos

      Hello.

      When I press a button in MaterialData, the message MSG_DESCRIPTION_COMMAND is sent.
      After that I always receive a MSG_UPDATE as well.
      Is there anything I should do to avoid that ?

      After handling the button callback, I return TRUE.

      Thank you.

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

        Hi @peterakos, MSG_DESCRIPTION_COMMAND is used to trigger the action of pressing the button.
        But in most of the case, if there is a button, it's to do something, so actually modify something which will then probably trigger a MSG_UPDATE.

        Moreover you can test it with a Python Generator and UserData button attached. If you click on the button only MSG_DESCRIPTION_COMMAND is triggered.

        import c4d
        
        def message(id, data):
            if id == c4d.MSG_DESCRIPTION_COMMAND:
                print "Button Clicked"
            elif id == c4d.MSG_UPDATE:
                print "MSG_UPDATE"
                
            return True
        
        def main():
            return c4d.BaseObject(c4d.Ocube)
        

        May I ask you what are you trying to achieve?
        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 3
        • P
          peterakos
          last edited by

          Hello.

          Thank you very much for your clarification on this.
          I have a button in MaterialData that saves the material in a specific format in the disk.
          I doesn't change anything in the material but the MSG_UPDATE is sent anyway.
          So, since I don't want to run the MSG_UPDATE handler, I have to set a flag to true in order to skip it.

          Thank you.

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