sailorsd
07-24-2008, 03:18 AM
Hi All,
I'm very new to 3ds Max and Maxscript and have been trying to tackle some scripting. I have been working on a UI Toolbar Button that once you've selected the tops (roofs) of a polygon (building), it will detach that selection and rename it the same as the original polygon, but with "R_" as a prefix. The MacroScript is below.
There is a slight delay with this script and I was wondering what techniques could be applied to optomize the script. Thanks in advance.
macroScript Detach_Name category:"CH"
(
s = getCurrentSelection()
b = for obj in s collect obj.name
$.modifiers[#Edit_Poly].ButtonOp #DetachFace
select $obj*
for obj in $ do obj.name = "R_"+b[1]
)
I'm very new to 3ds Max and Maxscript and have been trying to tackle some scripting. I have been working on a UI Toolbar Button that once you've selected the tops (roofs) of a polygon (building), it will detach that selection and rename it the same as the original polygon, but with "R_" as a prefix. The MacroScript is below.
There is a slight delay with this script and I was wondering what techniques could be applied to optomize the script. Thanks in advance.
macroScript Detach_Name category:"CH"
(
s = getCurrentSelection()
b = for obj in s collect obj.name
$.modifiers[#Edit_Poly].ButtonOp #DetachFace
select $obj*
for obj in $ do obj.name = "R_"+b[1]
)
