Generate wrappers for anonymous structs within mjVisual.

PiperOrigin-RevId: 828548681
Change-Id: I07f8b407157b91ac24b38604b20826541e20e23e
This commit is contained in:
Google DeepMind
2025-11-05 11:09:51 -08:00
committed by Copybara-Service
parent c3858f267a
commit 8104235f8e
4 changed files with 478 additions and 570 deletions
+8 -4
View File
@@ -562,13 +562,17 @@ def build_struct_header(
is_mjs=True,
)
is_anonymous_struct = struct_name in constants.ANONYMOUS_STRUCTS.keys()
is_hardcoded_wrapper_struct = (
common.uppercase_first_letter(struct_name)
in constants.HARDCODED_WRAPPER_STRUCTS
)
if (
(
common.uppercase_first_letter(struct_name)
not in constants.HARDCODED_WRAPPER_STRUCTS
)
not is_hardcoded_wrapper_struct
and struct_info
and not _has_nested_wrapper_members(struct_info)
or is_anonymous_struct
):
return _build_struct_header_internal(
struct_name, wrapped_fields, [], is_mjs=False