Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > Bug Reports
  New Posts New Posts
  FAQ FAQ  Forum Search

MCOMMAND_JOIN and XPresso tags

Author
Message
  Topic Search Topic Search
C4DS View Drop Down
Member
Member


Joined: 2015 Dec 01
Online Status: Offline
Posts: 235
Direct Link To This Post Topic: MCOMMAND_JOIN and XPresso tags
    Posted: 2017 Dec 27 at 10:47am

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?



Back to Top
Yannick Puech View Drop Down
Forum Moderator
Forum Moderator


Joined: 2011 Apr 13
Location: Spain
Online Status: Offline
Posts: 1143
Direct Link To This Post Posted: 2017 Dec 28 at 8:43am
Hi,

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.




MAXON
Developer Support
Back to Top
C4DS View Drop Down
Member
Member


Joined: 2015 Dec 01
Online Status: Offline
Posts: 235
Direct Link To This Post Posted: 2017 Dec 29 at 4:59am
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?
 
Back to Top
Yannick Puech View Drop Down
Forum Moderator
Forum Moderator


Joined: 2011 Apr 13
Location: Spain
Online Status: Offline
Posts: 1143
Direct Link To This Post Posted: 2018 Jan 02 at 8:38am
Yes the XPresso object nodes should be manually changed to point to the result object from MCOMMAND_JOIN.

Unfortunately AliasTrans can't be of any help here. The join command doesn't copy the data needed for AliasTrans to reconnect to copies.



MAXON
Developer Support
Back to Top

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.109 seconds.