Add body.find_all() to Python bindings.
This enables to generate a list of all body children of a given type. Also, add recursive option to mjs_firstChild and mjs_nextChild. Fixes #2112. PiperOrigin-RevId: 681039348 Change-Id: Iebbb26fd5ec314150206edfdddd88633baa0bec6
This commit is contained in:
committed by
Copybara-Service
parent
8a825e6050
commit
89aea5e217
@@ -4205,7 +4205,7 @@ mjs_firstChild
|
||||
|
||||
.. mujoco-include:: mjs_firstChild
|
||||
|
||||
Return body's first child of given type.
|
||||
Return body's first child of given type. If recurse is nonzero, also search the body's subtree.
|
||||
|
||||
.. _mjs_nextChild:
|
||||
|
||||
@@ -4215,6 +4215,7 @@ mjs_nextChild
|
||||
.. mujoco-include:: mjs_nextChild
|
||||
|
||||
Return body's next child of the same type; return NULL if child is last.
|
||||
If recurse is nonzero, also search the body's subtree.
|
||||
|
||||
.. _mjs_firstElement:
|
||||
|
||||
|
||||
@@ -3598,8 +3598,8 @@ mjsDefault* mjs_getDefault(mjsElement* element);
|
||||
mjsDefault* mjs_findDefault(mjSpec* s, const char* classname);
|
||||
mjsDefault* mjs_getSpecDefault(mjSpec* s);
|
||||
int mjs_getId(mjsElement* element);
|
||||
mjsElement* mjs_firstChild(mjsBody* body, mjtObj type);
|
||||
mjsElement* mjs_nextChild(mjsBody* body, mjsElement* child);
|
||||
mjsElement* mjs_firstChild(mjsBody* body, mjtObj type, int recurse);
|
||||
mjsElement* mjs_nextChild(mjsBody* body, mjsElement* child, int recurse);
|
||||
mjsElement* mjs_firstElement(mjSpec* s, mjtObj type);
|
||||
mjsElement* mjs_nextElement(mjSpec* s, mjsElement* element);
|
||||
void mjs_setBuffer(mjByteVec* dest, const void* array, int size);
|
||||
|
||||
Reference in New Issue
Block a user