--********************************************************************************************************************* -- Author : Kostadin Kotev -- miau_u@yahoo.com -- Created: 23-03-2011 -- Last Updated: 09-07-2011 -- Version: 1.01 -- Required: 3ds max 9 and up -- Discription: -- In Vertex subobject level: -- if 0 vertex is selected will turn on the Cut tool -- if 1 vertex is selected will turn on the Targed Weld -- if 2 or more vertices are selected will connect them -- In Edge subobject level -- if 0 edge is selected will turn on Create edge tool (create edge from vert to vert) -- if 1 edge is selected will insert vertex in the middle of the edge and turn on the Vertex subobject level -- if 2 or more edges is selected: if bridge operation is possible will bridge edges, otherwise will start miauu's Edge Cutter script -- In Border subobject level -- will Cap border -- In Polygon subobject level -- if 0 polygons is selected will start the Create tool -- if 1 or more polygon are selected will extrude them -- Feel free to change the default commands with supplied ones(the comment lines), but remember that in any subobject level -- in any count of selected verts/edges/faces only one command can be valid(uncomment). Any others must be commented or deleted. -- Usage: Assign a hotkey and start use it. -- To Do: -- add an Edit_Poly modifier support --********************************************************************************************************************* -- MODIFY THIS AT YOUR OWN RISK macroScript HotKey_Magic category:"miauu" internalCategory:"miauu" Tooltip:"Magic HotKey" ButtonText:"Magic HotKey" ( if (selection.count == 1 and classOf selection[1].baseobject == Editable_Poly) then ( local curObj = $.baseobject case subobjectlevel of ( 1: -- Vertex subobject level ( local vertSel = (polyop.getVertSelection curObj) as array case vertSel.count of ( 0: -- no selected vertices - Start Cut tool ( macros.run "Editable Polygon Object" "EPoly_Cut" ) 1: -- if only one vertex is selected - Start Targed Weld ( macros.run "Editable Polygon Object" "EPoly_TargetWeld" -- to change what the script do when one vertex is selected comment line above -- and uncomment the desired operation -- macros.run "Editable Polygon Object" "EPoly_Break" -- macros.run "Editable Polygon Object" "EPoly_Chamfer" -- macros.run "Editable Polygon Object" "EPoly_Extrude" -- macros.run "Editable Polygon Object" "EPoly_Remove" ) default: -- if two or more vertices are selected - Connect them ( $.EditablePoly.ConnectVertices () -- macros.run "Editable Polygon Object" "EPoly_Collapse" ) ) ) 2: -- Edge subobject level ( local edgeSel = (polyop.getEdgeSelection curObj)as array case edgeSel.count of ( 0: -- no edges selected - create Edge from vert to vert ( macros.run "Editable Polygon Object" "EPoly_Create" ) 1: -- one edge selected - divide edge ( $.EditablePoly.divideEdge edgeSel[1] 0.5 select:on subobjectLevel = 1 ) default: -- if two or more edges are selected - bridge or connect edges ( $.bridgeSelected = 1 -- will bridge only selected edges $.bridgeSegments = 1 -- change the value will change the number of Bridge Segments if ($.EditablePoly.Bridge () == false) do ( -- start miauu's Edge Cutter script createdialog miauuEdgeCutter width:402 height:104 style:#(#style_sysmenu, #style_titlebar) -- if Bridge operation can not be done - connect edges -- $.connectEdgeSegments = 1 -- change the value will chagne the default Connect Edge Segments value -- $.EditablePoly.ConnectEdges () ) -- to change what the script do when 2 or more edges are selected comment all 7 lines above -- (from $.bridgeSelected = 1 to ")" ) and uncomment the desired operation -- macros.run "Editable Polygon Object" "EPoly_Remove" -- remove selected edge/edges(and shared verts) -- macros.run "Editable Polygon Object" "EPoly_InsertVertex" -- macros.run "Editable Polygon Object" "EPoly_Extrude" -- macros.run "Editable Polygon Object" "EPoly_Chamfer" -- macros.run "Editable Polygon Object" "EPoly_Split" -- macros.run "Editable Polygon Object" "EPoly_ShapeFromEdges" -- macros.run "Editable Polygon Object" "EPoly_Collapse" ) ) ) 3: -- Border subobject level ( -- Cap macros.run "Editable Polygon Object" "EPoly_Cap" -- macros.run "Editable Polygon Object" "EPoly_Collapse" ) 4: -- Polygon subobject level ( local faceSel = (polyop.getFaceSelection $) as array case faceSel.count of ( 0: -- no face selected - start creating polygons ( macros.run "Editable Polygon Object" "EPoly_Create" ) default: -- one or more faces selected - extrude them ( macros.run "Editable Polygon Object" "EPoly_Extrude" -- to change Extrude command with Bevel, Outline, Inset or Flip -- uncomment desired command and comment "Extrude" command -- macros.run "Editable Polygon Object" "EPoly_Bevel" -- macros.run "Editable Polygon Object" "EPoly_Outline" -- macros.run "Editable Polygon Object" "EPoly_Inset" -- macros.run "Editable Polygon Object" "EPoly_Flip" -- macros.run "Editable Polygon Object" "EPoly_Detach" -- macros.run "Editable Polygon Object" "EPoly_Collapse" ) ) ) ) ) else messagebox "Select an Editable Poly object!" title:"Magic HotKey Error!" )