Set the parent of an object in the Object Manager

On 13/05/2017 at 20:27, xxxxxxxx wrote:

User Information:
Cinema 4D Version:    
Platform:    Mac  ;  
Language(s) :     C++  ;


It's been a while since I have tinkered with the C4D SDK.  I have a TagData plugin and I would like to move the object associated with this tag as a child of another tag that I added to the document.  Could someone please refresh my memory as to how this is accomplished.  I have searched a lot of the forums here and haven't found an answer.



On 15/05/2017 at 09:08, xxxxxxxx wrote:

Hi Shawn,

welcome to the Plugin Café forums 🙂

I'm afraid you will have to take a different approach. You are not allowed to modify the scene graph from within a tag's Execute() function.

I'd suggest to implement a button for this action, so when the button gets pressed, you will end up in the Message() function (MSG_DESCRIPTION_COMMAND) of your TagData plugin and in there you can easily change the hierarchy as needed. Just see GetNext(), GetDown(), GetPred(), GetUp() and the Insert..() functions of GeListNode and remember that no entity must/can be part multiple list at any one time, so you will also have to use Remove() before inserting somewhere else.