reparent bone script? (For "IK" feet purposes)

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
capricorn33
Posts: 249
Joined: Sun Oct 02, 2005 9:49 am
Location: Finland
Contact:

reparent bone script? (For "IK" feet purposes)

Post by capricorn33 »

I'm starting to get really bored with the bad bone lock mechanism in AS... As we all know it is only "sort of" functioning, and it's almost impossible to get a foot or hand to stay planted properly.

I have an idea for a script that might help as a sort of workaround for getting a tight lock.
...BUT - you would have to be able to reparent bones in the middle of the animation to get this idea of mine working...

http://www.youtube.com/watch?v=v0jRmpB2oRo

Is that possible? Can you somehow key and reparent bones through scripting?
(don't know any lua myself...)
Last edited by capricorn33 on Sat Mar 26, 2011 10:23 am, edited 2 times in total.
capricorn ( - just call me "cap")
children's tv pro, character animator
User avatar
Víctor Paredes
Site Admin
Posts: 5815
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Post by Víctor Paredes »

Sorry, I can't fully understand your idea.
Anyway, I know bone locking doesn't work as it should, but you can dominate it. Personally I always (absolutely always) work with bone locking in my projects and never have problems.
Image Image Image Image Image Image
Moho co-owner

Previously Rigged animation supervisor: My father's dragon, Wolfwalkers & Star Wars Visions "Screecher's Reach"
My personal Youtube Channel
ponysmasher
Posts: 370
Joined: Thu Aug 05, 2004 2:23 am
Location: Los Angeles
Contact:

Post by ponysmasher »

I've had lots of problems with bone locking myself. Maybe I'm bad at rigging? Usually I animate without bone locking and then add some extra keyframes to put the feet in place.

Recently I tried to not parent the feet at all and just animate them to follow the body when needed. Some extra work but the feet will absolutely stay in place.
User avatar
capricorn33
Posts: 249
Joined: Sun Oct 02, 2005 9:49 am
Location: Finland
Contact:

Post by capricorn33 »

Yes I think this might be a more a rigging problem than a scripting one in the end... I just haven't come up with the really smart way to do it yet......
selgin wrote:Sorry, I can't fully understand your idea.
The idea was simply to somehow disconnect the heel bone from the lower leg's bone at a given frame, when you want the foot to stay planted on the ground, for example. That is why I was wondering if there is any way to alter the bonestructure's dependecies anywhere else than on frame 0 ?
To "reparent" pieces of the bonestructure in an animatable way?

If that is possible you could get that heelbone to STAY DOWN when you want it too, as you can see in my little example video above. The feet stay absolutely flat to the ground, simply because the heel bone isn't parented to the lower leg bone at this point. The lower leg bone, in turn, is kept in place by a lock bone.

Here is a closeup of the effect as the foot is in its planted state. Maybe it will help you to see what I mean.
http://www.youtube.com/watch?v=NMBXFVWRlLE

selgin wrote:Personally I always (absolutely always) work with bone locking in my projects and never have problems.
So just out of curiousity - and I know how well you master AS, Selgin - how do you go ahead if you want to make a convincing rolling footstep from heel contact to heel+football contact to heel+ball+toe and then rolling off again towards the toetip as the foot is leg is lifted? AND with a convincing no-move-at-all-lock while the foot is planted?
I simply can't do it using the normal bone lock system without losing control of the stability of the foot. Not without frame-by-framing it, and it really shouldn't have to get to that...

I studied your technique with the extra bone beyond the toetip - a simple and brilliant idea - and it works quite well but only for one contact point, the toetip. Right....?

ponysmasher wrote:Recently I tried to not parent the feet at all and just animate them to follow the body when needed. Some extra work but the feet will absolutely stay in place.
Yeah, that's another way to do it. I tried a similar approach in this little example here:
http://www.youtube.com/watch?v=yXFY8uqnLrE

This one was made using two different bonestructures for the foot and two (similar) vectorlayers for the foot. As the foot is in the air I use foot nr 1, normally rigged. At the point of full foot contact I switch to foot nr 2, which is disconnected from the leg. This makes it keep absolutely still. (I have to manually move the foot nr 2 into the right position, though.) Then when the heel comes off the ground again I switch back to foot nr 1 and use a locked "tip bone" (Selgin's technique) to keep the tip of the foot in place.


I'm writing this just because I'm simply wondering if we could come up with some kind of rigging technique, maybe with some possible necessary help by scripts to get this thing working once and for all. :-)

A planted foot should stay planted!
capricorn ( - just call me "cap")
children's tv pro, character animator
crsP
Posts: 209
Joined: Thu Apr 15, 2010 2:35 pm

Post by crsP »

Sounds like, with your detached foot setup, that you want to request IK\FX switching and IK\FK matching, as in various 3D apps. Don't request through this forum however, as you need to go through Smith Micro to get bugs and requests seen.
User avatar
capricorn33
Posts: 249
Joined: Sun Oct 02, 2005 9:49 am
Location: Finland
Contact:

Post by capricorn33 »

Well, Crsp, I think you are partially right about me here.

I have been using mostly Maya lately and I have picked up 3D workflows from working in that environment. And for my personal way of doing things I'd like to find some workarounds for a couple of things that feel a little... annoying.
- So that is where you are right.

But please understand that I am not trying to get anyone to convert AS into something else than what it is. I am not reporting this kind of difference in functionality between AS and "various 3D apps" as a bug.
And I'm certainly not expecting anyone here, at the forum, to change anything under the hood of the program.

I am just simply looking for a workaround method here, for guys like me, who come from a 3D environment and would like to integrate some kind of IK/FK switching workflow. I thought that this maybe could be done with some smart rigging ideas maybe in combination with some scripting, if necessary.
That's why I am posting my question here and not complaining to smith micro in first hand. :)

(With all this said, I still find the bone lock mechanism peculiar and hard to control)

Sorry if I have offended anyone.



At this moment I am experimenting more with the lock bone system myself, and I am also checking up everything that has been written on the forum on this topic, just to try to understand what I have been missing out on here, since (almost) everybody else seems to be completely happy with the lock.


ANOTHER QUESTION:

Has anyone adapted Heyvern's aim bone script for AS 6... ? I have problems getting it to work... don't know if it's just me, though...

cheers
capricorn ( - just call me "cap")
children's tv pro, character animator
crsP
Posts: 209
Joined: Thu Apr 15, 2010 2:35 pm

Post by crsP »

Why so defensive? I didn't ask you to report anything as a bug - I was just telling you if you wanted this feature requests that bugs and feature requests need to be sent to smith micro and not this forum.

And what do you think this aim bone script is doing? It's the same as a target constraint in 3d apps, so I don't understand your 'converting As into something else' or whatever.

Understand that you posted that the bone lock is 'sort of functioning'. You have a workaround. I only suggest to make your workaround easier to request a feature.

How do you come to the conclusion that everyone else is happy with bone locking, when you have in this very post, one user who's had no problems, and one who does have problems?
User avatar
capricorn33
Posts: 249
Joined: Sun Oct 02, 2005 9:49 am
Location: Finland
Contact:

Post by capricorn33 »

hey, peace, man. I'm not looking for a fight here...

I think I simply misread the intention of your post, thought you saw me as a total newbie wanting AS to be what it isn't... So I wanted to clarify that I'm not that kind of ...hopeless whiner. I'm trying to be constructive here.
Thanks for the friendly suggestion to do a feature request to smith micro. Maybe I will.

And the "everyone else seems to be happy"-statement comes from the fact that I heard from 3 other powerusers as well, except for Selgin, that they actually don't experience any kind of bigger problems with their workflow using the bone lock as it is. These are guys who have used AS much more than I have, I believe in what they are saying.
So that's the reason why I don't know if I actually will make an official request of it. There are so many other things, bugfix and feature requests, that are actuallly more important, I think...

Oh, I think I know what the aim bone script is supposed to be doing. I was merely thinking that I might use it as a help to me in my idea for my highly personal workaround method for planting feet in AS. I'm trying a rigging idea out and could use some target constraint.
And if I get it working somehow I will also share it here.


Is the aimbone script up to date with AS6? Or if Heyvern's original script isn't - has anyone adapted it?

cheers
capricorn ( - just call me "cap")
children's tv pro, character animator
User avatar
capricorn33
Posts: 249
Joined: Sun Oct 02, 2005 9:49 am
Location: Finland
Contact:

Post by capricorn33 »

Oh yes, and then there was that original question too, which I started this thread with ...BEFORE I got off track a little and started swapping foot rigs... :-)


Do any of you experienced scripters see any possible way to write a "reparent bone" script, allowing you to break (or reassemble) a bone structure in the middle of animation?

I'm interested in it because of my foot rig development ideas - but I think it might be a very useful script for many other purposes as well...


But I don't know - - it might just be one of those completely impossible things, perhaps? Something that the stucture of AS simply won't allow?
Would be glad to get some viewpoints on the matter.

cheers
capricorn ( - just call me "cap")
children's tv pro, character animator
User avatar
capricorn33
Posts: 249
Joined: Sun Oct 02, 2005 9:49 am
Location: Finland
Contact:

Post by capricorn33 »

So I've started to look into lua a little... thinking I might have a go at this IK thing myself. It will take some time to learn, I guess, but that's ok.

I've got HeyVerns "aim bone" script working now. And maybe he already has solved this "IK thinking" problem in some of his many rigs, I don't know, haven't checked them out, and there are *so many* posts on this forum it's hard to know everything that has been said and done, even if you DO searches... :-)

but anyway, here is my own personal investigation in process, using his script.

http://www.youtube.com/watch?v=JWO11Rb_3gw

The idea is to animate the hips and leg bone chain separately from the foot. (Compare to normal standard in hands/feet IK functionality in 3D apps.) It makes for absolute control over the movement of the foot.
But it's of course also a workflow thing; I'd love to be able to work this way in ASP. :-)

The embedded aim bone script makes it all work except for one thing, there is no IK resolve through the leg chain as you translate the anklebone of the foot. It's only affecting the "aimer bone", the shin bone in this case, not the rest of the leg.

So that is the next problem. In one mouseclick and drag I need to translate the foot's ankelbone AND apply IK resolve to the leg bone structure.
- Hehe.... that might take some time for me to figure out how to do, I'm new to lua and the AS script interface after all.

I wonder what might be a smarter way to go about it? Working on the embedded script or mod the manipulate bones tool and write some of heyverns aim target constraint code into it.....?

On second thought, maybe it would actually be better to mod the manipulate bones tool...? then you could have the functionality available all the time, without the need to activate an embedded script. All that would be needed to activate the "IK function" would be to use some naming convention for the two bones where the target aim connection is. As Heyverns script also does right now (aimerbone; [bonename].aim and targetbone; [bonename].trg).

If bones with these kind of names are present in the skeleton the "IK function" goes into effect. In all other cases the manipulate bone would function as normal.

Anyone else who could see use of such a modded tool?


(Are there BTW som etiquette and code for how you use other people's ideas and code here, or is everyone sharing freely?
Sorry if I committed any mistakes in that regard assuming I could use heyvern's script ideas.........)







[renamed the thread subject to better reflect what is discussed here...]
capricorn ( - just call me "cap")
children's tv pro, character animator
Post Reply