MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / parseMesh

Function parseMesh

Source/ThirdParty/OpenFBX/ofbx.cpp:2356–2377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2354}
2355
2356struct OptionalError<Object*> parseMesh(const Scene& scene, const Element& element, std::vector<ParseDataJob> &jobs, Allocator& allocator) {
2357 MeshImpl* mesh = allocator.allocate<MeshImpl>(scene, element);
2358
2359 if (!element.first_property) return Error("Invalid mesh");
2360
2361 const Element* vertices_element = findChild(element, "Vertices");
2362 if (!vertices_element || !vertices_element->first_property) return mesh;
2363
2364 const Element* polys_element = findChild(element, "PolygonVertexIndex");
2365 if (!polys_element || !polys_element->first_property) return Error("Indices missing");
2366
2367 if (!pushJob(jobs, *vertices_element->first_property, mesh->geometry_data.positions.values)) return Error("Invalid vertices");
2368 if (!pushJob(jobs, *polys_element->first_property, mesh->geometry_data.positions.indices)) return Error("Invalid vertices");
2369
2370 if (!parseGeometryMaterials(mesh->geometry_data, element, jobs)) return Error("Invalid materials");
2371 if (!parseGeometryUVs(mesh->geometry_data, element, jobs)) return Error("Invalid vertex attributes");
2372 if (!parseGeometryTangents(mesh->geometry_data, element, jobs)) return Error("Invalid vertex attributes");
2373 if (!parseGeometryColors(mesh->geometry_data, element, jobs)) return Error("Invalid vertex attributes");
2374 if (!parseGeometryNormals(mesh->geometry_data, element, jobs)) return Error("Invalid vertex attributes");
2375
2376 return mesh;
2377}
2378
2379struct OptionalError<Object*> parseTexture(const Scene& scene, const Element& element, Allocator& allocator)
2380{

Callers 1

parseObjectsFunction · 0.85

Calls 8

ErrorClass · 0.85
findChildFunction · 0.85
pushJobFunction · 0.85
parseGeometryMaterialsFunction · 0.85
parseGeometryUVsFunction · 0.85
parseGeometryTangentsFunction · 0.85
parseGeometryColorsFunction · 0.85
parseGeometryNormalsFunction · 0.85

Tested by

no test coverage detected