mirror of
https://github.com/bulletphysics/bullet3
synced 2025-01-05 15:21:06 +00:00
Fix a bug that createVisualShape(Array) does not have the correct color. Add urdfEditor.py to pybullet_utils. Remove all unnecessary changes of white spaces.
This commit is contained in:
parent
d91a58e050
commit
f4ca3f5963
@ -3953,7 +3953,6 @@ bool PhysicsServerCommandProcessor::processCreateVisualShapeCommand(const struct
|
||||
btAlignedObjectArray<BulletURDFTexture> textures;
|
||||
|
||||
UrdfVisual visualShape;
|
||||
|
||||
for (int userShapeIndex = 0; userShapeIndex< clientCmd.m_createUserShapeArgs.m_numUserShapes; userShapeIndex++)
|
||||
{
|
||||
|
||||
@ -4039,9 +4038,6 @@ bool PhysicsServerCommandProcessor::processCreateVisualShapeCommand(const struct
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bool hasRGBA = (clientCmd.m_createUserShapeArgs.m_shapes[userShapeIndex].m_visualFlags&GEOM_VISUAL_HAS_RGBA_COLOR) != 0;;
|
||||
bool hasSpecular = (clientCmd.m_createUserShapeArgs.m_shapes[userShapeIndex].m_visualFlags&GEOM_VISUAL_HAS_SPECULAR_COLOR) != 0;;
|
||||
visualShape.m_geometry.m_hasLocalMaterial = hasRGBA | hasSpecular;
|
||||
@ -4086,7 +4082,9 @@ bool PhysicsServerCommandProcessor::processCreateVisualShapeCommand(const struct
|
||||
|
||||
|
||||
u2b.convertURDFToVisualShapeInternal(&visualShape, pathPrefix, localInertiaFrame.inverse()*childTrans, vertices, indices, textures);
|
||||
|
||||
}
|
||||
|
||||
if (vertices.size() && indices.size())
|
||||
{
|
||||
if (1)
|
||||
|
@ -6112,11 +6112,13 @@ static PyObject* pybullet_createVisualShape(PyObject* self, PyObject* args, PyOb
|
||||
{
|
||||
pybullet_internalSetVectord(visualFramePositionObj,visualFramePosition);
|
||||
}
|
||||
|
||||
if (visualFrameOrientationObj)
|
||||
{
|
||||
pybullet_internalSetVector4d(visualFrameOrientationObj,visualFrameOrientation);
|
||||
}
|
||||
b3CreateVisualShapeSetChildTransform(commandHandle, shapeIndex, visualFramePosition,visualFrameOrientation);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -6167,6 +6169,10 @@ static PyObject* pybullet_createVisualShapeArray(PyObject* self, PyObject* args,
|
||||
PyErr_SetString(SpamError, "Not connected to physics server.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
{
|
||||
b3SharedMemoryCommandHandle commandHandle = b3CreateVisualShapeCommandInit(sm);
|
||||
int numShapeTypes = 0;
|
||||
@ -6334,6 +6340,9 @@ static PyObject* pybullet_createVisualShapeArray(PyObject* self, PyObject* args,
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (shapeTypeArraySeq)
|
||||
@ -6350,10 +6359,10 @@ static PyObject* pybullet_createVisualShapeArray(PyObject* self, PyObject* args,
|
||||
Py_DECREF(meshScaleArraySeq);
|
||||
if (planeNormalArraySeq)
|
||||
Py_DECREF(planeNormalArraySeq);
|
||||
if (flagsArraySeq)
|
||||
Py_DECREF(flagsArraySeq);
|
||||
if (rgbaColorArraySeq)
|
||||
Py_DECREF(rgbaColorArraySeq);
|
||||
if (flagsArraySeq)
|
||||
Py_DECREF(flagsArraySeq);
|
||||
if (positionArraySeq)
|
||||
Py_DECREF(positionArraySeq);
|
||||
if (orientationArraySeq)
|
||||
|
Loading…
Reference in New Issue
Block a user