日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

我的MAXSCRIPT笔记

發布時間:2025/3/18 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 我的MAXSCRIPT笔记 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

我的MAXSCRIPT筆記

1 1 getnodebyname "circle01" 2 2 for o in objects do 3 if o.name == "circle01" then 4 3 select $Box* – select any objects with the name box at the beginning of them. 5 4 move, scale rotate 6 move obj [x,y,z] 7 scale obj [x,y,z] 8 rotate obj (eulerangles x y z) 9 rot = eulerangles x y z --建立一個四元數旋轉,可以在需要地方使用 10 5 max commands in maxscript 11 n addition to controlling modeling and animation, MAXScript scripts can invoke 3ds Max menu and toolbar commands. You do this using the "max" keyword. 12 for example: 13 max file open 14 max unhide all 15 max quick render 16 help: 17 max time ? 18 max sel ? 19 max ? 20 21 6 select 22 select obj --單選,選擇當前,之前的被釋放 23 selectmore obj --多選 24 deselect obj 25 deselectNode node 26 27 clearselection() --清空所有 28 29 max select all 30 max select child --每調用一次,選中一個節點 31 7 show class "*" 32 show class "box" 33 show class "box.*" 34 8 --exit 跳出循環,而不是使用break 35 9 --函數 36 function myFunc x y = () --普通函數,調用: myFunc 3 4 37 function myFunc x y:20 = () --帶默認參數的函數,調用:myFunc 3或 myFunc 3 y:4 38 function myFunc x:10 y:20 = () --全默認參數函數,調用: myFunc x:3 y:4或myFunc y:4 x:3 39 10 --文件操作相關 40 getFilenamePath "c:/test/abc.txt" --"c:\test\" 41 getOpenFileName 42 caption:"Render To Texture Object Presets Open" 43 filename:(getDir #renderPresets + @"") 44 types:"Object Preset(*.rtp)|*.rtp" 45 historyCategory:"RTTObjectPresets" 46 getSavePath caption:"my title" initialDir:"$scripts" 47 file="g:\\subdir1\\subdir2\\myImage.jpg" 48 49 filenameFromPath file -- returns: "myImage.jpg" 50 getFilenamePath file -- returns: "g:\subdir1\subdir2\" 51 getFilenameFile file -- returns: "myImage" 52 getFilenameType file -- returns: ".jpg" 53 pathIsNetworkPath "c:\\temp\\test.txt" --returns: false 54 pathIsNetworkPath "\\\\someserver\\temp\\test.txt" --returns: true 55 11 --string 56 findString "Thanks for all the fish!" "all" -- returns 12 57 filterString "MAX Script, is-dead-funky" ", -" --#("MAX","Script","is","dead","funky") 58 s1=replace "1234567890" 5 3 "inserted string" --"1234inserted string890" 59 60 s ="Balerofon" 61 ss = substring s 5 3-- returns "rof" 62 ss = substring s 5 -1-- returns "rofon" 63 ss = substring s 5 100-- returns "rofon" 64 65 s="text1" 66 matchPattern s pattern:"text?"-- returns true 67 matchPattern s pattern:"T*"-- returns true 68 matchPattern s pattern:"T*"ignoreCase:false-- returns false 69 matchPattern s pattern:"s*"-- returns false 70 71 trimright "MAXScript \n " --spaces and new line trimmed 72 --"MAXScript" 73 trimright "$Teapot0911" "1234567890" --remove trailing numbers 74 --"$Teapot" 75 76 12 --Working with Values 77 -------------------------------------------------------- 78 ClassOf SuperClassOf 79 -------------------------------------------------------- 80 b Box GeometryClass 81 box GeometryClass Node 82 GeometryClass Node MAXWrapper 83 Node MAXWrapper Value 84 MAXWrapper Value Value 85 Value Value Value 86 -------------------------------------------------------- 87 88 --FOR EXAMPLE 89 --either of the following will collect all objects of class box into variable allBoxes : 90 allBoxes=for obj in $* where (isKindOf obj box) collect obj 91 allBoxes=#() 92 for obj in $* do (if classOf obj == box then append allBoxes obj) 93 94 --the following function limits the choices to shape objects: 95 fn shape_filt obj = isKindOf obj Shape 96 13 --數組相關操作 97 --賦值 98 arr = #() 99 append arr 3 100 append arr "hello" 101 arr[3] = 12.2 102 103 --遍歷 104 for o in arr do print o 105 for i=1 to arr.count print arr[i] 106 107 14 --maxscript language reference -collections 108 --ObjectSets represent the main scene object categories in 3ds Max. 109 objects --all the objects 110 geometry --the standard 3ds Max categories... 111 lights 112 cameras 113 helpers 114 shapes 115 systems 116 spacewarps 117 selection --the current selection 118 119 --for example 120 for s in shapes do print s 121 for i=1 to geometry.count do print geometry[i] 122 15 --rootscene 與 rootnode 123 rootNode 124 ------------------------------------------------------------------------------------------ 125 Contains a Node value that defines the root node of the scene. 126 The root node does not physically exist in the scene, rather it is a special node that is the parent node of all nodes that are not linked to another node. 127 The scene objects can be enumerated by accessing the children property of the root node. 128 A run-time error is generated if you try to perform other node operations on the root node. 129 130 rootScene 131 ------------------------------------------------------------------------------------------ 132 Represents the scene root in scripts and Macro Recorder output. 133 The subAnims of rootScene include the node hierarchy, the Material Editor, Track View, Scene Material Library etc 134 135 --遍歷場景中最頂級的物體 136 for o in rootNode.children do 137 ( 138 print o 139 print o.parent --undefined 140 ) 141 142 --注意,MAX場景是以樹結構來組織的,一個場景可以多個不相連的子樹,也就是有多個根結點 143 --這些子樹都以rootnode為根,但parent卻是undefined,如上 144 145 --導出FBX模型與動畫 146 --1,導出模型和骨骼層級 147 --注意:骨骼層級必須和模型一起導出,否則對它設置動畫無效果,這個很容易忽視 148 149 --等價于 select geometry 150 for o in objects do 151 ( 152 cls = classof o 153 if cls == Biped_Object or cls == BoneGeometry or cls == PolyMeshObject then 154 (--選擇所有網格,和所有骨骼(biped_object, boneGeometry) 155 selectmore o 156 ) 157 158 ) 159 160 --2,導出不帶模型的純動畫 161 for o in objects do 162 ( 163 cls = classof o 164 if cls == Biped_Object or cls == BoneGeometry then 165 (--所有骨骼(biped_object, boneGeometry) 166 selectmore o 167 ) 168 ) 169 16 --material 170 ------------------------------------------------------------------------------------------ 171 --The following will render the diffuse map assigned to the material of object $foo 172 -- to a bitmap of size 640x480 and save it to the file "foodif.bmp" 173 ------------------------------------------------------------------------------------------ 174 rm = renderMap $foo.material.diffuseMap size:[640,480] \ 175 fileName:"foodif.bmp" 176 save rm 177 close rm 178 179 ------------------------------------------------------------------------------------------ 180 --材質,每個模型只有一個material,但這個material可以是單材質或多重材質 181 --每個材質可以有多個貼圖,對應各種顏色: 182 --diffusemap :漫反射 183 --不透明貼圖:不透明度 184 --高光貼圖:高光顏色 185 --光澤度貼圖:光澤度 186 --自發光貼圖:自發光 187 --凹凸貼圖,反射貼圖,折射貼圖,置換貼圖。。。。 188 ------------------------------------------------------------------------------------------ 189 showTextureMap $foo.material $foo.material.diffuseMap on 190 tm = checker() 191 mat = standardMaterial diffuseMap:tm 192 mm = multimaterial() --多重材質 193 mm[1] = mat 194 $box01.material = mm 195 showTextureMap mm[1] tm on 196 197 getnumsubmtls --獲取子材質數量 198 199 ----------------------------------------------------------- 200 --如何獲取模型上的貼圖 201 b = box() 202 b.material.diffuseMap.filename --203 b.material.diffuseMap.bitmap 204 17 --show properites 205 b = box() 206 showproperties b.material 207 18 --external command 208 --注意,DOS命令是WINDOWS網格的分割符,是下坡線,maxscript是上坡線,必須轉換 209 doscommand "copy f:\\abc.fbx f:\\test" --將 f:\abc.fbx拷貝到f:\test文件夾下 View Code

?

posted on 2018-01-31 11:13 時空觀察者9號 閱讀(...) 評論(...) 編輯 收藏

總結

以上是生活随笔為你收集整理的我的MAXSCRIPT笔记的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 久久久久久久久久久久久久国产 | 殴美一级特黄aaaaaa | 天堂网在线资源 | 国产精品偷拍 | 中文在线免费视频 | 久久久看| 91国内产香蕉 | 免费成人激情视频 | 精品久久无码视频 | 婷婷激情综合网 | 国产精品精品久久久 | 欧美激情15p | 日韩香蕉网 | 18做爰免费视频网站 | 国产污污在线观看 | 欧美混交群体交 | 国产又爽又黄免费软件 | 日韩精品一区二区不卡 | 美女扒逼 | 久久黄视频 | 精品一区二区三区视频日产 | 黄色正能量网站 | 日韩欧美一级在线 | 大桥未久视频在线观看 | 黄页视频在线免费观看 | 亚洲欧美在线免费观看 | 猛1被调教成公厕尿便失禁网站 | 少妇一级淫免费观看 | 性色生活片| 日韩中文字幕 | 久久影院国产 | 好男人影视www| 久久久夜色精品 | 一区二区在线免费观看视频 | 亚洲综合视频在线播放 | 婷婷毛片 | 欧美a性| 国产大片av | 久久影视网| 亚洲综合色av | 一区二区国产精品 | 四虎精品一区二区 | 美国成人免费视频 | 黄色一级大片免费看 | 中国久久久久 | 中文字幕不卡视频 | 人人澡人人澡人人澡 | 久久久久无码精品 | 精品中文字幕在线 | 亚洲一级特黄 | 日韩一区二区在线看 | 秋霞电影网一区二区 | 国产视频一区在线观看 | 亚洲综合免费观看高清完整版 | 91综合国产 | 国产91精品久久久久久久 | 粉嫩欧美一区二区三区 | 欧美成人精品激情在线观看 | 久草视频福利在线 | 奇米影视777在线观看 | 国产盗摄在线观看 | 欧美久久久影院 | 色欲欲www成人网站 老色鬼av | wwwxxx日韩| 动漫美女被到爽 | 国产毛片视频网站 | 国内外成人在线视频 | 日本高清视频在线观看 | 久操免费视频 | 在线看的av | 制服丝袜一区二区三区 | 久久的色偷偷 | 公交顶臀绿裙妇女配视频 | 国产精品一区久久 | 一区精品视频在线观看 | 欧美首页 | 97人人精品 | 日韩精品视频在线观看免费 | av观看网| 青青草视频免费播放 | 伊人69| 色一情一交一乱一区二区三区 | 天堂网免费视频 | 朴银狐电影中文在线看 | 亚洲蜜桃av| 丰满熟女人妻一区二区三 | 国产综合区 | 日本激情一区二区 | 外国黄色录像 | av看片网站 | 中国特级黄色大片 | 九九精品在线播放 | 超碰97久久| aa视频免费观看 | 午夜黄色影院 | 久久99热这里只频精品6学生 | 美女极度色诱图片www视频 | 日本一级吃奶淫片免费 | 亚洲一区精品在线 |