[x3d-public] removeNamedNode removes DEF children?
Andreas Plesch
andreasplesch at gmail.com
Mon Jul 11 18:16:32 PDT 2022
Here is one last clarification. After all occurrences of a node are removed
from a scene, can it still be readded as a USE, named node ? It appears so.
In SAI terms, getNamedNode() does not rely on if a node is currently used
in a scene ?
That means a named node may never be released from memory.
But unnaming such an unlinked node with removeNamedNode should make it safe
to remove from memory ?
Thanks, Andreas
---on the phone---
On Mon, Jul 11, 2022, 2:08 PM Patrick Dähne <pdaehne at gmail.com> wrote:
>
>
> > Am 11.07.2022 um 19:27 schrieb Andreas Plesch <andreasplesch at gmail.com>:
> >
> > On Mon, Jul 11, 2022, 12:34 PM Patrick Dähne <pdaehne at gmail.com> wrote:
> > > Thanks, very helpful. After the DEF name is removed, do the USE nodes
> still rrefer to the now nameless node ?
> >
> > Yes. The scene graph does not care about DEF and USE, it is only needed
> to serialize the scene graph into a textual representation.
> >
> > Ok.
> >
> >
> >
> > > Also, is there then a way to remove a node from the scene graph ?
> >
> > Yes, send events to fields (usually Group.children or
> Group.removeChildren).
> >
> > Presumably, outer.removeChildren(inner) would then just remove the child
> (DEF) node. The USE node would still refer to the (original) DEF node ?
>
> Yes.
>
>
> > Is there a way to remove all instances of a named node at once ?
>
> No.
>
>
> Bye,
>
> Patrick
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20220711/266b0653/attachment.html>
More information about the x3d-public
mailing list