首页 > 代码库 > max 批量导入obj
max 批量导入obj
建模的同事网上搜的,个别语法错误,修正了下挺好用的(网上随便一搜就有,借用一下做个记录)
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 = true10 11 OpenFileResult = dialog.ShowDialog()12 13 if OpenFileResult.Equals OpenFileResult.OK then14 15 (16 dialog.FileNames17 )18 19 else 20 Undefined21 22 )23 24 25 26 --if form !=undefined do destroydialogmytools27 28 29 30 rollout form "批量导入obj"31 (32 33 label lbl "批量导入obj"34 35 button btn "选择导入obj路径" width:120 height:2536 on btn pressed do37 38 (39 40 file_names= getnames "选择导入文件" "OBJ (*.obj)|*.obj"41 42 if file_names != undefined do43 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*") do57 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
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。