Erwin Coumans wrote:
You can use btBulletWorldImporter.
See Bullet/Demos/SerializeDemo, it can load your .bullet file.
Thanks,
Erwin
I got this export to work from Blender 2.62, but I've been trying to find a way to identify the object by it's Blender name.
According to the Bullet binary serialization doc:
http://bulletphysics.org/mediawiki-1.5.8/index.php/Bullet_binary_serialization#Setting_and_Getting_the_name_for_bodies.2C_shapes_and_constraintsQuote:
Setting and Getting the name for bodies, shapes and constraints
The Dynamica Maya plugin and Blender create unique names for all objects. This is useful to recognize objects, shapes and constraints, for example to bind them with graphics objects.
When saving the file, the btDefaultSerializer is created, and all names are registered using the registerNameForPointer method.
When loading the .bullet file, the m_name field is part of the structures: btCollisionObjectData, btRigidBodyData, btCollisionShapeData and btTypedConstraintData.
Also the 'btBulletWorldImporter::createRigidBody' methods passes this nams as one of the arguments, when available.
However, the name is always exactly the same as the collision shape name, rather than a unique Blender name. This code:
Code:
int i;
for (i=0; i < m_dynamicsWorld->getNumCollisionObjects(); i++)
{
btCollisionObject* obj = m_dynamicsWorld->getCollisionObjectArray()[i];
btRigidBody* body = btRigidBody::upcast(obj);
printf(" object name = %s\n", body->getRootCollisionShape()->getName());
...
produces:
Quote:
object name = Box
for every box collision shape.