10 2011 档案

。net 换字符
摘要:MaxString = "abcdefg"DotNetString = DotNetObject "System.String" MaxString DotNetString.Replace "a" "z" --返回值就是MaxScript中的StringDotNetString.toString() --从.net中取值 阅读全文

posted @ 2011-10-31 11:09 盖天00 阅读(206) 评论(0) 推荐(0)

这样的结构很常用
摘要:for i in 1 to 10 do ( for a in 1 to 30 do ( if a == 10 do exit print a ) print i ) 阅读全文

posted @ 2011-10-29 15:59 盖天00 阅读(151) 评论(0) 推荐(0)

把组 保存
摘要: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:\\" 阅读全文

posted @ 2011-10-25 09:01 盖天00 阅读(202) 评论(0) 推荐(0)

创建 平面求交点
摘要:如果两个平面只是方向不同的话,它们与射线的交点应该是相等的吧?下面算法计算出来的不相等吧? 平面方程为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; ... 阅读全文

posted @ 2011-10-24 17:03 盖天00 阅读(218) 评论(0) 推荐(0)

3dmas 的硬显示 这个就是其中既各个 最后两个是 对应显示操作的
摘要:meditMaterials[3].showInViewport= true meditMaterials[3].showInViewport= falseokMtlForScene $.materialshowHWTextureMap $.material trueenableHardwareMaterial $.material false 阅读全文

posted @ 2011-10-21 18:48 盖天00 阅读(180) 评论(0) 推荐(0)

看看显卡信息 这个很全
摘要:IViewportShadingMgr.ReviewGPUDiagnostics() 阅读全文

posted @ 2011-10-21 18:42 盖天00 阅读(167) 评论(0) 推荐(0)

设置到基础层
摘要:modPanel.setCurrentObject $.baseObject 阅读全文

posted @ 2011-10-21 18:29 盖天00 阅读(143) 评论(0) 推荐(0)

暂存场景
摘要:holdMaxFile 阅读全文

posted @ 2011-10-21 16:54 盖天00 阅读(130) 评论(0) 推荐(0)

思路错了这样的问题应该子啊导入导出上下功夫
摘要:---法线问题基本是通过角度判断--- 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) */---可以通过面的角度进行, 阅读全文

posted @ 2011-10-21 10:36 盖天00 阅读(209) 评论(0) 推荐(0)

转 splie 的
摘要:/* 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 阅读全文

posted @ 2011-10-20 17:53 盖天00 阅读(304) 评论(0) 推荐(0)

查找主流重复最多的数。
摘要:------------写一个函数 有几类不同的元素,但是每一类都有你哥是相同的个体 我就是要查处那个类是最多的----------这个功能可应在 选择面的法线上,实行少数服从多数原则,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.. 阅读全文

posted @ 2011-10-20 09:28 盖天00 阅读(193) 评论(0) 推荐(0)

视图帅新
摘要:ith redraw off 阅读全文

posted @ 2011-10-19 17:09 盖天00 阅读(140) 评论(0) 推荐(0)

更新材质球
摘要:(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( 阅读全文

posted @ 2011-10-17 17:09 盖天00 阅读(273) 评论(0) 推荐(0)

数组转成 位数组 这个很好用。
摘要:bitarray 阅读全文

posted @ 2011-10-17 16:15 盖天00 阅读(181) 评论(0) 推荐(0)

max 自带uv 宏解释
摘要:/*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 阅读全文

posted @ 2011-10-17 14:04 盖天00 阅读(580) 评论(0) 推荐(0)

我们的界面颜色设计用到的时候 可以引用max 本身的操作, 看这个
摘要: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 阅读全文

posted @ 2011-10-14 14:48 盖天00 阅读(215) 评论(0) 推荐(0)

uv max 内置界面中 box 图标效果。
摘要: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 阅读全文

posted @ 2011-10-14 14:29 盖天00 阅读(276) 评论(0) 推荐(0)

时时设定 uv 面板的位置,还有就是 关于属性打开界面的大小
摘要:unwrapModPKW = modpanel.getcurrentobject() -- unwrapModPKW= modpanel.getcurrentobject() ---当前选择的层级 xPKW = unwrapModPKW .GetWindowX() -- xPKW = unwrapModPKW. GetWindowX () yPKW = unwrapModPKW .GetWindowY() -- yPKW = unwrapModPKW. GetWindowY .. GetWindowH -- 都是 收集uv 编辑器的对话框的。 hPKW = unwrapModPKW .Ge.. 阅读全文

posted @ 2011-10-14 14:15 盖天00 阅读(454) 评论(0) 推荐(0)

max 内置函数,管理uv 编辑器下面的窗口的显示情况
摘要:unwrapModPKW = modpanel.getcurrentobject() --- modpanel.getcurrentobject 是查询当前层级 xPKW = unwrapModPKW.GetWindowX() -- GetWindowX 找到窗口x 坐标 yPKW = unwrapModPKW.GetWindowY() -- GetWindowY 找到窗口y 坐标 hPKW = unwrapModPKW.GetWindowH() -- GetWindowH 找到展uv 窗口 的总高度。---但什么时候这里等于零 就是在我最小环的时候进行,高度就是等于了0 if (hPK... 阅读全文

posted @ 2011-10-14 10:00 盖天00 阅读(10884) 评论(0) 推荐(0)

排列顶点 uv 不过有很大问题
摘要:-- 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 阅读全文

posted @ 2011-10-13 17:37 盖天00 阅读(369) 评论(0) 推荐(0)

对于火焰效果的接触
摘要: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 阅读全文

posted @ 2011-10-13 15:12 盖天00 阅读(192) 评论(0) 推荐(0)

用 脚本编辑器读脚本 也是编辑脚本
摘要:edit "C://Documents and Settings//Administrator//桌面/3.ms" 阅读全文

posted @ 2011-10-13 15:08 盖天00 阅读(212) 评论(0) 推荐(0)

判断贴图大小很好 同时可以判断文件大小
摘要:a=getFileSize "d://a.jpg" --得到的是a.jpg的大小,单位bytesa/1024.0 得到的是多少Ka/1024.0/1024.0 得到的是多少M 阅读全文

posted @ 2011-10-13 15:05 盖天00 阅读(252) 评论(0) 推荐(0)

锁定控制器,一般在绑定的时候很多用到
摘要: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_ 阅读全文

posted @ 2011-10-13 15:03 盖天00 阅读(308) 评论(0) 推荐(0)

两条线中画终点
摘要: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 阅读全文

posted @ 2011-10-13 14:59 盖天00 阅读(215) 评论(0) 推荐(0)

旋转矩阵
摘要: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 阅读全文

posted @ 2011-10-13 14:57 盖天00 阅读(224) 评论(0) 推荐(0)

进行随机旋转用于和并东西并
摘要:--随机树角度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 阅读全文

posted @ 2011-10-13 14:47 盖天00 阅读(196) 评论(0) 推荐(0)

合并方法
摘要: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 阅读全文

posted @ 2011-10-13 14:29 盖天00 阅读(158) 评论(0) 推荐(0)

麻花的移动物体到原点
摘要:--只移动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 阅读全文

posted @ 2011-10-12 16:17 盖天00 阅读(228) 评论(0) 推荐(0)

论坛里 名为麻花写的 是到处物体的东西
摘要:fn HandleMax obj=( --有必要可以优化一下材质 --........ obj_name=obj.name filepath = maxfilepath makeDir (filepath + obj_name)--在当前处理的max路径下建立以对象物体为名的文件夹 --输出这个文件成一个.x文件,并保存为以物体为名的文件夹内。 exportfile (filepath + obj_name + "\\" + obj_name+".x") #noprompt )--------------------------------------- 阅读全文

posted @ 2011-10-12 16:16 盖天00 阅读(284) 评论(0) 推荐(0)

快捷的转字符
摘要: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= " 阅读全文

posted @ 2011-10-10 10:19 盖天00 阅读(160) 评论(0) 推荐(0)

帮 论坛朋友解决的问题。
摘要:思路:/*--根据题意 已知道A B 两点坐标 AB和BC的角度--已知道 AC BC 的距离 求c点坐标--如图--***** 解释******--我们把题 放到max 的顶视图考虑 (就是相当于一个二维坐标系中进行)--通过审题 可以知道C点有两个,分别在线段AB的两边。这个问题我们就看图中 --先考虑其中的一边,并且为了方便我把它放到了第一象限内。---如图做了一些辅助线。---如图如果求C点坐标 其实就是求 OE EC 的长度---进一步推导 要想求出他们的长度 知道知道 OC 的长度 还有角COE 就可以通过三角函数求出来。---1.求角CBD--因为A B 坐标知道 所以就知道了O 阅读全文

posted @ 2011-10-09 15:04 盖天00 阅读(178) 评论(0) 推荐(0)

dotNetClass "System.Windows.Forms.View").
摘要: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 阅读全文

posted @ 2011-10-08 19:46 盖天00 阅读(612) 评论(0) 推荐(0)

时间的表示
摘要: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() 阅读全文

posted @ 2011-10-08 19:40 盖天00 阅读(217) 评论(0) 推荐(0)

收集路径文件。
摘要:(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 阅读全文

posted @ 2011-10-08 19:33 盖天00 阅读(226) 评论(1) 推荐(0)

TabForm.MaximizeBox = false
摘要:(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 阅读全文

posted @ 2011-10-08 19:25 盖天00 阅读(500) 评论(0) 推荐(0)

创建类表
摘要:(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 阅读全文

posted @ 2011-10-08 19:20 盖天00 阅读(187) 评论(0) 推荐(0)

messagebox 这样的操作
摘要:(-- 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 阅读全文

posted @ 2011-10-08 19:08 盖天00 阅读(206) 评论(0) 推荐(0)

zhao
摘要:(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 阅读全文

posted @ 2011-10-08 18:59 盖天00 阅读(295) 评论(0) 推荐(0)

导航