| 481 | } |
| 482 | |
| 483 | ModelMaterialDef* GLTFReader::LoadMaterial(const StringImpl& relPath) |
| 484 | { |
| 485 | String propsPath; |
| 486 | if (relPath.StartsWith('/')) |
| 487 | { |
| 488 | propsPath = mRootDir + relPath; |
| 489 | int dotPos = (int)propsPath.LastIndexOf('.'); |
| 490 | if (dotPos > 0) |
| 491 | propsPath.RemoveToEnd(dotPos); |
| 492 | propsPath += ".props.txt"; |
| 493 | } |
| 494 | else if (mBasePathName.Contains("staticmesh")) |
| 495 | propsPath = GetFileDir(mBasePathName) + "/" + relPath + ".props.txt"; |
| 496 | else |
| 497 | propsPath = GetFileDir(mBasePathName) + "/materials/" + relPath + ".props.txt"; |
| 498 | |
| 499 | ModelMaterialDef* materialDef = ModelMaterialDef::CreateOrGet("GLTF", propsPath); |
| 500 | |
| 501 | if (materialDef->mInitialized) |
| 502 | return materialDef; |
| 503 | |
| 504 | materialDef->mInitialized = true; |
| 505 | |
| 506 | String propText; |
| 507 | if (LoadTextData(propsPath, propText)) |
| 508 | { |
| 509 | if (!ParseMaterialDef(materialDef, propText)) |
| 510 | { |
| 511 | // Had error |
| 512 | } |
| 513 | |
| 514 | } |
| 515 | return materialDef; |
| 516 | } |
| 517 | |
| 518 | bool GLTFReader::LoadModelProps(const StringImpl& propsPath) |
| 519 | { |
nothing calls this directly
no test coverage detected