摘要:MaxString = "abcdefg"DotNetString = DotNetObject "System.String" MaxString DotNetString.Replace "a" "z" --返回值就是MaxScript中的StringDotNetString.toString() --从.net中取值
阅读全文
摘要:for i in 1 to 10 do ( for a in 1 to 30 do ( if a == 10 do exit print a ) print i )
阅读全文
摘要:fn save_by_Group sel dir = ( local ss = #(), s for i in sel where isGroupHead i do ( setGroupOpen i false append ss i ) for i in ss do ( s = for o in i.children collect i append s i saveNodes s (dir+i.name+".max") quiet:on ))save_by_Group objects "d:\\"
阅读全文
摘要:如果两个平面只是方向不同的话,它们与射线的交点应该是相等的吧?下面算法计算出来的不相等吧? 平面方程为Ax + By + Cz + D = 0; 平面的单位法向量为N(A, B, C);射线表示为P = Org +Dir*step; Dir为射线的方向,已经规格化。Org为原点把射线的方程代入平面方程可以得step = -(DotProduct(N, Org)+D)/(DotProduct(N, Dir);平面的参数如下:A = 1; B = 0; C = 0; D = -7;A = -1;B = 0; C = 0; ...
阅读全文
摘要:meditMaterials[3].showInViewport= true meditMaterials[3].showInViewport= falseokMtlForScene $.materialshowHWTextureMap $.material trueenableHardwareMaterial $.material false
阅读全文
摘要:IViewportShadingMgr.ReviewGPUDiagnostics()
阅读全文
摘要:modPanel.setCurrentObject $.baseObject
阅读全文
摘要:---法线问题基本是通过角度判断--- normal*a.*正常的*,*普通的* problem*n.*问题,疑难* form*n.*形式*,*形状*vt.*形成* verdict*n.*裁决*,*定论* ---/* polyop.getFaceSelection $p_22 = polyop.getFaceNormal $ 19 --node:<node=unsupplied> p_14 = polyop.getFaceNormal $ 151 --node:<node=unsupplied> acos (dot p_22 p_14) */---可以通过面的角度进行,
阅读全文
摘要:/* global pickObj=undefinedglobal selObj=undefinedglobal mysplineArray=#()global targetsplineArray=#()global myObjArray=#()fn fl_detachSplines ss =(centerPivot ssnumsp = numsplines sssp=#()if numsp > 1 then( for i in 1 to numsp do ( tempS = splineShape pos:(getKnotPoint ss i 1) addNewSpline tempS
阅读全文
摘要:------------写一个函数 有几类不同的元素,但是每一类都有你哥是相同的个体 我就是要查处那个类是最多的----------这个功能可应在 选择面的法线上,实行少数服从多数原则,handrn = #(12,12,30,60,10,12,20,30,50,60,60,12,30,12,30 ,30,30)---- 其实这个函数是为了以后判断主流法线的。 fn gt_11_1_unmBIJIAO Arrayy= ( temporaryarray= #() temporaryarray1 =#() for i in Arrayy do ( if findItem temporaryarr..
阅读全文
摘要:(global TestMapSamples try(destroyDialog TestMapSamples )catch()local lights_state = #()local lights_array = #()fn collectLightsState = (lights_state = #()lights_array = for l in Lights where classof l != TargetObject collect lfor l in lights_array do (try(append lights_state l.onl.on = false)catch(
阅读全文
摘要:/*Macro_scripts for UVW UnwrapVersion: 3dsmax 9Revision History:12 dec 2003, Pierre-Felix Breton, added product switcher: this macro file can be shared with all Discreet productsmoved functions and dialog definition into the /stdplug/stdscripts/modifier_uvwunwrap_dialog.ms28th august 2006, Pierre-Fe
阅读全文
摘要:local clWindowText = (colorman.getcolor #windowtext * 255) as colorlocal cl3dDarkShadow = (colorman.getcolor #3ddarkshadow * 255) as colorlocal clRollupTitleText = (colorman.getcolor #rollupTitleText * 255) as colorlocal clRollupTitleFace = (colorman.getcolor #rollupTitleFace * 255) as colorlocal cl
阅读全文
摘要:on execute do actionMan.executeAction 2077580866 "40043" -- All Commands: Stitch-- actionMan.executeAction on altExecute type do actionMan.executeAction 2077580866 "40044" -- All Commands: Stitch Dialog --- 是挤压还有就是box 盒子的效果,-- actionMan.executeAction
阅读全文
摘要:unwrapModPKW = modpanel.getcurrentobject() -- unwrapModPKW= modpanel.getcurrentobject() ---当前选择的层级 xPKW = unwrapModPKW .GetWindowX() -- xPKW = unwrapModPKW. GetWindowX () yPKW = unwrapModPKW .GetWindowY() -- yPKW = unwrapModPKW. GetWindowY .. GetWindowH -- 都是 收集uv 编辑器的对话框的。 hPKW = unwrapModPKW .Ge..
阅读全文
摘要:unwrapModPKW = modpanel.getcurrentobject() --- modpanel.getcurrentobject 是查询当前层级 xPKW = unwrapModPKW.GetWindowX() -- GetWindowX 找到窗口x 坐标 yPKW = unwrapModPKW.GetWindowY() -- GetWindowY 找到窗口y 坐标 hPKW = unwrapModPKW.GetWindowH() -- GetWindowH 找到展uv 窗口 的总高度。---但什么时候这里等于零 就是在我最小环的时候进行,高度就是等于了0 if (hPK...
阅读全文
摘要:-- curb unwrapper(version 0.1, 6th may 2004)-- MAX script, tested with 3ds MAX 5.1-- (c) 2004 Andrei Kletskov (111)-- homepage: http://andklv.narod.ru -- e-mail: andklv@mail.ru -- please do not remove any copyrights from this script-- Description -- -- this script was designed to ease texturing of c
阅读全文
摘要:rollout FErollout "火焰特效" width:180 height:245(button btn1 "火焰" pos:[12,20] width:140 height:30bitmap bmp1 "" pos:[12,70] width:140 height:120button btn2 "渲染预览" pos:[51,205] width:64 height:21 on btn1 pressed do(resetMaxFile #nopromptglobal sgizmo = spheregizmo
阅读全文
摘要:edit "C://Documents and Settings//Administrator//桌面/3.ms"
阅读全文
摘要:a=getFileSize "d://a.jpg" --得到的是a.jpg的大小,单位bytesa/1024.0 得到的是多少Ka/1024.0/1024.0 得到的是多少M
阅读全文
摘要:setTransformLockFlags的方法说明,不太难,相信能看懂的setTransformLockFlags <node> (#all | #none | <bitarray>) -- mappedSet and set the transform lock flags for the specified node as an <bitarray>. If a bit is on, the corresponding transform lock is turned on. The order of the bits is: #{POS_X,POS_
阅读全文
摘要:a=$line01.centerb=$line02.centernew_spline = splineShape ()addNewSpline new_spline addKnot new_spline 1 #corner #curve a addKnot new_spline 1 #corner #curve b updateshape new_spline
阅读全文
摘要:resetMaxFile #noPrompt --重置文件theV = normalize [5,10,0] --矢量旋转,标准化为 单位向量theStep = 10 --旋转 单位--旋转从0到360度for a = 0 to 360-theStep by theStep do(rm = rotateXMatrix a --根据变量 a 创建一个旋转矩阵theRotV = theV * rm --使用矩阵 改造原有的载体format "%: %/n" a theRotV --将结果 打印到 监听器上c = cylinder() --创建一个圆柱体c.dir = theRo
阅读全文
摘要:--随机树角度oArray = $selection as arrayclearSelection()for i in oArray do(--随机角度angleValue = (random 5 30) *3--format "角度:% /n" angleValuerotate i (angleaxis (random 0 90) [0,0,1]))--合并树递归方法function attachTree oArray isRandHeight =(if oArray.count < 2 then(return "选择合并数量必须大于等于2")s
阅读全文
摘要:p = convertToPoly(Plane()) --create a plane, convert to EPolys = sphere radius:5 --create a sphere primitivep.attach s s --attach sphere to EPolyp = convertToPoly(Plane()) --create a plane, convert to EPolyb = Box() --create a box primitiveb.rotation = eulerangles 45 45 0 --rotate the boxt = teapot
阅读全文
摘要:--只移动Z轴到0fn moveObjectToZeroOnlyZ obj = ( local icenter local minz icenter = obj.center minz = obj.min.z move obj [0,0,-minz])--轴心归底fn CenterPiv i =( CenterPivot i --轴心归中心 i.pivot.z = i.min.z --轴心的Z轴等于物体最底点)--移动物体到世界原点fn moveObjectToZero obj = ( center = obj.center minz = obj.min.z move obj [-center
阅读全文
摘要:fn HandleMax obj=( --有必要可以优化一下材质 --........ obj_name=obj.name filepath = maxfilepath makeDir (filepath + obj_name)--在当前处理的max路径下建立以对象物体为名的文件夹 --输出这个文件成一个.x文件,并保存为以物体为名的文件夹内。 exportfile (filepath + obj_name + "\\" + obj_name+".x") #noprompt )---------------------------------------
阅读全文
摘要:rollout unnamedRollout "Untitled" width:162 height:300(button btn1 "Button" pos:[6,77] width:137 height:121local klon btn1 pressed do (--while not eof std_oo do for o = 1 to 4 do ( local opo = readLine std_oo coun= filterString opo " " if coun.count>1 then( kl= "
阅读全文
摘要:思路:/*--根据题意 已知道A B 两点坐标 AB和BC的角度--已知道 AC BC 的距离 求c点坐标--如图--***** 解释******--我们把题 放到max 的顶视图考虑 (就是相当于一个二维坐标系中进行)--通过审题 可以知道C点有两个,分别在线段AB的两边。这个问题我们就看图中 --先考虑其中的一边,并且为了方便我把它放到了第一象限内。---如图做了一些辅助线。---如图如果求C点坐标 其实就是求 OE EC 的长度---进一步推导 要想求出他们的长度 知道知道 OC 的长度 还有角COE 就可以通过三角函数求出来。---1.求角CBD--因为A B 坐标知道 所以就知道了O
阅读全文
摘要:if (splitViewRollout != undefined) and (splitViewRollout.isDisplayed) do (destroyDialog splitViewRollout)global splitViewRollout rollout splitViewRollout " Modifiers"(-- TreeViewfn initTreeView tv =( tv.checkboxes = true tv.sorted = true)fn addModifiers theNode theModifiers =( for m in the
阅读全文
摘要:dnDateTime = dotNetObject "System.DateTime" 1972 03 08 18 30 0-- prints "8/03/1972 6:30:00 PM" -- Australianformat "%\n" (dnDateTime.toString())DateTime = dotNetClass "System.DateTime"date = DateTime.Parse "8/03/1972 6:30:00 PM"print (date.ToString()
阅读全文
摘要:(local ofd = dotnetobject "System.Windows.Forms.OpenFileDialog"ofd.Filter = "XML Files (*.xml)|*.xml |(*.*)|*.*"ofd.RestoreDirectory = falseofd.multiselect = true if ofd.showDialog() == (dotNetClass "System.Windows.Forms.DialogResult").OK then ( local sFile = ofd.fileNa
阅读全文
摘要:(dotnet.loadassembly "System.Data"Color = dotNetClass "System.Drawing.Color"ScrollBars = dotNetClass "System.Windows.Forms.ScrollBars"-- Create Tabs Container tabControl1 = dotnetobject "system.windows.forms.TabControl"tabControl1.size = dotnetobject "sys
阅读全文
摘要:(Color = dotNetClass "System.Drawing.Color"ScrollBars = dotNetClass "System.Windows.Forms.ScrollBars"-- Create Tabs Container tabControl1 = dotnetobject "system.windows.forms.TabControl"tabControl1.size = dotnetobject "system.drawing.size" 395 195tabControl1.L
阅读全文
摘要:(-- setup dotnet classes / objectslocal mb = dotNetClass "System.Windows.Forms.MessageBox"local buttons = dotNetClass "System.Windows.Forms.MessageBoxButtons"local icons = dotNetClass "System.Windows.Forms.MessageBoxIcon"local defaultButton = dotNetClass "System.Wi
阅读全文
摘要:(rollout rollmain "dotnet" (dotnetcontrol lst_test "System.Windows.Forms.Listbox" width:290 height:290 align:#centeron rolmain open do(dotnet.loadassembly "System.Data"constring="data source=.\SQLEXPRESS;Initial Catalog=YOUR_DATABASE_HERE;Integrated Security=True;C
阅读全文