Fix baking vertex color when using multiple objects
This commit is contained in:
@@ -142,11 +142,10 @@ class ImportMesh {
|
||||
|
||||
public static function addMesh(mesh: Dynamic) {
|
||||
|
||||
if (mesh.texa == null) {
|
||||
equirectUnwrap(mesh);
|
||||
}
|
||||
if (mesh.texa == null) equirectUnwrap(mesh);
|
||||
var raw = rawMesh(mesh);
|
||||
raw.vertex_arrays.push({ values: mesh.texa, attrib: "tex", data: "short2norm" });
|
||||
if (mesh.cola != null) raw.vertex_arrays.push({ values: mesh.cola, attrib: "col", data: "short4norm", padding: 1 });
|
||||
|
||||
new MeshData(raw, function(md: MeshData) {
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ class MeshUtil {
|
||||
}
|
||||
for (j in 0...vas[1].values.length) va1[j + voff * 2] = vas[1].values[j];
|
||||
for (j in 0...vas[2].values.length) va2[j + voff * 2] = vas[2].values[j];
|
||||
if (va3 != null) for (j in 0...vas[3].values.length) va3[j + voff * 4] = vas[3].values[j];
|
||||
if (va3 != null) for (j in 0...vas[3].values.length) va3[j + voff * 3] = vas[3].values[j];
|
||||
for (j in 0...ias[0].values.length) ia[j + ioff] = ias[0].values[j] + voff;
|
||||
|
||||
voff += Std.int(vas[0].values.length / 4);
|
||||
|
||||
Reference in New Issue
Block a user