Click 3d objects tagging problem

Hi,

My application involves clicking 3d object to trigger GUI. I already read the tutorial about clicking on 3d object and I know that I have to add tag to the object I want it to be pickable:
“object1.setTag(‘myObjectTag’, ‘1’)
object2.setTag(‘myObjectTag’, ‘2’)”

But this way of adding tag to objects only works for objects that are loading independently. I mean, object1 and obejct2 have to be loaded separately from different model files. But what I should do if want to load the whole scene which includes multiple objects and add different tags to them? For example, I have a model of a building, which have many objects of doors, windows, walls, and furnishings. I want to trigger different events when user click doors, windows or other objects in the building. But it turns out when I load the building model into Panda3d, I can only set tag for the whole model - the building, but not for the objects in the building. I considered to load objects separately into the scene, but in that way I have to assemble the objects by code. It’s ridiculously troublesome to load the hundreds of building components separately and set their locations by code to assemble the whole building.

So is there anyone know how to set tags for objects separately included in model? Your any advices will be appreciated! I really need to figure it out.

If the objects are separated, then it should remain separated during conversion. You can confirm this by calling yourbuilding.ls()

What’s your modeling program & converter ?

I’m using 3ds max 2010 for modeling, and converter is max2egg2010. My building model have many objects of building components, when I load the whole building model, I don’t know how to add tag to the components in it.

Maybe I should ask, how to get the name of a sub-part of a model which loaded from a single file?

Thanks.

panda3d.org/manual/index.php … cene_Graph