Import user strings for meshes, and add a todo for the whole model.

This commit is contained in:
kovacsv 2021-06-20 20:07:11 +02:00
parent 6e2e1a2109
commit 8d8fbc4447

View File

@ -75,6 +75,7 @@ OV.Importer3dm = class extends OV.ImporterBase
ImportRhinoDocument (rhinoDoc)
{
this.InitRhinoInstances (rhinoDoc);
this.ImportRhinoUserStrings (rhinoDoc);
this.ImportRhinoGeometry (rhinoDoc);
}
@ -95,6 +96,11 @@ OV.Importer3dm = class extends OV.ImporterBase
}
}
ImportRhinoUserStrings (rhinoDoc)
{
// TODO: https://github.com/mcneel/rhino3dm/issues/303
}
ImportRhinoGeometry (rhinoDoc)
{
let rhinoObjects = rhinoDoc.objects ();
@ -113,7 +119,7 @@ OV.Importer3dm = class extends OV.ImporterBase
if (rhinoAttributes.isInstanceDefinitionObject && rhinoInstanceReferences.length === 0) {
return;
}
let rhinoMesh = null;
let deleteMesh = false;
@ -174,6 +180,12 @@ OV.Importer3dm = class extends OV.ImporterBase
let mesh = new OV.Mesh ();
mesh.SetName (rhinoAttributes.name);
let userStrings = rhinoAttributes.getUserStrings ();
for (let i = 0; i < userStrings.length; i++) {
let userString = userStrings[i];
mesh.AddProperty (new OV.Property (OV.PropertyType.Text, userString[0], userString[1]));
}
let materialIndex = this.GetMaterialIndex (rhinoDoc, rhinoObject, rhinoInstanceReferences);
let threeJson = rhinoMesh.toThreejsJSON ();
let vertices = threeJson.data.attributes.position.array;