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

Function parseGeometryMaterials

Source/ThirdParty/OpenFBX/ofbx.cpp:2291–2314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2289}
2290
2291static bool parseGeometryMaterials(GeometryDataImpl& geom, const Element& element, std::vector<ParseDataJob> &jobs)
2292{
2293 const Element* layer_material_element = findChild(element, "LayerElementMaterial");
2294 if (!layer_material_element) return true;
2295
2296 const Element* mapping_element = findChild(*layer_material_element, "MappingInformationType");
2297 const Element* reference_element = findChild(*layer_material_element, "ReferenceInformationType");
2298
2299 if (!mapping_element || !reference_element) return false;
2300 if (!mapping_element->first_property) return false;
2301 if (!reference_element->first_property) return false;
2302
2303 if (mapping_element->first_property->value == "ByPolygon" && reference_element->first_property->value == "IndexToDirect") {
2304 const Element* indices_element = findChild(*layer_material_element, "Materials");
2305 if (!indices_element || !indices_element->first_property) return false;
2306
2307 return pushJob(jobs, *indices_element->first_property, geom.materials);
2308 }
2309 else
2310 {
2311 if (mapping_element->first_property->value != "AllSame") return false;
2312 }
2313 return true;
2314}
2315
2316static bool parseGeometryUVs(GeometryDataImpl& geom, const Element& element, std::vector<ParseDataJob> &jobs) {
2317 const Element* layer_uv_element = findChild(element, "LayerElementUV");

Callers 2

parseMeshFunction · 0.85
parseGeometryFunction · 0.85

Calls 2

findChildFunction · 0.85
pushJobFunction · 0.85

Tested by

no test coverage detected