I wrote this small script into my code in order to try to understand how to read about nodes in the scene. While browsing through the API, I couldn’t figure out how to get the type of node each is, more specifically whether it’s a model or actor. I assume it’s through the find() command, but couldn’t figure out the correct query.
Also, how do I find out the egg files the actors are stored in, and the animation to go with it? It seems it isn’t displayed like the model’s names.
(Testing with panda3D’s models)
numChildren = render.getNumChildren()
for a in range(0,numChildren):
child=render.getChild(a)
print child.getName()
print " ",child.getPos()
print " ",child.getHpr()
print " ",child.getScale()
print " ",child.getTransparency()
Output:
camera
Point3(0, -10, 2)
VBase3(0, 0, 0)
VBase3(1, 1, 1)
0
environment.egg
Point3(-8, 42, 0)
VBase3(0, 0, 0)
VBase3(0.25, 0.25, 0.25)
0
panda_walk_character
Point3(-4, 0, 0)
VBase3(0, 0, 0)
VBase3(0.005, 0.005, 0.005)
1
panda_walk_character
Point3(0, 0, 0)
VBase3(0, 0, 0)
VBase3(0.005, 0.005, 0.005)
1
panda_walk_character
Point3(4, 0, 0)
VBase3(0, 0, 0)
VBase3(0.005, 0.005, 0.005)
1