Sharing a child between two nodes
-
Hi,
Is it possible to make two SBStructuralNodeGroup share childs? I would like to have access in the document view to the childs at two points, like:
-- Model -- parent --child --child2 --child3 -- ... -- parent 2 --childThe child can be owned by only one of them, but I would like that parent 2 also has a reference to it and it is shown in the document view. Is it possible? Unfortunately SBNodeGroup is not a solution for me since I want the hierarchy to access next and previous nodes, and I would like the SBNodeGroups to be contained also in a hierarchy. Like:
My Group (with next/previous getters) -- sub group 1 -- "shared" child 1 -- sub group 2 -- sub group 3Thank you and best regards,
Elisa
-
Hi Elisa, it's indeed not possible since a child can have only one parent. One possible workaround is to have the second potential parent to store a reference to the node, and expose the node as an attribute. You'll then see the referenced node in the inspector.
For example, let's say this referenced node is called "Target", you write an accessor
SBNode* MyNode::getTarget() constand you expose this attribute in the descriptor (where you expose functions, see https://documentation.samson-connect.net/developers/latest/page_introspection.html) with:SB_ATTRIBUTE_READ_ONLY(SBNode*, MyNode, Target, "Target", "References");By the way, maybe you mean SBStructuralGroup (to have groups and sub-groups in a structural model)? A SBNodeGroup is essentially a stored, named selection, and is not hierarchical.
Best,
Stephane
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login