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

    Batching Slider messages

    Scheduled Pinned Locked Moved Cinema 4D SDK
    c++2026
    5 Posts 2 Posters 63 Views 1 Watching
    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.
    • SteveHill3DS Offline
      SteveHill3D
      last edited by

      My Tool gets a lot of messages when using sliders or dragging on numeric fields in the AM. In the C++ SDK (2026) is there an approved or suggested way to detect when the interaction has finished so that I can defer any heavy calculations until then? In particular I would like to add just one Undo for the entire interaction.

      Thanks.

      ferdinandF 1 Reply Last reply Reply Quote 0
      • ferdinandF Offline
        ferdinand @SteveHill3D
        last edited by ferdinand

        Hey @SteveHill3D,

        Thank you for reaching out to us. It depends a bit on what is your 'tool'. When it is a 'classic' tool, i.e., implemented as a ToolData with a GeDialog, then BFM_DRAGEND would be the way to sort out BFM_ACTION events for a slider that are the final action of a drag event. When you search for the message symbol BFM_DRAGEND and its sibling symbols BFM_DRAGSTART and BFM_ACTION_INDRAG here on the forum, you will find multiple code examples around the topic of sliders. I think there are also some examples in the C++ SDK.

        When your tool is a DescriptionToolData, i.e., a node in disguise, then you cannot handle drag events yourself. Your tool should fire on its own only after MSG_DESCRIPTION_POSTSETPARAMETER has fired for your node, i.e., after the final value of a drag event for some slider has been set.

        Please have a look at our Support Procedures, we require users to post code for pretty much all questions, as it minimizes the guess work on our side. As for example me here writing about two cases.

        Cheers,
        Ferdinand

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 0
        • SteveHill3DS Offline
          SteveHill3D
          last edited by

          Thanks for the reply. Sorry for the imprecision - it is difficult to know what information is relevant when starting out, and I was trying to be concise. I am currently deriving from DescriptionToolData. I tried using MSG_DESCRIPTION_POSTSETPARAMETER but I get those during dragging also and the flags in the message are always the same even at the end i.e. USERINTERACTION | INDRAG as reported by:

          Bool MyTool::Message(BaseDocument *doc, BaseContainer &data, Int32 type, void *t_data)
          {
            if (type == MSG_DESCRIPTION_POSTSETPARAMETER)
            {
              auto ps = (DescriptionPostSetValue *)t_data;
              DiagnosticOutput("Post set @ @", ps->descid[0][0], ps->flags);
            }
            ...
            return SUPER::Message(doc, data, type, t_data);
          }
          

          Maybe I need to rethink and consider a ToolData basis.

          Steve.

          ferdinandF 1 Reply Last reply Reply Quote 0
          • ferdinandF Offline
            ferdinand @SteveHill3D
            last edited by

            Hey @SteveHill3D,

            it's okay, the start is always a bit chaotic. That snippet alone would have told me some things.

            Yes, sorry, MSG_DESCRIPTION_POSTSETPARAMETER is fired within the drag event (the parameter has still to be set). The final description event is MSG_DESCRIPTION_USERINTERACTION_END. But I still do not really understand what you are doing. What is triggering the updates? Just dragging one of the sliders will not update the tool in our edge cutter tool example (because it does not really implement the interactive mode that comes with description tools).

            So, the tool should either fire when you have keyboard or viewport inputs and implemented MouseInput or KeyboardInput. When you click Apply, it should call DoCommand. You can of course hook into Message to react to all sorts of things (and that is indeed how you implement the interactive mode), but you message implies that your tool fires on your own. Which it should not.

            Cheers,
            Ferdinand

            MAXON SDK Specialist
            developers.maxon.net

            1 Reply Last reply Reply Quote 0
            • SteveHill3DS Offline
              SteveHill3D
              last edited by

              Thank you. MSG_DESCRIPTION_USERINTERACTION_END is just what was needed.

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