mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 11:04:00 +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;
|
std::vector<QString> dracoMaterialList;
|
||||||
for (const auto& dracoChild : child.children) {
|
for (const auto& dracoChild : child.children) {
|
||||||
if (dracoChild.name == "FBXDracoMeshVersion") {
|
if (dracoChild.name == "FBXDracoMeshVersion") {
|
||||||
if (!dracoChild.children.isEmpty()) {
|
if (!dracoChild.properties.isEmpty()) {
|
||||||
dracoMeshNodeVersion = dracoChild.properties[0].toUInt();
|
dracoMeshNodeVersion = dracoChild.properties[0].toUInt();
|
||||||
}
|
}
|
||||||
} else if (dracoChild.name == "MaterialList") {
|
} 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
|
// Figure out what material this part is
|
||||||
if (dracoMeshNodeVersion >= 2) {
|
if (dracoMeshNodeVersion >= 2) {
|
||||||
// Define the materialID now
|
// Define the materialID now
|
||||||
if (dracoMaterialList.size() - 1 <= materialID) {
|
if (materialID < dracoMaterialList.size()) {
|
||||||
part.materialID = dracoMaterialList[materialID];
|
part.materialID = dracoMaterialList[materialID];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -318,6 +318,7 @@ public:
|
||||||
void setTextureTransforms(const Transform& transform, MaterialMappingMode mode, bool repeat);
|
void setTextureTransforms(const Transform& transform, MaterialMappingMode mode, bool repeat);
|
||||||
|
|
||||||
const std::string& getName() const { return _name; }
|
const std::string& getName() const { return _name; }
|
||||||
|
void setName(const std::string& name) { _name = name; }
|
||||||
|
|
||||||
const std::string& getModel() const { return _model; }
|
const std::string& getModel() const { return _model; }
|
||||||
void setModel(const std::string& model) { _model = 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);
|
auto nameJSON = materialJSON.value(key);
|
||||||
if (nameJSON.isString()) {
|
if (nameJSON.isString()) {
|
||||||
name = nameJSON.toString().toStdString();
|
name = nameJSON.toString().toStdString();
|
||||||
|
material->setName(name);
|
||||||
}
|
}
|
||||||
} else if (key == "model") {
|
} else if (key == "model") {
|
||||||
auto modelJSON = materialJSON.value(key);
|
auto modelJSON = materialJSON.value(key);
|
||||||
|
|
Loading…
Reference in a new issue