Detecting scene changes
On 19/11/2013 at 01:12, xxxxxxxx wrote:
Cinema 4D Version: R13.061
Platform: Windows ;
Language(s) : C++ ;
I have a bunch of ObjectData plugins, and I am interested in finding a way to detect or be notified on scene changes, for validation purposes.
Right now, the only bit of control I have over the scene structure is at the moment of object creation, by creating them with a CommandData plugin, which inserts them at the correct locations. So far so good, but once the objects are created we're pretty much out of control. Objects can be freely moved inside the tree, or even removed. This becomes an issue when it results in inconsistent layouts in the scene, which do not produce proper results, or even no results at all, and a way to check the consistency when the structure changes seems to be the right way to go.
It seems that insertions and deletions are handled by the GeListNode class, but unfortunately the functions which handle this specific detail are not virtual ( or any other methods whatsoever ), therefore not overridable.
So, if any of you had this problem before, and found a solution to it, I would be very greatful if you would share this precious piece of information with everyone else on this forum
On 19/11/2013 at 04:38, xxxxxxxx wrote:
A SceneHook plugin (SceneHookData derivation) will get scene changes such as this through its Message() method.
On 20/11/2013 at 01:27, xxxxxxxx wrote:
Thanks, I will take a look!
I gave it a spin, and it does indeed detect scene changes, like inserting or moving objects. However, it seems that when deleting objects from the scene, no messages are sent, or maybe I'm missing something?