Page 1 of 1

Vern -- can you create a script to scale a bone?

Posted: Fri Jul 18, 2008 9:44 pm
by mkelley
I know, I know, you're very very busy, and I also suspect that if I study your copy bones script I can figure this out *but*...

Is it possible you can create a script just to scale a single bone? Here's the dealio -- I really like your script to copy bones, and it does make complex rigs easy to reuse EXCEPT if they don't fit the structure you're trying to use them with.

Perhaps you draw all your stuff the same way -- that's good, but I don't have that discipline (either that or I'm drawing lots of weird stuff that doesn't fit a typical biped). So I copy the bone rig and I can move or rotate bones around without hurting the structure... but I can't scale a bone.

Using your script I can scale ALL the bones, but most of the time I only need to scale one or two. And, of course, this is disabled in AS (one of my pet peeves about the program). So if I had a script...

Okay, I've asked. If you don't have the time I understand (and I'll see how much time I can spend trying to figure this one out on my own :>)

Posted: Fri Jul 18, 2008 10:01 pm
by heyvern
You can actually "scale" a bone on frame 0 using the bone translate tool, but it doesn't maintain the translation of children bones which is annoying.

I was thinking about this very thing when I added that bone scaling to the copy bones script. Why couldn't it work for bone already in a skeleton and not copied? You can sort of do this with my copy bones script by copying and pasting small portions at a time but it's a pain in the arse.

This should be fairly easy just using my other script as a starting point. Instead of copying just "rescale" the bones.

So you would want this to scale selected bones? That would be the easiest way. Or to scale a bone and all it's children?

-vern

Posted: Fri Jul 18, 2008 10:07 pm
by mkelley
I think scale selected bones -- that would be the most flexible.

Posted: Fri Jul 18, 2008 10:35 pm
by heyvern
Just thinking out loud...

If you select a bone that has children bones, then the first child should change translation to adjust for the scale of the parent.

For example, if you scale a bicep bone, then the forearm bone should "move" so it's position is the same yes?

-vern

Posted: Sat Jul 19, 2008 1:33 am
by mkelley
Yes, translation but not scale -- it should (if possible) align itself at the end in the same manner as the first bone grows or shrinks.

If not possible you could just move it manually (and it it happens unwanted you could move it back the same way).

Posted: Sat Jul 19, 2008 4:24 am
by heyvern
The position of a child bone is based on the distance from the BASE of the parent. So if the position were 0,0 the child bone would be exactly on top of the parent bone. The x translaton of a child bone (like a forearm to a bicep) is usually the same as the length of the parent bone... or close to it.

If the parent bone is scaled down 60% then the FIRST child bone ONLY has to have it's position scaled down 60% as well. That is what I did in the copy bones script.

Only the first child bone must move, the children of that first child bone won't change.

So if you scale a bicep the forearm's position will scale the same amount.

p.s. Just sort of writing this down so it's clear in my head as well as an explanation. ;)

-vern