So im new to maxscript (grand total of 3days :poly124:) and i decided to throw myself in the deep end by making an autorigger. So far its been pretty simple, used some functions to make a dummy rig that can be adjusted and add bones that align to them etc. but now i want to make twist links. So what i want to be able to do is take the position of two point helpers (eg elbow and wrist, i also make the elbow lookat the wrist so the relationship between bones is easier to see)) get the distance and be able to set the number of bones it places between them 2 points through i spinner, which i have failed at so far..
i have a hacky way to do it (just make 2 point helps called testdummy_01 and testdummy_02)
fn makebone1 pos1 pos2 bname=(
local newbone
newbone= bonesys.createbone pos1 pos2 (pos2 - pos1)
newbone.name = bname
return newbone
)
rollout test "test" width:238 height:114
(
button makebonetest "makebone" pos:[34,20] width:135 height:46
on makebonetest pressed do
(
makebone1 $testdummy_01.pos (($testdummy_02.pos+$testdummy_01.pos)/2) "testbone"
$testbone.transform=$testdummy_01.transform
makebone1 (($testdummy_02.pos+$testdummy_01.pos)/2) $testdummy_02.pos "testbone2"
$testbone2.parent=$testbone
)
)
createdialog test
problem with this method is i have there is no exposed control for the number of bones which i want(use a spiner to select number of bones). i know id probs have to use an array for this, but so far i haven't got anywhere
Replies
Comments in the code below: