<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Advice on implementing undo&#x2F;redo in a Tool]]></title><description><![CDATA[<p dir="auto">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.</p>
<p dir="auto">Does anyone have any advice on how best to manage this?</p>
<p dir="auto">(I reluctantly asked three AIs and got three answers -- hidden tag (Copilot), object base container (ChatGPT) and do it yourself (Claude))</p>
<p dir="auto">Thanks.</p>
]]></description><link>http://developers.maxon.net/forum/topic/16388/advice-on-implementing-undo-redo-in-a-tool</link><generator>RSS for Node</generator><lastBuildDate>Sun, 17 May 2026 14:26:37 GMT</lastBuildDate><atom:link href="http://developers.maxon.net/forum/topic/16388.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 24 Feb 2026 13:20:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Advice on implementing undo&#x2F;redo in a Tool on Wed, 04 Mar 2026 16:57:24 GMT]]></title><description><![CDATA[<p dir="auto">Hey <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/stevehill3d">@<bdi>SteveHill3D</bdi></a>,</p>
<p dir="auto">Storing a tool state in a tag is possible, but a bit unusual. But generally you are on the right track. Tags are also internally often used as hidden data containers. When you write a modelling tool, you probably already found out that points and polygons are are actually stored in hidden tags on objects.</p>
<p dir="auto">I am not sure though if using tags in tools is a good advice, as injecting all that data all the time into the scene graph is probably not the fastest. It depends a bit on what you are doing, but in general the solution is a bit unusual.</p>
<p dir="auto">Cheers,<br />
Ferdinand</p>
]]></description><link>http://developers.maxon.net/forum/post/77074</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/77074</guid><dc:creator><![CDATA[ferdinand]]></dc:creator><pubDate>Wed, 04 Mar 2026 16:57:24 GMT</pubDate></item><item><title><![CDATA[Reply to Advice on implementing undo&#x2F;redo in a Tool on Wed, 04 Mar 2026 16:41:30 GMT]]></title><description><![CDATA[<p dir="auto"><strong>I'm still a beginner at this lark</strong>, 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.</p>
]]></description><link>http://developers.maxon.net/forum/post/77073</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/77073</guid><dc:creator><![CDATA[SteveHill3D]]></dc:creator><pubDate>Wed, 04 Mar 2026 16:41:30 GMT</pubDate></item><item><title><![CDATA[Reply to Advice on implementing undo&#x2F;redo in a Tool on Tue, 24 Feb 2026 22:13:08 GMT]]></title><description><![CDATA[<p dir="auto">Thank you for the pointers.  I will digest the examples.</p>
]]></description><link>http://developers.maxon.net/forum/post/77060</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/77060</guid><dc:creator><![CDATA[SteveHill3D]]></dc:creator><pubDate>Tue, 24 Feb 2026 22:13:08 GMT</pubDate></item><item><title><![CDATA[Reply to Advice on implementing undo&#x2F;redo in a Tool on Tue, 24 Feb 2026 15:30:22 GMT]]></title><description><![CDATA[<p dir="auto">Hey <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/stevehill3d">@<bdi>SteveHill3D</bdi></a>,</p>
<p dir="auto">Welcome to the Maxon developers forum and its community, it is great to have you with us!</p>
<h4>Getting Started</h4>
<p dir="auto">Before creating your next postings, we would recommend making yourself accustomed with our forum and support procedures. You did not do anything wrong, we point all new users to these rules.</p>
<ul>
<li><a href="/forum/topic/15242/">Forum Overview</a>: Provides a broad overview of the fundamental structure and rules of this forum, such as the purpose of the different sub-forums or the fact that we will ban users who engage in hate speech or harassment.</li>
<li><a href="/forum/topic/15244/">Support Procedures</a>: Provides a more in detail overview of how we provide technical support for APIs here. This topic will tell you how to ask good questions and limits of our technical support.</li>
<li><a href="/forum/topic/15243/">Forum Features</a>: Provides an overview of the technical features of this forum, such as Markdown markup or file uploads.</li>
</ul>
<p dir="auto">It is <strong>strongly</strong> recommended to read the first two topics carefully, especially the section <a href="/forum/topic/15244/support-procedures/4">Support Procedures: How to Ask Questions</a>.</p>
<h4>About your First Question</h4>
<p dir="auto">You could look at our <a href="https://github.com/Maxon-Computer/Cinema-4D-Cpp-API-Examples/blob/master/plugins/example.main/source/tool/edgecuttool.cpp" target="_blank" rel="noopener noreferrer nofollow ugc">edgecuttool.cpp</a> C++ SDK example, it demonstrates both the usage of undos and <a href="https://developers.maxon.net/docs/cpp/2026_1_0/namespacecinema.html#a60cd8fc4a6adf34ee3ee4bfc53caf31d" target="_blank" rel="noopener noreferrer nofollow ugc">cinema::InteractiveModeling_Restart</a>, i.e., rolling updates. In some cases <code>InteractiveModeling_Restart</code> will not cut it you have to un-roll your undos yourself or even not use undos at all for rolling updates and instead work with a tool finalization logic.</p>
<p dir="auto">By chance I just wrote an example for the latter for the upcoming Python SDK. You will not be able to run it, as the customer release version is missing the Python API to deal with SDS weights, but you can have a look at its code. The idea is simple: Establish a ground truth and operate based on that. But for modelling tools and especially tools that add or remove geometry using undos and <code>InteractiveModeling_Restart</code> should be preferred when possible, as it will be usually faster, as the cinema core can pull some tricks you cannot as a third party.</p>
<p dir="auto">Cheers,<br />
Ferdinand</p>
<p dir="auto">Please understand that this example is a preview and might be subject to change.<br />
<a href="/forum/assets/uploads/files/1771945980087-py-cmd_tool_finalization_2026_2.zip">py-cmd_tool_finalization_2026_2.zip</a></p>
]]></description><link>http://developers.maxon.net/forum/post/77058</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/77058</guid><dc:creator><![CDATA[ferdinand]]></dc:creator><pubDate>Tue, 24 Feb 2026 15:30:22 GMT</pubDate></item></channel></rss>