GroupBoxes

Groups in 3dsmax have always bugged me, they cause headaches for scripting and rigging and I tell all our guys to avoid using them. We generally just link to helpers, so I came up with a simple idea of GroupBoxes so we can link to helpers but also see groups visually.

I’m going to try and get it so the Boxgizmo adjusts size automatically whenever the contents change, but for the moment here’s a quick proof-of-concept. I decided to make the groupbox inherit the parent from one of the members so it slots into the existing hierarchy.

Hopefully I can develop this so it’s a usable alternative to Groups in 3dsmax.

 

Try this little bit of script….

(
    local thewidth = $selection.max.x - $selection.min .x 
    local thelength = $selection.max.y - $selection.min.y 
    local theheight = $selection.max.z - $selection.min.z 

    local oldparent = $selection[1].parent 
    local theGizmo = BoxGizmo width:thewidth length:thelength height:theheight \
        pos:($selection.center - [0,0,(theheight / 2)]) name:(Uniquename "GroupBox_") 

    for o in selection do o.parent = theGizmo theGizmo.parent = oldparent select theGizmo 
)

Follow this post on CGTalk for developments, I’ll post back here when it’s done.

http://forums.cgsociety.org/showthread.php?f=98&t=1064013

About davewortley

Somewhere between an artist and a programmer, I like technical things, but being creative. I love problem solving and coming up with elaborate solutions. This blog is where I shall share ideas, tips, tutorials and anything that amuses me.
This entry was posted in 3dsmax, MaxScript. Bookmark the permalink.

Leave a comment