Hide a parent without its child

hello,
im working on reconstructing actor,
i got a node were all the others are attached, and i want juste hide it, without its childs.
If there is a way, thanks.

Do you have a reference to the child? If so, this should work. hide()'ing the nodepath hides it and all its children. show()'ing the child won’t effect the parent nodepath’s visibility but will effect all of the child nodepath’s descendants.

nodePath.hide()
nodePath.childReference.show()

showThrough
void NodePath::show_through(void);

Description: Makes the referenced node visible just to the cameras whose camera_mask shares the indicated bits.
Unlike show(), this will reveal the node even if a parent node has been hidden, thus “showing through” a parent’s hide().
Unlike show(), this will reveal the node even if a parent node has been hidden via the one-parameter hide() method, thus “showing through” a parent’s hide(). (However, it will not show through a parent’s hide() call if the no-parameter form of hide() was used.)

1 Like

ok thanks, then i must do :
parent_node.hide()
child_node1.show()
child_node2.show()
etc…
?

If child_node2 is a child of parent then yes, if it is a child of child_node1 then no.

This would be a nice place for a dummy node between parent and multiple childs then, wouldn’t it? :slight_smile:

Regards, Bigfoot29

no there are a unique parent for a multiple child node.
in fact i want to hide the red cristal under the foot of my character in my mmorpg developpement game .

it don’t work when i show the child.
In fact i don’t know if it’s realy his child, there just reparentTo the first node
and then when i hide the first node it’s hide all the other.
i can’t attach the other to the cristal, i can just reparent there to it.
is there a way for hiding just the cristal like that ?

No idea ?

From ynjh_jo’s post above:

parent_node.hide()
child_node.showThrough()

David

I totally forgot this post !
Thanks a lot it works :wink: