Skip to content

Instantly share code, notes, and snippets.

@3dAsmol79
Last active July 2, 2018 15:50
Show Gist options
  • Save 3dAsmol79/8143f0ce7efff9a6ac2363ac1618dadb to your computer and use it in GitHub Desktop.
Save 3dAsmol79/8143f0ce7efff9a6ac2363ac1618dadb to your computer and use it in GitHub Desktop.
MaxScript - Attach Selected - modified from Blur scripts to have centred pivot at base and zoom selected.
(
if selection.count >= 2 then
(
objs = for i in selection collect i
disableSceneRedraw()
try
(
main_obj = objs[1]
convertTo main_obj TriMeshGeometry
progressStart "Make Unique"
escapeEnable = false
itemnum = objs.count
curiter = 0
for i = 2 to itemnum do
(
curiter += 1
m = ((curiter as float)/(itemnum as float))*100
attach main_obj objs[i]
progressUpdate m
)
progressEnd()
)
catch
(
MessageBox "An error has occured, you may want to undo." title:"Attach Selection"
)
enableSceneRedraw()
completeRedraw()
)
$.pivot = [$.center.x,$.center.y,$.min.z] -- Pivot to Base and Centre
actionMan.executeAction 0 "310" -- Zoom Extents Selected
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment