THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 04/04/2007 at 15:48, xxxxxxxx wrote:
Cinema 4D Version: R8.2-R10
Platform: Windows ; Mac ; Mac OSX ;
Language(s) : C++ ;
I think that this is the word that seems to be missing in most discussions of the SDK - most especially undos.
Here's my point in case. Currently, the only way that I can store working undos is by storing the root polygon object of a rigged figure - this includes the bones and tags - and consumes memory like a mother. This just isn't viable. The alternative is to just store the tags which are at the root of the changes - and here's why:
The plugin bone uses GetDDescription() to create a set of sliders which represent the values on the plugin tags attached to it. Since the tags don't have sliders and aren't even visible - but the value is stored in the basecontainer there, I'm finding it impossible to get MSG_DESCRIPTION_INITUNDO called on the tag - because the slider is on the bone and sets the value in the basecontainer. Even literally calling tag.SetDParameter() from bone.SetDParameter() doesn't trigger this message.
I know that calling AddUndo() calls Init(),CopyTo(), and possibly GetDDescription() (?). That's after behavior. What I want to know is how to control before behavior - how does one trigger a MSG_DESCRIPTION_INITUNDO for bc->SetReal(ID, value) or some action done from another 'controlling' object. This might allow me to store only the tag in undo and save GB of memory.
Currently, I call a method to set the values (and perform other actions on the slider changes). But this method is called for everything - setup, like SetDParameter() - on all slider changes, even animation keyframes. So calling the AddUndo() from there wouldn't be viable as you can imagine. It isn't until R9.0 that MSG_DESCRIPTION_USERINTERACTION_END is added, if that is useful at all.
Thank you very much,