Add mjs_findElement() to find any element in a spec by name.

Also, remove mjs_findMesh() and mjs_findKeyframe().

PiperOrigin-RevId: 670978980
Change-Id: Id88b800eb8a4c5efc40866f72a4442bf1d1437d0
This commit is contained in:
Alessio Quaglino
2024-09-04 08:23:18 -07:00
committed by Copybara-Service
parent 0e8c0b80eb
commit d3dfa6f970
13 changed files with 149 additions and 156 deletions
+27 -45
View File
@@ -9678,7 +9678,33 @@ FUNCTIONS: Mapping[str, FunctionDecl] = dict([
),
),
),
doc='Find body in model by name.',
doc='Find body in spec by name.',
)),
('mjs_findElement',
FunctionDecl(
name='mjs_findElement',
return_type=PointerType(
inner_type=ValueType(name='mjsElement'),
),
parameters=(
FunctionParameterDecl(
name='s',
type=PointerType(
inner_type=ValueType(name='mjSpec'),
),
),
FunctionParameterDecl(
name='type',
type=ValueType(name='mjtObj'),
),
FunctionParameterDecl(
name='name',
type=PointerType(
inner_type=ValueType(name='char', is_const=True),
),
),
),
doc='Find element in spec by name.',
)),
('mjs_findChild',
FunctionDecl(
@@ -9702,28 +9728,6 @@ FUNCTIONS: Mapping[str, FunctionDecl] = dict([
),
doc='Find child body by name.',
)),
('mjs_findMesh',
FunctionDecl(
name='mjs_findMesh',
return_type=PointerType(
inner_type=ValueType(name='mjsMesh'),
),
parameters=(
FunctionParameterDecl(
name='s',
type=PointerType(
inner_type=ValueType(name='mjSpec'),
),
),
FunctionParameterDecl(
name='name',
type=PointerType(
inner_type=ValueType(name='char', is_const=True),
),
),
),
doc='Find mesh by name.',
)),
('mjs_findFrame',
FunctionDecl(
name='mjs_findFrame',
@@ -9746,28 +9750,6 @@ FUNCTIONS: Mapping[str, FunctionDecl] = dict([
),
doc='Find frame by name.',
)),
('mjs_findKeyframe',
FunctionDecl(
name='mjs_findKeyframe',
return_type=PointerType(
inner_type=ValueType(name='mjsKey'),
),
parameters=(
FunctionParameterDecl(
name='s',
type=PointerType(
inner_type=ValueType(name='mjSpec'),
),
),
FunctionParameterDecl(
name='name',
type=PointerType(
inner_type=ValueType(name='char', is_const=True),
),
),
),
doc='Find keyframe by name.',
)),
('mjs_getDefault',
FunctionDecl(
name='mjs_getDefault',