导入:
rollout form "import obj"
(
label lbl "import obj"
button btn "obj path" width:120 height:25
button 'btn1' "export" width:120 height:25
on btn pressed do
(
obj_files = getFiles"C://xx//xx//*.obj"
for f in obj_files do(
if(doesfileexist f) do
importFile f #noPrompt using:Wavefront_Object
)
)
createdialog form 200 50
导出:
rollout myrollout "export obj" width:162 height:121
(
button 'btn1' "export" pos:[54,68] width:48 height:30 align:#left
on btn1 pressed do
(
i = 0
unhide objects
unfreeze objects
clearSelectcion()
for obj in objects do
(
k = getPolygonCount obj
if k[1] == 0 then
(
print obj.name
)
else
(
select obj
exportFile("D:\\xx\\xx\\"+obj.name+".obj")#noprompt selectedOnly:true
clearSelection()
i+=1
)
j+=1
)
print "all"
print j
print "finished"
print i
)
createdialog myrollout