Hi, is there any way to list all tags of a model made in blender?
for instance:
map.egg has:
Cube
tag: 'mytag'
Plane
tag: 'myplane'
Cube
tag: 'my zone'
Sphere
I need to find all the sub nodes of map.egg that have tags, however I also need to ignore the sub nodes without tags?
This is how I am currently doing it:
from direct.directbase import DirectStart
def getInfo(node):
for subNode in node.getChildren():
print subNode
model = loader.loadModel('m1.egg')
getInfo(model)
now this prints ‘m1.egg/-PandaNode’
I know for a fact that the subnodes are in it, because this works:
from direct.directbase import DirectStart
def getInfo(node):
for subNode in node.getChildren():
for realSubNode in subNode.getChildren():
print realSubNode
model = loader.loadModel('m1.egg')
getInfo(model)
prints the following:
m1.egg/-PandaNode/Cube
m1.egg/-PandaNode/start
m1.egg/-PandaNode/collide
m1.egg/-PandaNode/zone3
m1.egg/-PandaNode/zone2
m1.egg/-PandaNode/zone1
My question is, why is the -PandaNode even there? instead of returning the direct children of m1.egg?
What’s it use? and is there a better way to do this?