PyBullet change API (since it was broken): pybullet_changeVisualShape with textureUniqueId ==-1 will clear the texture

b3InitUpdateVisualShape doesn't take textureUniqueId by default. new API b3UpdateVisualShapeTexture to change texture (-1 will clear texture)
PyBullet/BulletRobotics: allow to reset the textureUniqueId to -1, to clear a texture
PyBullet/BulletRobotics: save all texture handles
This commit is contained in:
erwincoumans
2018-10-20 15:56:56 -07:00
parent 9a9386b6a7
commit ed49edc1af
8 changed files with 90 additions and 42 deletions

View File

@@ -5584,7 +5584,7 @@ static PyObject* pybullet_changeVisualShape(PyObject* self, PyObject* args, PyOb
int objectUniqueId = -1;
int jointIndex = -1;
int shapeIndex = -1;
int textureUniqueId = -1;
int textureUniqueId = -2;
b3SharedMemoryCommandHandle commandHandle;
b3SharedMemoryStatusHandle statusHandle;
int statusType;
@@ -5606,7 +5606,12 @@ static PyObject* pybullet_changeVisualShape(PyObject* self, PyObject* args, PyOb
}
{
commandHandle = b3InitUpdateVisualShape(sm, objectUniqueId, jointIndex, shapeIndex, textureUniqueId);
commandHandle = b3InitUpdateVisualShape(sm, objectUniqueId, jointIndex, shapeIndex);
if (textureUniqueId>=-1)
{
b3UpdateVisualShapeTexture(commandHandle, textureUniqueId);
}
if (specularColorObj)
{