Scripting bones objects

Hello Everyone,
I have a question for any and all Max scripters out there.
How do you get a Max Bone object to draw between two point helpers?
It'd be a really useful trick for scripting a rigg, to which I havent found the solution as yet.
Thanks and any suggestions would be most welcome.

Foreshore

Comments

Comment viewing options

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

Ok so the bones scripting is

Ok so the bones scripting is going quite well now....
However, I'm haveing a problem with adding the Hi_IK chain, in script.

Can anyone offer any help??!

This is what I think works:
ikChain startJoint endJoint solver

its clear I can use the $bone.name for startjoint and endjoint.

But i'm not sure whats needed for "ikchain" or "solver"

So far try as I might, I cant get it to create the chain for the linked bones.

W DIGITAL's picture

can you share your script

can you share your script for adding a bonechain between two helpers?
how many bones does it create?
can you adjust the numbers?

Foreshore's picture

Wonderful! This works quite

Wonderful! This works quite well, for multiple bones.
(With three point helpers on the screen.)

startPos = $point01.pos
endPos = $point02.pos
thirdPos = $point03.pos
BoneSys.createBone startPos endPos [0,0,1]
BoneSys.createBone startPos thirdPos [0,0,1]

I guess my next work-flow question should be! How do I "using expressions and functions" automate the sequential count and draw for three point helpers on the Arm, Leg and Spine bones?

Foreshore's picture

Well it would seem I have to

Well it would seem I have to come clean, I'm not the strongest of scripters. "There that said, it's out in the open."
I did get the positions as recommended for the helpers, but then after which nothing.

$helper01.pos

I TRIED.
--------------
BoneSys.createBone
startPos [-154.822,-4.0605e-006,92.8934]
endPos [-154.822,-4.0605e-006,92.8934]
[30,10,0] Zaxis

-------------------*****************------------------------
Once I clear up the bone creation syntax.
The other considerations here would be, using a function to recognize points and draw bones following a simple naming convention e.g.

LEFT LEG 1 2 3
RIGHT ARM 1 2 3

That all seems clear enough.

Having looked at auto rigger scripts, the other need would be adding controllers. Which you can place using the points again.

I haven’t scripted a rig before, but I’m guessing it would be much more fun to do so, than to go the quad menu route. That can get so repetitive. Also using both methods crystallizes your understanding of what you are doing.

I'm sure I looked carefully through Max 4 and 5 help files and found no Bonesys creation there.

decapitator's picture

From MaxScript

From MaxScript Manual:
<node>BoneSys.createBone <point3>startPos <point3>endPos <point3>zAxis

-

Just get the position of the helpers and your done becouse that seems to work just fine.

Comment viewing options

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