Home Technical Talk

3dmax script help

davidmajdi
polycounter lvl 2
Offline / Send Message
davidmajdi polycounter lvl 2
hi, in 3dsmax when i want to clone face from object to use it for modeling i should hold shift key and drag the face and select fromm dialog box as object or element . its sometimes usefull but i usualy after draging the face use it as new object then snap it  to original position. can we make a hotkey to just copy our selected face to new object . i see this in maya (ofcourse it works on the script) . tnx so much for your help

Replies

  • PolyHertz
    Options
    Offline / Send Message
    PolyHertz polycount lvl 666
    You mean something like this?

    macroScript copyFaces2newObject<br>category: "PolyhertzScripts"<br>(<br>setCommandPanelTaskMode #modify<br>modClass = classOf (modPanel.getCurrentObject())<br>modFullName = modpanel.getCurrentObject()<br><br>if (modClass == Editable_Poly) then (<br>&nbsp;&nbsp;&nbsp; newName = ""<br>&nbsp;&nbsp;&nbsp; loop = 0<br>&nbsp;&nbsp;&nbsp; while loop <= 999 do (<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; loop += 1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; possibleName = "newMesh_" + (loop as string)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nameIsGood = execute ("$" + possibleName)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (nameIsGood == undefined) do (newName = possibleName ; exit)<br>&nbsp;&nbsp;&nbsp; )<br>&nbsp;&nbsp;&nbsp; polyOp.detachFaces $ (polyOp.getFaceSelection $) delete:false asNode:true name:newName<br>&nbsp;&nbsp;&nbsp; select (execute("$" + newName))<br>&nbsp;&nbsp;&nbsp; subobjectLevel = 4<br>)<br>else if (modClass == Edit_Poly) do (<br>&nbsp;&nbsp;&nbsp; newName = ""<br>&nbsp;&nbsp;&nbsp; loop = 0<br>&nbsp;&nbsp;&nbsp; while loop <= 999 do (<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; loop += 1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; possibleName = "newMesh_" + (loop as string)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nameIsGood = execute ("$" + possibleName)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (nameIsGood == undefined) do (newName = possibleName ; exit)<br>&nbsp;&nbsp;&nbsp; )<br>&nbsp;&nbsp;&nbsp; modFullName.ButtonOp #CloneFace<br>&nbsp;&nbsp;&nbsp; modFullName.DetachToObject newName<br>&nbsp;&nbsp;&nbsp; select (execute("$" + newName))<br>&nbsp;&nbsp;&nbsp; subobjectLevel = 4<br>)<br>)<br>
    Also, please name your thread titles more descriptively. Its not good to have multiple threads with the same name.

  • davidmajdi
    Options
    Offline / Send Message
    davidmajdi polycounter lvl 2
    PolyHertz said:
    You mean something like this?

    macroScript copyFaces2newObject<br>category: "PolyhertzScripts"<br>(<br>setCommandPanelTaskMode #modify<br>modClass = classOf (modPanel.getCurrentObject())<br>modFullName = modpanel.getCurrentObject()<br><br>if (modClass == Editable_Poly) then (<br>&nbsp;&nbsp;&nbsp; newName = ""<br>&nbsp;&nbsp;&nbsp; loop = 0<br>&nbsp;&nbsp;&nbsp; while loop <= 999 do (<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; loop += 1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; possibleName = "newMesh_" + (loop as string)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nameIsGood = execute ("$" + possibleName)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (nameIsGood == undefined) do (newName = possibleName ; exit)<br>&nbsp;&nbsp;&nbsp; )<br>&nbsp;&nbsp;&nbsp; polyOp.detachFaces $ (polyOp.getFaceSelection $) delete:false asNode:true name:newName<br>&nbsp;&nbsp;&nbsp; select (execute("$" + newName))<br>&nbsp;&nbsp;&nbsp; subobjectLevel = 4<br>)<br>else if (modClass == Edit_Poly) do (<br>&nbsp;&nbsp;&nbsp; newName = ""<br>&nbsp;&nbsp;&nbsp; loop = 0<br>&nbsp;&nbsp;&nbsp; while loop <= 999 do (<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; loop += 1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; possibleName = "newMesh_" + (loop as string)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nameIsGood = execute ("$" + possibleName)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (nameIsGood == undefined) do (newName = possibleName ; exit)<br>&nbsp;&nbsp;&nbsp; )<br>&nbsp;&nbsp;&nbsp; modFullName.ButtonOp #CloneFace<br>&nbsp;&nbsp;&nbsp; modFullName.DetachToObject newName<br>&nbsp;&nbsp;&nbsp; select (execute("$" + newName))<br>&nbsp;&nbsp;&nbsp; subobjectLevel = 4<br>)<br>)<br>
    Also, please name your thread titles more descriptively. Its not good to have multiple threads with the same name.

    hi,excuse me for naming ,it works properly ,exactly what i want, so much tnx 
Sign In or Register to comment.