ScriptSpot

Forum topic · Scripts Wanted

Auto Hierarchy - Control Objects

By AndreShaw · 2011-03-29

Description

In the max file attached I have provided 2 bone chains. The one labeled "What I Want" is what I would like my script to do once I run it. The other bone chain is for you to run the script on. So far my script will create a point helper at the exact pivot of each object you have selected, but not link them, as in the example "What I want". The end result being, a point helper created at each bones pivot, and linking them through the hierarchy in correlation to the hierarchy of the bone chain.


function createPoint =
(

for Cntrl =1 to selection.count do
(
Cntrl = selection[Cntrl]
Control_IK=point wirecolor: red
Control_IK.size = Cntrl.width*5
Control_IK.cross = true
Control_IK.transform = Cntrl.transform
)
)

createPoint()

Attachments
Comments (2)

JokerMartini · 2011-03-29

Nice Garp, that works out well. I actually never used the showLinks property. I always forget about that being in max.

Great stuff.

Something like this:

Garp · 2011-03-29

Select the root of your hierarchy and run this:


fn setCtrlPts theObj thePt:undefined =
(
  local pt = point transform:theObj.transform \
             name:("ctrl_" + theObj.name) \
             wireColor:green \
             showLinks:true
  pt.parent = thePt
  for obj in theObj.children do
    setCtrlPts obj thePt:pt
)

setCtrlPts selection[1]

Customize the points to your needs :D