Pull the field-name set for a category's mjs_struct out of the mjspec snapshot. Returns empty set if snapshot is missing — codegen then falls back to using the raw schema attr name.
(cat_rules: Dict[str, Any], mjspec: Dict[str, Any] | None)
| 2089 | if ue_type.startswith("TArray"): |
| 2090 | if dim == 1: |
| 2091 | setup_lines.append( |
| 2092 | f" double {buf_name}[1] = {{ (bOverride_{ue_prop} && " |
| 2093 | f"{ue_prop}.Num() > 0) ? (double){ue_prop}[0] : {sentinel} }};" |
| 2094 | ) |
| 2095 | else: |
| 2096 | inits = ", ".join( |
| 2097 | f"(bOverride_{ue_prop} && {ue_prop}.Num() > {i}) ? " |
| 2098 | f"(double){ue_prop}[{i}] : {sentinel}" |
| 2099 | for i in range(dim) |
| 2100 | ) |
| 2101 | setup_lines.append(f" double {buf_name}[{dim}] = {{ {inits} }};") |
| 2102 | else: |
| 2103 | # Scalar UE type wrapped in a 1-element buffer (e.g. position.kv:float -> double[1]). |
no outgoing calls
no test coverage detected