Thank you. MSG_DESCRIPTION_USERINTERACTION_END is just what was needed.
Posts
-
RE: Batching Slider messages
-
RE: Advice on implementing undo/redo in a Tool
I'm still a beginner at this lark, but in case those who come after face a similar situation, I found that using a Tag on the target PolygonObject to store my tool states was the most successful approach for me. Changes to the tag can be put into the Undo state and in the Message handler of the tool I can catch undo and redo and adjust my attributes according to the current tag values. I did try maintaining my own undo list which worked kind-of, but you end up getting tangled up with the real undos. It's better to work with the system that's already there for the job. BaseLink is also very useful for keeping track of resources that could be deleted when you're not looking.
-
RE: Batching Slider messages
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.
-
Batching Slider messages
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.
-
RE: Advice on implementing undo/redo in a Tool
Thank you for the pointers. I will digest the examples.
-
Advice on implementing undo/redo in a Tool
C4D SDK newbie here. I am implementing a geometry creation Tool which works by dragging an initial shape and then allows multiple edits through handle or other drags in the viewport or via attribute changes in the AM. I would like these changes to be undoable while the tool is active i.e. until the tool is finalized via ESC or something happens like the active object changes.
Does anyone have any advice on how best to manage this?
(I reluctantly asked three AIs and got three answers -- hidden tag (Copilot), object base container (ChatGPT) and do it yourself (Claude))
Thanks.