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

    Time Limit for MSG_DESCRIPTION_CHECKUPDATE

    Cinema 4D SDK
    python
    2
    5
    955
    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.
    • merkvilsonM
      merkvilson
      last edited by

      '''
      Hello PluginCafe! 🙂

      I need to apply SetDirty() function only after finishing the manipulation process of the desired parameter.

      Something like this is implemented in the material preview.
      The update takes place only after ~0.5 seconds after finishing the manipulation.
      alt text

      So, I tried to check updates via MSG_DESCRIPTION_CHECKUPDATE and calculate the time by utilizing timeit module

      '''

              start = timeit.default_timer() #Start Timer
      
              if type == c4d.MSG_DESCRIPTION_CHECKUPDATE: 
      
                  if data["descid"][0].id == TEST_SLIDER: #Check if TEST_SLIDERis updated
                      
                      end = timeit.default_timer() #End Timer
                          if end - start > 1: #Do something if time took more than 1 sec
                              self.bmp.SetDirty()
                              node.SetDirty(c4d.DIRTYFLAGS_DATA)
      
      

      But unfortunately, I can't find the solution in the documentation.

      What am I doing wrong and how to do this properly?

      1 Reply Last reply Reply Quote 0
      • S
        s_bach
        last edited by

        Hello,

        you could react to the message MSG_DESCRIPTION_USERINTERACTION_END which is sent after the user stopped interacting with the parameter in the Attribute Manager.

        You find a list of related messages in the NodeData::Message() Manual.

        best wishes,
        Sebastian

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 2
        • merkvilsonM
          merkvilson
          last edited by

          Is this feature available for Python?

          1 Reply Last reply Reply Quote 0
          • merkvilsonM
            merkvilson
            last edited by merkvilson

            Nice 💙 it works with python but how to check only one parameter instead of everything?

            something like this

                    if type == c4d.MSG_DESCRIPTION_USERINTERACTION_END:
                        if data["descid"][0].id == TEST_SLIDER: 
                            print "Finished"
            
            
            1 Reply Last reply Reply Quote 0
            • S
              s_bach
              last edited by

              Hello,

              the message MSG_DESCRIPTION_USERINTERACTION_END has no data. You could store the old value of the parameter in question and check if that value has changed.

              best wishes,
              Sebastian

              MAXON SDK Specialist

              Development Blog, MAXON Registered Developer

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