Notification of change of parent?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/12/2006 at 16:25, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 8.2-10.0
Platform: Windows ; Mac ; Mac OSX ;
Language(s) : C++ ;---------
I'm looking to know if there is any way to know if an object has been moved in the Object Manager (etc.), mainly if the object has been moved from the root to be parented to some other object.Thank you very much,
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 19/12/2006 at 10:25, xxxxxxxx wrote:
No not really, the only possibility I found was to store a BaseLink of your parent and check that. Also to detect a change of the position I only could realize by storing the position and checking it. That works fine for us, because we only have or own objects, and we could provide these events like parent changed, position changed by a base class.
I don't know about later c4d versions, because we're still stuck on 8.2 for several reasons, but there I did not find any other possibility. -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 19/12/2006 at 10:27, xxxxxxxx wrote:
Now, as I had noticed, there is one possible approach (activeobject.cpp example). The problem is that CoreMessage() is only available through Dialogs and MessageData plugins whereas my needs involve plugin objects/tags (no CoreMessage). I've already checked to see if any message is sent to these on a parent change - nope.
The only thing needed here is a way to check if parenting has changed on some general indicator (i.e.: EVMSG_CHANGE). An impractical solution could be to set a timer and check every 5 nanoseconds, but that seems overboard for a user-induced event as compared to some continuous event stream.
I am looking into MessageData as it might be the only recourse here.
Thanks,
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 19/12/2006 at 10:33, xxxxxxxx wrote:
You're on the right track
We have a MessageData installed with our objects, which reacts on EVMSG_CHANGE, and sends in that case an own message to all our objects. If they receive this message, we have a function CheckEvents, which does checking for parent change, position change, and many others... -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 19/12/2006 at 12:08, xxxxxxxx wrote:
This is getting tricky. Since EVMSG_CHANGE is sent often, the idea of checking parent change may require storing the current parent on the plugin tag attached to the affected object to verify that indeed the parent changed. Otherwise, things get strange.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 19/12/2006 at 12:33, xxxxxxxx wrote:
Trickier still. EVMSG_CHANGE seems to come in *before* the actual parenting occurs. (?) When I check obj->GetUp(), there is no parent (obj->GetUp() == NULL) even though I'm sitting here looking at the object sitting underneath another object to which it has just been parented.
ETA: Well, slap me upside the head! I created a recursive method to recurse the object manager hierarchy - except that I forgot to add the 'recursive' part. Now she works like a charm. Back to the cave for me.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 22/12/2006 at 05:32, xxxxxxxx wrote:
That is strange, EVMSG_CHANGE works fine for us.
I had these problems with MSG_CHANGE. The description sounds good, "must be sent if any object data was changed", well, so if I receive it by an object, it should be a hint that anything has changed. No it isn't. It informs you, that SOON SOMETHING will change.....don't understand the sense of that message...
With our EVMSG_CHANGE received by a MessageData and sending a message to all objects then we trigger alot of things, parent changing, position changing, a special handling for the protection tag, size change, number of child objects changed, number and type of attached tags changed, etc. If you keep in mind to implement efficient checking of these events, then the runtime is not affected that much, not even with thousands of objects which we typically have. -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 10/01/2007 at 15:57, xxxxxxxx wrote:
Howdy,
Why not use the link method and check it during the Execute() function?
Adios,
Cactus Dan -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 10/01/2007 at 16:20, xxxxxxxx wrote:
Hello Dan,
Well, I was already using the link method for conforming but wanted a more intuitive method (drag-n-drop). The problem is that the only way to get notifications of this type of thing is through a CoreMessage and that is really only available in a Dialog or Message plugin (I chose the latter).
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 15/01/2007 at 13:45, xxxxxxxx wrote:
Howdy,
Oh, ok.
Adios,
Cactus Dan