SmartScripts Attach/Detach

1 vote
Version: 
.1b
Date Updated: 
12/05/2015
Author Name: 
Lande3D

I am releasing these two small macroscripts i wrote to simplify my own workflow in 3dsmax.

they are inspired by the universal attach/detach macros made by Nik and feature much of the same functionality in addition to some extra ones. but code-wise they are complete rewrites.

SmartAttach MacroScript:
With single object selected does this:
-Disable any Turbosmooth/MeshSmooth/OpenSubDiv modifier(s) that are on top of the topmost "Edit modifier"
-Start attach mode
Works for: EditPoly, EditablePoly, Editable spline/line/EditSpline,Edit/EditableMesh, NURBSCurves,(Unwrap_UVW stitches verts))

With more than one object selected does this:
-Remove any Turbosmooth/MeshSmooth/OpenSubDiv modifier(s) that are on top of each of the objects topmost "Edit modifier"
-collapses and Attaches all Poly/mesh Objects together to the last selected Poly/mesh object
-collapses and Combines/Attaches all Splines together to the last selected Spline object
-All this works in one loop, so you can select a bunch of both splines and mesh/poly objects and the script will attach them together to 2 objects. if any objects are not compatible(like cameras/lights etc. they will be left out)
Works for: Any(not tested on Nurbs/Patch)
(uses a linear attach method with some optimizations)
Pro tip: if you want to attach to a specific object then select all the objects you want to attach then unselect and reselect the "attach to" object(if you are attaching both splines and mesh/polys at the same time then optionally deselect both the spline and the mesh/poly you want to be attached to and reselect those,it doesnt matter in which order)

SmartDetach MacroScript
With more than one object selected:
-opens the clone dialog
in subobject mode does this:
-Vertex/SplineKnot/Unwrap_UVW: break vertex/knot/Uv selection
-Edge/Border: Start create shape from selection dialog and select it if it was created
-Face/Element/Segment/Spline: Start detach dialog and if detached to a new object select it

Installation instruction:
Exit 3dsmax. unpack the zip file and copy the folders contained inside to the root of the 3dsmax program folder(usually "C:\Program Files\Autodesk\3ds Max 2016" etc.) Restart 3dsmax
The macros will appear under the catagory "SmartScripts". Assign them to hotkeys and/or toolbar buttons

Written for and tested in 3dsmax 2016 sp1 and sp2 but should work for previous versions too(down to 2012?)

Version Requirement: 
3dsmax 2012
AttachmentSize
smartattachdetach.zip11.36 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Lande3D's picture

SmartDetach: RE

Hi.
Sorry for the late responce.
The GetModifierKey function is part of the ApiEx(release).ms file that should be located in your *3dsmaxfolderpath*/stdplugs/stdscripts folder, after copying the contents of the zip file to the 3dsmax folder.
If it is there then maybe i forgot a struct reference somewhere.
Ill look into it asap if thats the case. Im sorry for the a bit unintuitive installation process.
I will probably package the next update as an mzp archive for easier installation.

omle's picture

SmartDetach

Hi!

I was trying to use your script but it gives to me error log: "GetModifierKey" in undefined. I am using 3dsMax Design 2015. Can you help?

dig it

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.