USAGE
- Position the working pivot
- optionally select some of the verts (if none selected, will select all)
- optionally set strength to a value like 0.4
- run script
-- MixeScript snippet: SplayNormals -- Splays selected normals away from the working pivot --USAGE -- Position the working pivot -- select some or all of the verts (if none selected, will select all) -- optionally set strength to a value like 0.4 -- run script --SETTINGS Strength = 1.0 -- when set to 1.0, entirely replaces existing normal direction. at 0.0, does not adjust normal at all. max modify mode obj = $ modPanel.setCurrentObject obj enMods = (for m in obj.modifiers where classof m == editnormals collect m) enMod = enMods[1] subobjectLevel = 1 --verts vertarray = #{} vertarray = polyop.getVertSelection obj if vertarray.numberSet == 0 then -- no selection, select all ( polyop.setVertSelection obj #all vertarray = polyop.getVertSelection obj ) if enMod == undefined then ( enMod = editnormals() modPanel.addModToSelection (enMod) ui:on ) WPTM = WorkingPivot.getTM() splayfrom = (WPTM[4]) modPanel.setCurrentObject obj normarray = enMod.GetSelection() --enMod.MakeExplicit () objpos = obj.pos modPanel.setCurrentObject enMod for vert in vertarray do ( vertpos = (enMod.GetVertex vert node:obj) + objpos newnormangle = normalize (vertpos - splayfrom) tempbitarray = #{vert} norms = #{} enMod.ConvertVertexSelection tempbitarray norms enMod.MakeExplicit selection:norms for norm in norms do ( existingnormangle = normalize (enMod.GetNormal (norm)) finalangle = normalize ( newnormangle * Strength + existingnormangle * (1 - Strength)) enMod.SetNormal norm finalangle ) )
Could you further explain what this would be used for Mike.
ReplyDeletehey, sorry man, was away today. take a look at this page and it should all become a bit more obvious heh...
ReplyDeletehttp://wiki.polycount.net/VertexNormal
can you tell me how to get data from serial or usb port with maxscript?
ReplyDeletei have a avr micro controller and it sends data through a USB serial port and i want to get data in maxscript for my collage project.
please tell me how.
do you know how to use sdk in visual studio?
Pretty great script! Would there be any way to extend its potential to non Editable Poly objects? I'm oh so fishy on how to do that kinds of stuff (say a primite with a Turn To Poly modifier or so on top - or more complicated things)..
ReplyDeleteI used this to clean up some fur cards normals today and I can't thank you enough. Really saved me a lot of trouble. I also use your "fixer" script pretty much daily.
ReplyDelete