[Closed] Object creation
Can someone help me setup a script for this function.
What i have is a master list of vertex points lets say 1 – 1,000
and now i have a list of faces but the list of faces are a few different objects.
so say face 1 – 300 is object 1
face 301 – 800 is object 2
and 801 – 1,000 is object 3
how would i generate this mesh without duplicating the vertex points.
currently i am doing this inside my loop of reading the objects.
msh = mesh vertices:Vert_array faces:Face_array
msh.numTVerts = UV_array.count
buildTVFaces msh
msh.name = mshname
for j = 1 to UV_array.count do setTVert msh j UV_array[j]
for j = 1 to Face_array.count do setTVFace msh j Face_array[j]
for j = 1 to Normal_array.count do setNormal msh j Normal_array[j]
and if i do this after reading all the faces into one array it works but then material assignment is wrong.
I hope this makes sense I am very thankful for any help
if something is unclear ill try to explain it better just let me know.
Well I found a way to hack around this i am not sure if this is the correct way but for each object i just detach the faces as new objects then delete the original mesh
I use the command
newMesh = meshop.detachFaces msh #{fpos…(fpos + (FaceSecArr[b]) – 1)} delete:false asMesh:true
emesh = Editable_mesh() –create an empty Editable_mesh
emesh.mesh = newMesh –assign the detached faces to the new mesh
emesh.name = mshname + “_” + (b as string)
update emesh –update the mesh