MCOMMAND_JOIN and XPresso tags

On 27/12/2017 at 10:47, xxxxxxxx wrote:

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

Don't know if this is by design or a bug in the SDK?

I have two polygon objects, let's say a default cube and plane primitives made editable.
In the Object Manager I take the cube and move it as child of the plane.
For the plane I create an XPresso tag and drag the plane object into the XPresso editor.
Then I select both objects in the Object Manager and perform a "connect+delete" command.
When I double click the XPresso tag it opens and the object node shows its title in yellow, named "Object". It does not have a link to the joined object.

When I do this programmatically, the same result.

To be honest, one might wonder what the object node in the XPresso tag should point to after joining. One would expect the joined object.
I know that when cloning is performed with an XPresso tag an AliasTrans needs to be used in order to get the links correctly in the cloned XPresso tag. Is this something that was internally overlooked in the SDK for the join command? Or was this by design, since too many side-effects could result from it?

There is this specific option MDATA_JOIN_MERGE_SELTAGS provided to merge the selection tags of parent and child objects during the join.
An XPresso tag on a child object simply vanishes after the join command, while (some) other tags are copied/merged.
An XPresso tag on the parent object remains, but the object link gets broken.

If I to the same with a look-at-camera tag:
- tag on child gets deleted by the join command (what else would one expect)
- tag on parent remains after join, and is still actively working (obvious)
Why not the same behaviour for an XPresso tag?

On 28/12/2017 at 08:43, xxxxxxxx wrote:


XPresso Object operator can only reference existing objects.

"Connect Objects + Delete" removes both the parent and its children so the Object operator looses its reference to the original object.
"Connect Objects" inserts the resulting object without deleting the sources so the Object operator keeps its reference.

Look at Camera tag is different because it doesn't link to another object in the document.

Note Connect command keeps only the geometry data from children's tags.

On 29/12/2017 at 04:59, xxxxxxxx wrote:

Thanks for the explanation.
I assumed that when one does a "Connect Objects" that the xpresso on the joined object would refer to the new object. But actually it does refer to the original object.
Obviously, when you then delete the original object the link is lost.

So, if I would want to perform a "Connect Objects" programmatically (via MCOMMAND_JOIN) and want to update the object nodes in the XPresso tags of the joined object to refer to the joined object, I will have to deal with parsing the XPresso and updating the links myself, correct?

There is no way of automating this in any way, as is the case with AliasTrans when cloning an object?