mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 17:53:32 +02:00
Add a hack to fix normals on Makehuman exports.
This commit is contained in:
parent
b458cd1297
commit
c08dfc90c3
1 changed files with 9 additions and 2 deletions
|
@ -760,6 +760,7 @@ ExtractedMesh extractMesh(const FBXNode& object) {
|
|||
|
||||
} else if (child.name == "LayerElementNormal") {
|
||||
data.normalsByVertex = false;
|
||||
bool indexToDirect = false;
|
||||
foreach (const FBXNode& subdata, child.children) {
|
||||
if (subdata.name == "Normals") {
|
||||
data.normals = createVec3Vector(getDoubleVector(subdata));
|
||||
|
@ -767,11 +768,17 @@ ExtractedMesh extractMesh(const FBXNode& object) {
|
|||
} else if (subdata.name == "NormalsIndex") {
|
||||
data.normalIndices = getIntVector(subdata);
|
||||
|
||||
} else if (subdata.name == "MappingInformationType" &&
|
||||
subdata.properties.at(0) == "ByVertice") {
|
||||
} else if (subdata.name == "MappingInformationType" && subdata.properties.at(0) == "ByVertice") {
|
||||
data.normalsByVertex = true;
|
||||
|
||||
} else if (subdata.name == "ReferenceInformationType" && subdata.properties.at(0) == "IndexToDirect") {
|
||||
indexToDirect = true;
|
||||
}
|
||||
}
|
||||
if (indexToDirect && data.normalIndices.isEmpty()) {
|
||||
// hack to work around wacky Makehuman exports
|
||||
data.normalsByVertex = true;
|
||||
}
|
||||
} else if (child.name == "LayerElementUV" && child.properties.at(0).toInt() == 0) {
|
||||
foreach (const FBXNode& subdata, child.children) {
|
||||
if (subdata.name == "UV") {
|
||||
|
|
Loading…
Reference in a new issue