Handle mesh names.

This commit is contained in:
kovacsv 2021-08-08 16:07:44 +02:00
parent 984c900189
commit dc0fdbbc5d
2 changed files with 3 additions and 3 deletions

View File

@ -207,6 +207,9 @@ OV.ThreeImporter = class extends OV.ImporterBase
materialIndex = FindMatchingMaterialIndex (this.model, child.material, materialIdToIndex, textureNames);
mesh = OV.ConvertThreeGeometryToMesh (child.geometry, materialIndex);
}
if (child.name !== undefined && child.name !== null) {
mesh.SetName (child.name);
}
if (child.matrixWorld !== undefined && child.matrixWorld !== null) {
const matrix = new OV.Matrix (child.matrixWorld.elements);

View File

@ -58,9 +58,6 @@ OV.HasHighpDriverIssue = function ()
OV.ConvertThreeGeometryToMesh = function (threeGeometry, materialIndex)
{
let mesh = new OV.Mesh ();
if (threeGeometry.name !== undefined && threeGeometry.name !== null) {
mesh.SetName (threeGeometry.name);
}
let vertices = threeGeometry.attributes.position.array;
for (let i = 0; i < vertices.length; i += 3) {
let x = vertices[i];