| 647 | } |
| 648 | |
| 649 | aiMaterial *XmlSerializer::readMaterialDef(XmlNode &node, unsigned int basematerialsId) { |
| 650 | aiMaterial *material = new aiMaterial(); |
| 651 | material->mNumProperties = 0; |
| 652 | std::string name; |
| 653 | bool hasName = getNodeAttribute(node, D3MF::XmlTag::basematerials_name, name); |
| 654 | |
| 655 | std::string stdMaterialName; |
| 656 | const std::string strId(ai_to_string(basematerialsId)); |
| 657 | stdMaterialName += "id"; |
| 658 | stdMaterialName += strId; |
| 659 | stdMaterialName += "_"; |
| 660 | if (hasName) { |
| 661 | stdMaterialName += name; |
| 662 | } else { |
| 663 | stdMaterialName += "basemat_"; |
| 664 | stdMaterialName += ai_to_string(mMaterials.size()); |
| 665 | } |
| 666 | |
| 667 | aiString assimpMaterialName(stdMaterialName); |
| 668 | material->AddProperty(&assimpMaterialName, AI_MATKEY_NAME); |
| 669 | |
| 670 | assignDiffuseColor(node, material); |
| 671 | |
| 672 | return material; |
| 673 | } |
| 674 | |
| 675 | void XmlSerializer::ReadColor(XmlNode &node, ColorGroup *colorGroup) { |
| 676 | if (node.empty() || nullptr == colorGroup) { |
nothing calls this directly
no test coverage detected