Skip to content
  • Recent
  • Tags
  • Popular
  • SAMSON Connect
  • Get SAMSON
Collapse
SAMSON Forum
  1. Home
  2. Develop
  3. Modeling
  4. Sharing a child between two nodes

Sharing a child between two nodes

Scheduled Pinned Locked Moved Modeling
3 Posts 2 Posters 3.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E
    E
    Elisa
    wrote on last edited by
    #1

    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
             --child
    

    The 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 3
    

    Thank you and best regards,

    Elisa

    1 Reply Last reply
    0
    • StephaneS
      StephaneS
      Stephane
      wrote on last edited by
      #2

      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() const and 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

      1 Reply Last reply
      1
      • E
        E
        Elisa
        wrote on last edited by
        #3

        Thank you!
        I will try it with this.

        Yes, I meant SBStructuralGroup :)

        1 Reply Last reply
        0

        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
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Recent
        • Tags
        • Popular
        • SAMSON Connect
        • Get SAMSON