and then adding the shape to a BulletRigidBodyNode. When using a sample .egg file it works fine, however when I try to use a .bam file, the TriangleMesh does not match the model at all (I just get a large sphere enclosing my visual model).
In the C++ API reference of the GeomNode class i found several functions concerning the BamReader (i.e register_with_read_factory()), but the Python API reference of the GeomNode class does not mention .bam files at all.
Does the code snippet above not work with .bam files in general, did I do something wrong or is there another way of generating colllision shapes from .bam files?
There is nothing in particular that should be different about .bam files in this case (which is why the documentation doesn’t mention it; GeomNodes loaded from a .bam file are not different in some important way).
What I note, though, is that you are only passing in the first Geom of the first GeomNode that it can find. Perhaps that just so happens to be a different one than the one you want, for the .bam file in question, and there are multiple Geoms in the model? Try calling modelNP.ls() and modelNP.analyze() to see what’s inside.