码迷,mamicode.com
首页 > 其他好文 > 详细

max 批量导入obj

时间:2017-06-09 18:18:31      阅读:387      评论:0      收藏:0      [点我收藏+]

标签:mat   geometry   for   tle   filter   fine   tool   else   sse   

建模的同事网上搜的,个别语法错误,修正了下挺好用的(网上随便一搜就有,借用一下做个记录)

 

 1 Fn getnames Title FilterName =(
 2 
 3   dialog = DotNetObject"System.Windows.Forms.OpenFileDialog"
 4 
 5   dialog.title = Title
 6 
 7   dialog.filter = FilterName
 8 
 9   dialog.Multiselect = true
10 
11   OpenFileResult = dialog.ShowDialog()
12 
13   if OpenFileResult.Equals OpenFileResult.OK then
14 
15   (
16     dialog.FileNames
17   )
18 
19   else 
20     Undefined
21 
22 )
23 
24  
25 
26 --if form !=undefined do destroydialogmytools
27 
28  
29 
30 rollout form "批量导入obj"
31 (
32 
33   label lbl "批量导入obj"
34   
35   button btn "选择导入obj路径" width:120 height:25
36   on btn pressed do
37 
38   (
39 
40     file_names= getnames "选择导入文件" "OBJ (*.obj)|*.obj"
41 
42     if file_names != undefined do
43 
44     (       
45 
46       for f in file_names do  
47 
48       ( 
49 
50                 if ( doesfileexist f ) do 
51 
52                    importFile f #noPrompt using:Wavefront_Object 
53 
54                        for geo in geometry  
55 
56                 where (matchPattern geo.name pattern:"3D_Object*") do
57 
58         ( 
59 
60              --geo.name = (f as string)  
61 
62              pathaa = filterString (f as string)"//" 
63 
64                              geo.name = pathaa[pathaa.count] 
65 
66                        )      
67 
68                    )
69 
70                    )
71 
72  
73 
74          )
75 
76 )
77 
78 createdialog form 200 50

具体使用步骤:

技术分享

 

max 批量导入obj

标签:mat   geometry   for   tle   filter   fine   tool   else   sse   

原文地址:http://www.cnblogs.com/konkon/p/6973053.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!