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

    Forcing GetDDescription() refresh in ToolData plugin (EventAdd not working)

    Cinema 4D SDK
    c++
    2
    3
    19
    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.
    • Viktor VelickoV
      Viktor Velicko
      last edited by

      Hi,
      I’m writing a ToolData plugin with the C++ SDK.
      I see that GetDDescription() is automatically called when:
      the tool is first activated (before InitTool()),the user interacts with the Attribute Manager (e.g. clicks on a choice control),and when parameters change.
      That works fine.

      But I also need to refresh the Attribute Manager description when my tool state changes during runtime (for example inside MouseInput(), or after some internal state update).

      I tried calling : EventAdd(EVENT_FORCEREDRAW);
      …but this does not cause GetDDescription() to be called again for my tool.

      So my questions are:
      What is the correct way to force GetDDescription() to run again for a ToolData plugin?
      Is there a specific event or API call I should use to tell the Attribute Manager to rebuild the description?
      Any best practices for dynamically updating tool descriptions at runtime?

      Thanks!

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

        Hey @Viktor-Velicko I'm busy this week and I will be able to have a deeper look at it only next week.

        With that's said here are few hints (at least what I would try first).

        • Send COREMSG_CINEMA_FORCE_AM_UPDATE.
        • Call GeUpdateUI.
        • It may not be possible at all to do during a drag operation (but I will ask about it only once the two previous solutions are confirmed to not work, which I do not have the time to test right now).

        Cheers,
        Maxime

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • Viktor VelickoV
          Viktor Velicko
          last edited by

          Thank you, Maxim.
          No further testing is needed—this works very well.
          I’m calling it from the ToolData::MouseInput() callback at the end, which is sufficient. The panel updates nicely after the mouse event finishes (on mouse up).

          SendCoreMessage(COREMSG_CINEMA, BaseContainer(COREMSG_CINEMA_FORCE_AM_UPDATE));
          GeUpdateUI();

          You can close this thread.
          Thanks!
          V.

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