Cheers all,
Currently working on a project that is going to involve Panda3d and Pure Data. There is specific information embedded in our blender model egg via ObjectType and Tags that we are trying to get at in order to then parse that information thru to Pure Data to automatically generate subpatches. At the moment I am a bit stuck.
The following is what I’ve done so far.
In Blender:
- added an ObjectType tag to define whether the model is a space or an aperture
- added additional tags to the model that are specific to parameters that need to be transmitted over to Pure Data
- exported the egg and viewed to ensure the info is there
In Panda:
- added to the config.prc file both space and apertures as follows:
egg-object-type-aperture aperture { 1 }
egg-object-type-space space { 1 }
What I need to be able to get it to do:
- get a list of ObjectTypes, which objects are apertures and which are spaces
- get a list of the tags that are associated with those specific tags so that I can parse out the object with its parameters out to Pure Data via OSC
I am a rookie programmer and with Panda/python so I am unsure it this is the right approach to take. At the moment it just queries for the ‘atten’ tag. I tried the listTags(ostream) but realized that the info goes to the console so it’s commented out.
Is there a command where I can get it or query to list out the ObjectTypes?
How can I get at the tag info without having to query it individually?
Thanks for any pointers / help in advance. Again, I am new at this so pardon for any confusion or ill use of terms, etc.
I get it to list out (partial list) of which I need to send via OSC what is in brackets:
S5 does not have atten
ModelNode S4 [absorb basicSpace dim material] T:m(pos -3.8856 0.001349 0.960276)
A1 has atten
ModelNode A0 [atten direction filter] T:m(pos 14.755 0.329209 1.01629)
Here is the code so far:
import direct.directbase.DirectStart
def getInfo (nodepath,depth):
for i in range(0,depth):
print " ",
n = nodepath.getNode(0); print n
node_name = n.getName()
#p = n.listTags(ostream)
if n.hasTag("atten"):
print node_name + " has atten"
else:
print node_name + " does not have atten"
#print n.getTag("atten")
for np2 in nodepath.getChildren():
getInfo(np2,depth+1)
#model=“room_w_apt_test”
model="…/models/rooms7.egg"
environ = loader.loadModel(model)
environ.reparentTo(render)
#sets % transparency & true for the environ model
environ.setTransparency(True)
environ.setAlphaScale(0.5)
base.camera.setPos (1,-20,15)
base.camera.lookAt(0,0,0)
getInfo(render,0)
run()