| 231 | s32 parse_nodes(Mesh &m, const char *sjson, CompileOptions &opts); |
| 232 | |
| 233 | s32 parse_node(Node &n, const char *sjson, Mesh *mesh, CompileOptions &opts) |
| 234 | { |
| 235 | TempAllocator4096 ta; |
| 236 | JsonObject obj(ta); |
| 237 | RETURN_IF_ERROR(sjson::parse(obj, sjson)); |
| 238 | |
| 239 | n._local_pose = RETURN_IF_ERROR(sjson::parse_matrix4x4(obj["matrix_local"])); |
| 240 | |
| 241 | if (json_object::has(obj, "children")) { |
| 242 | s32 err = mesh::parse_nodes(*mesh, obj["children"], opts); |
| 243 | ENSURE_OR_RETURN(MESH_RESOURCE, err == 0, opts); |
| 244 | } |
| 245 | |
| 246 | if (json_object::has(obj, "geometry")) { |
| 247 | RETURN_IF_ERROR(sjson::parse_string(n._geometry, obj["geometry"])); |
| 248 | } |
| 249 | |
| 250 | return 0; |
| 251 | } |
| 252 | |
| 253 | s32 parse_indices(Geometry &g, const char *json, CompileOptions &opts) |
| 254 | { |
no test coverage detected