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
    • Register
    • Login

    Force update interface of the plugin

    Cinema 4D SDK
    c++ sdk
    3
    4
    1.0k
    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.
    • V
      victor
      last edited by

      I have an asychronous call that needs to update the panel interface of my plugin for this I make something like:
      ((BaseObject*)this->Get())->GetDataInstance()->SetString(OBJECT_INFO, MaxonString("New value of the text string"));

      Unfortunatly until I select again the same object I don't see this change in the interface.

      Any tip on this?

      Thank you in advance.

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

        You have to "tell" the object that its data has been updated.
        See here: https://developers.maxon.net/docs/cpp/2023_2/class_c4_d_atom.html#a89b4a7026485f0a69fd6595623a491f6

        Just pass "MSG_CHANGE", that should do the trick.

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

          Hi Victor, after each change in order to trigger c4d update you have to add an event (in order to say hey I've done something, please C4D refresh)
          It's done through EventAdd.
          Moreover even if in python we directly set the basecontainer. In C++ it's recommended to use SetParemeter as describe In this manual

          Regarding advice from @mp5gosu, MSG_CHANGE is only needed when the structure of the object change (you change the count of point for example) since SetParemeter will automatically increase the dirty count of an object is not needed in your case.

          Finally, there is a small macro in R20 "_s" to create a Maxon::String which allows you to write
          "New value of the text"_s instead of MaxonString("New value of the text string")

          If you have questions, please let me know.
          Cheers,
          Maxime!

          MAXON SDK Specialist

          Development Blog, MAXON Registered Developer

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

            @m_adam said in Force update interface of the plugin:

            Regarding advice from @mp5gosu, MSG_CHANGE is only needed when the structure of the object change (you change the count of point for example) since SetParemeter will automatically increase the dirty count of an object is not needed in your case.

            Sorry, I actually meant EventAdd().

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