Deattach Meshes with Tag

Well, what you have there only searches for nodes with a tag named “1”, and clears those–other nodes will be missed.

Hmm… I see three options here, offhand:

First, you could establish an additional tag that all such objects have, and then search for that instead.

Second, you could keep a record of all tags that have been used, and then search for all of them, rather than just for the tag “1”.

And third, you could rework you tagging system such that all objects have the same tag-key, with the current tag-key becoming part of the data stored in the tag. (Although in this case “Python-tags”–which can store non-string data–might be more useful.)

(Also, it seems that I was mistaken about using wildcard characters in searching for tag-keys: it seems that they work for node-names and for tag-values, but not for tag-keys (or node-types). My apologies for that error on my part!)

You should be able to tag it just as you can tag any other node, yes.

Note, by the way, that you likely don’t need to call both “detachNode” and “removeNode”, I believe. Specifically, my understanding is that “removeNode” will do pretty much the same as “detachNode”, but then also cause the NodePath to no longer reference the internal node.

See this post for more.

1 Like