mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-07 04:43:37 +02:00
Merge pull request #15402 from sabrina-shanman/hfm_bug_model-materials_master
(case 22216) Fix Interface not loading some baked models correctly
This commit is contained in:
commit
d5ab49c64c
3 changed files with 4 additions and 2 deletions
|
@ -358,7 +358,7 @@ ExtractedMesh FBXSerializer::extractMesh(const FBXNode& object, unsigned int& me
|
|||
std::vector<QString> dracoMaterialList;
|
||||
for (const auto& dracoChild : child.children) {
|
||||
if (dracoChild.name == "FBXDracoMeshVersion") {
|
||||
if (!dracoChild.children.isEmpty()) {
|
||||
if (!dracoChild.properties.isEmpty()) {
|
||||
dracoMeshNodeVersion = dracoChild.properties[0].toUInt();
|
||||
}
|
||||
} else if (dracoChild.name == "MaterialList") {
|
||||
|
@ -492,7 +492,7 @@ ExtractedMesh FBXSerializer::extractMesh(const FBXNode& object, unsigned int& me
|
|||
// Figure out what material this part is
|
||||
if (dracoMeshNodeVersion >= 2) {
|
||||
// Define the materialID now
|
||||
if (dracoMaterialList.size() - 1 <= materialID) {
|
||||
if (materialID < dracoMaterialList.size()) {
|
||||
part.materialID = dracoMaterialList[materialID];
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -318,6 +318,7 @@ public:
|
|||
void setTextureTransforms(const Transform& transform, MaterialMappingMode mode, bool repeat);
|
||||
|
||||
const std::string& getName() const { return _name; }
|
||||
void setName(const std::string& name) { _name = name; }
|
||||
|
||||
const std::string& getModel() const { return _model; }
|
||||
void setModel(const std::string& model) { _model = model; }
|
||||
|
|
|
@ -184,6 +184,7 @@ std::pair<std::string, std::shared_ptr<NetworkMaterial>> NetworkMaterialResource
|
|||
auto nameJSON = materialJSON.value(key);
|
||||
if (nameJSON.isString()) {
|
||||
name = nameJSON.toString().toStdString();
|
||||
material->setName(name);
|
||||
}
|
||||
} else if (key == "model") {
|
||||
auto modelJSON = materialJSON.value(key);
|
||||
|
|
Loading…
Reference in a new issue