|
@@ -207,6 +207,7 @@ class Geometry {
|
|
var vect = root.get(layer + "." + name, opt);
|
|
var vect = root.get(layer + "." + name, opt);
|
|
if( vect == null ) return null;
|
|
if( vect == null ) return null;
|
|
var nrm = vect.getFloats();
|
|
var nrm = vect.getFloats();
|
|
|
|
+
|
|
// if by-vertice (Maya in some cases, unless maybe "Split per-Vertex Normals" is checked)
|
|
// if by-vertice (Maya in some cases, unless maybe "Split per-Vertex Normals" is checked)
|
|
// let's reindex based on polygon indexes
|
|
// let's reindex based on polygon indexes
|
|
if( root.get(layer+".MappingInformationType").props[0].toString() == "ByVertice" ) {
|
|
if( root.get(layer+".MappingInformationType").props[0].toString() == "ByVertice" ) {
|
|
@@ -220,6 +221,19 @@ class Geometry {
|
|
}
|
|
}
|
|
nrm = nout;
|
|
nrm = nout;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // Blender after version 4.X export normals with index to direct inforamtion type
|
|
|
|
+ if( root.get(layer+".ReferenceInformationType").props[0].toString() == "IndexToDirect" ) {
|
|
|
|
+ var nout = [];
|
|
|
|
+ var nrmIdx = root.get(layer+".NormalsIndex").getInts();
|
|
|
|
+ for (i in 0...nrmIdx.length) {
|
|
|
|
+ nout.push(nrm[nrmIdx[i] * 3]);
|
|
|
|
+ nout.push(nrm[nrmIdx[i] * 3 + 1]);
|
|
|
|
+ nout.push(nrm[nrmIdx[i] * 3 + 2]);
|
|
|
|
+ }
|
|
|
|
+ nrm = nout;
|
|
|
|
+ }
|
|
|
|
+
|
|
return nrm;
|
|
return nrm;
|
|
}
|
|
}
|
|
|
|
|