PyBullet createMultiBody(Batch), return all body unique ids
PyBullet: fix crash: always check for existance m_multibodyWorld in ::render method
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -9024,8 +9024,21 @@ static PyObject* pybullet_createMultiBody(PyObject* self, PyObject* args, PyObje
|
|||||||
if (statusType == CMD_CREATE_MULTI_BODY_COMPLETED)
|
if (statusType == CMD_CREATE_MULTI_BODY_COMPLETED)
|
||||||
{
|
{
|
||||||
int uid = b3GetStatusBodyIndex(statusHandle);
|
int uid = b3GetStatusBodyIndex(statusHandle);
|
||||||
PyObject* ob = PyLong_FromLong(uid);
|
if (numBatchPositions > 0)
|
||||||
return ob;
|
{
|
||||||
|
PyObject* pyResultList = PyTuple_New(numBatchPositions );
|
||||||
|
for (i = 0; i < numBatchPositions; i++)
|
||||||
|
{
|
||||||
|
PyTuple_SetItem(pyResultList, i, PyLong_FromLong(uid - numBatchPositions + i + 1));
|
||||||
|
}
|
||||||
|
return pyResultList;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PyObject* ob = PyLong_FromLong(uid);
|
||||||
|
return ob;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user