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
@@ -1550,11 +1550,12 @@ MJAPI mjsDefault* mjs_getSpecDefault(mjSpec* s);
|
||||
// Get element id.
|
||||
MJAPI int mjs_getId(mjsElement* element);
|
||||
|
||||
// Return body's first child of given type.
|
||||
MJAPI mjsElement* mjs_firstChild(mjsBody* body, mjtObj type);
|
||||
// Return body's first child of given type. If recurse is nonzero, also search the body's subtree.
|
||||
MJAPI mjsElement* mjs_firstChild(mjsBody* body, mjtObj type, int recurse);
|
||||
|
||||
// Return body's next child of the same type; return NULL if child is last.
|
||||
MJAPI mjsElement* mjs_nextChild(mjsBody* body, mjsElement* child);
|
||||
// If recurse is nonzero, also search the body's subtree.
|
||||
MJAPI mjsElement* mjs_nextChild(mjsBody* body, mjsElement* child, int recurse);
|
||||
|
||||
// Return spec's first element of selected type.
|
||||
MJAPI mjsElement* mjs_firstElement(mjSpec* s, mjtObj type);
|
||||
|
||||
Reference in New Issue
Block a user