How to get actor names when importing .RepX files?

Hi.
I’m trying to update my code to use the latest version of the PhysX SDK (version 3.2).

I’ve managed to load an actor from a .RepX file (exported from Max), but it doesn’t seem to import the actor’s name. When I run the following code, it all works and it prints out the name of the plane, but the name of the imported object is blank.

// Create Plane ---------------------------------------------------	
PxTransform pose = PxTransform(PxVec3(0.0f, 0, 0.0f),PxQuat(PxHalfPi, PxVec3(0.0f, 0.0f, 1.0f)));

PxRigidStatic* plane = mPhysics->createRigidStatic(pose);
PxShape* shape = plane->createShape(PxPlaneGeometry(), *mMaterial);
plane->setName("PLANE");
mScene->addActor(*plane);

// Load from RepX file
PxDefaultFileInputData data("test.repx");

PxCollection* bufferCollection	= mPhysics->createCollection();
PxCollection* sceneCollection	= mPhysics->createCollection();
PxStringTable* stringTable	= NULL;

RepXErrorCode::Enum errorCode = deserializeFromRepX(data, *mPhysics, *mCooking, stringTable, NULL, *bufferCollection, *sceneCollection);
	
mPhysics->addCollection(*bufferCollection, *mScene); 
mPhysics->addCollection(*sceneCollection, *mScene);

bufferCollection->release();
sceneCollection->release();

unsigned int numActors = mScene->getNbActors(PxActorTypeSelectionFlag::eRIGID_STATIC | PxActorTypeSelectionFlag::eRIGID_DYNAMIC);
PxActor** actors = new PxActor*[numActors];
mScene->getActors(PxActorTypeSelectionFlag::eRIGID_STATIC | PxActorTypeSelectionFlag::eRIGID_DYNAMIC, actors, numActors);

for (unsigned int i(0); i < numActors; i++)
{
    PxActor* actor = actors[i];
    const char* actorName = actor->getName();

    OutputDebugStringA("Actor Name: ");
    OutputDebugStringA(actorName);
    OutputDebugStringA("
");
}

Does anyone know how to get it to set the actor’s name when it imports the file? I’m sort of guessing it has something to do with the PxStringTable, but I’m not sure how to create or use it…

mStringTable = &PxStringTableExt::createStringTable( getFoundation().getAllocator() );

and release it only when you clean up your app.

Ok so that creates it, but how do you actually use PxStringTable? I have looked everywhere and cannot for the life of me figure out how to get the object names out of the PxStringTable.

I would really appreciate any help getting the object names out of the String Table.

Thanks,
David

mStringTable = &PxStringTableExt::createStringTable( getFoundation().getAllocator() );

PxDefaultFileInputData data(getFilename("file.repx"));

RepXCollection* collection = createCollection(data, getFoundation().getAllocator());
addObjectsToScene(*collection, physics, getFramework().getCooking(), scene, mStringTable);
collection->destroy();

PxActor* actors[512];
scene.getActors(PxActorTypeSelectionFlag::eRIGID_DYNAMIC, &actors[0],512);
PxU32 nbActors = scene.getNbActors(PxActorTypeSelectionFlag::eRIGID_DYNAMIC);

for (PxU32 i =0; i < nbActors; i++)
{
	actors[i]->getName();
	
}