----输出模型信息
mesh01 = snapshotasmesh selection[1]
out_name = ((getdir #export)+"/ee.txt")
out_file = createfile out_name
--点总数输出
numberverts = mesh01.numverts
--面总数输出
numberfaces = mesh01.numfaces
format "%,%\n" numberverts numberfaces to:out_file
--点位置集合
for i = 1 to numberverts do
(
v = getvert mesh01 i
format "%," v to:out_file
)
format "\n" to:out_file
--面位置集合
for t = 1 to numberfaces do
(
z = getface mesh01 t
format "%," z to:out_file
)
close out_file
edit out_name
------读取模型信息
vert_array = #()
face_array = #()
in_file = openfile ((getdir #export)+"/ee.txt")
if in_file != undefined then
(
num_verts = readvalue in_file
num_faces = readvalue in_file
vert_array.count = num_verts
face_array.count = num_faces
for v = 1 to num_verts do vert_array[v] = (readvalue in_file)
for f = 1 to num_faces do face_array[f] = (readvalue in_file)
close in_file
new_mesh = mesh vertices:vert_array faces:face_array
)
-----输出UV信息
UvFaceNumber = meshop.getNumMapfaces $ 1
UvVertNumber = meshop.getNumMapVerts $ 1
arrayvet = for i = 1 to UvVertNumber collect meshop.getMapVert $ 1 i
arrayface = for i = 1 to UvfaceNumber collect meshop.getMapface $ 1 i
-----读取UV信息
meshop.setNumTVerts $ UvVertNumber
for i = 1 to UvFaceNumber do
(
meshop.setMapface $ 1 i arrayface[i]
)
for i = 1 to UvVertNumber do
(
meshop.setMapVert $ 1 i arrayvet[i]
)