HeyVern's scripts and tools - (focus on bones)

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

Moderators: Fahim, Distinct Sun, Víctor Paredes, erey, Belgarath, slowtiger

User avatar
heyvern
Posts: 6964
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern » Tue Sep 04, 2007 3:45 pm

Well I made some improvements. You can get it here:

http://www.lowrestv.com/moho_stuff/scripts/aim_arm2.zip

Or on the main page of this thread.

I forgot to add text for which bones to move. Just the two small bones at the hand and elbow should be translated. The "root" bone can also be translated and rotated.

Selgin, I fixed the "undo" problem.

I also added scale limits but... the arm sample included shows the limitation of this set up. If you move the elbow target bone too far it will "disconnect" from the forearm.

If only I could parent the forearm to the bicep aimer it would work great... but I have to do some major rewriting to figure that one out. It is totally wacky and I don't know what to do about it.

NOTE:
You can't parent an aimer bone to another aimer bone. You can parent an aimer bone to ANOTHER target bone but not its OWN target bone.

This is true for both versions of the script.

-vern
User avatar
Víctor Paredes
Posts: 4864
Joined: Wed Jan 26, 2005 12:18 am
Location: Ireland/Chile
Contact:

Post by Víctor Paredes » Tue Sep 04, 2007 3:58 pm

oh, thanks vern.
it's good to now the parent limitations. thank you for the fast answer and the fast improve. it's fantastic (and what you are doing here is fantastic too).

i have tried and works pretty well. and the large limit is excellent.

thank you!
User avatar
Víctor Paredes
Posts: 4864
Joined: Wed Jan 26, 2005 12:18 am
Location: Ireland/Chile
Contact:

Post by Víctor Paredes » Tue Sep 04, 2007 7:17 pm

here is a little test using your script. it opens a lot of possibilities.
http://tazatriste.cl/cosas_subidas/3/mo ... %20aim.rar :D
User avatar
heyvern
Posts: 6964
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern » Tue Sep 04, 2007 11:09 pm

Sorry selgin, but I have always had trouble with .rar files.

Is there anyway of using zip or something else?


-vern
User avatar
heyvern
Posts: 6964
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern » Sat Sep 08, 2007 10:42 am

Woohooo!

I'm digging my new script:

http://www.lowrestv.com/moho_stuff/scri ... m_test.mov
http://www.lowrestv.com/moho_stuff/scri ... _test.anme

Make sure you put this anme file in the same folder with the script.

These are sort of "Larry Legs" for testing purposes.

I didn't indicate which bones to translate or clean up the keyframes in the AS file... there are only 4 for each leg. I will try to post a better version when I can.

Anyway, the rig still needs tweaking. I'm sort of experimenting with how to organize the bones for the easiest animation. This version is not so good because the foot is independent of the leg.

Even so, I can easily do a body turn!!!
User avatar
Víctor Paredes
Posts: 4864
Joined: Wed Jan 26, 2005 12:18 am
Location: Ireland/Chile
Contact:

Post by Víctor Paredes » Sat Sep 08, 2007 3:21 pm

heyvern wrote:Sorry selgin, but I have always had trouble with .rar files.
Is there anyway of using zip or something else?
sorry, i hadn't seen your post. don't worry, i will prepare another test (which i have upload was not good, and the bones were organized wrong)



and your larry's legs are great. this script is fantastic. i will use it for all my characters from now on.

thank you again.
User avatar
Víctor Paredes
Posts: 4864
Joined: Wed Jan 26, 2005 12:18 am
Location: Ireland/Chile
Contact:

Post by Víctor Paredes » Sat Sep 08, 2007 4:43 pm

heyvern, sorry if my question is outside place, but i was thinking... it's possible that the aimer be a tool?
i don't know anything about script, but i see that fazek's translate points tool can move a bone in an absolutely independent way.
could be that a tool would move the bones as your script, but with no need of create more bones than necessary?

sorry again if not, i'm talking from my ignorance.
User avatar
heyvern
Posts: 6964
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern » Sat Sep 08, 2007 8:43 pm

I think this could be a tool script, however it would have to use scale not bone length.

Bone length for some reason I can't fathom is not an animated property. I wish it were. Only scale can be animated and it only scales the length of the bone not the width as bone length does.

I am using some of the code that is used in the bone translation tool and converting it to a scale and rotation values.

I will have to play around with the code to see how it work as a tool. I still get some "odd" behavior if I use incorrect bone parenting.

WARNING! I found another bug in my script which should be easy to fix. At the moment it can only be used in ONE bone layer per file. This MUST be fixed. I need to use it in the body bone layer as well as the head bone layer.

The reason it isn't working is because of "global variables" storing the list of bones. The first scripted layer loaded in the file "over rides" the global variable of the second one.

-vern
User avatar
heyvern
Posts: 6964
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern » Mon Sep 10, 2007 12:09 am

Yeehaaa!

It just keeps getting better! I'm loving this.

I redid the leg file. It is in the main download on the first post of this thread. I've updated that post to indicate some of the changes. you can get to it here as well:

http://www.lowrestv.com/moho_stuff/scripts/aim_bone.zip

Here is a sample animation using the new leg rig:

http://www.lowrestv.com/moho_stuff/scri ... m_rig1.mov

You will see in the sample file that I have a bunch of "markers", bone labels and stuff. I created one of those control rigs I like so much. The lines indicate bone length since the joints "disconnect". I need to see how far those bones move so I maintain limb length somewhat.

You can move the rig out of the way by dragging the bones for the "control rig" label and the "left" and "right" labels. I had to do this because those bones go over top of each other and are hard to select. I suggest turning off construction curves in the display when animating.

This is a great rig for doing walk cycles!!! I love it!

I still have some ideas for making it better. I would like to have the foot/toe joint mover to work a little better but for now it is pretty good.

-vern
User avatar
heyvern
Posts: 6964
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern » Mon Sep 10, 2007 1:08 am

Woohoo!

I can turn and do 3/4 walk cycles with the same rig!!

http://www.lowrestv.com/moho_stuff/scri ... n_walk.mov


-vern
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete » Mon Sep 10, 2007 5:53 am

You will see in the sample file...
The posted link to the zip file doesn't have a sample file, only aim_bone.lua file...
-G
(What's a pity as well as the walk cycle looks so good...)
User avatar
heyvern
Posts: 6964
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern » Mon Sep 10, 2007 7:42 am

I re-uploaded the zip... although I am pretty sure I uploaded the new one previously. I wonder if possibly your browser is using the "cached" file? It probably shouldn't.

Anyway if you could check to see if the link is correct now I would appreciate it.

If it isn't here is a direct link to the anme file:

http://www.lowrestv.com/moho_stuff/scri ... _rig1.anme

Sorry but this one doesn't have the turn and 3/4 walk segment. I'm still working on that one. I've added arms. I will post that one as soon as it's ready. I had to redo a bit of it after changing the bone hierarchy to account for the upper torso.

This rig is really fun. Not nearly as complex as ones I've tried in the past.

-vern
User avatar
heyvern
Posts: 6964
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern » Mon Sep 10, 2007 10:28 am

Here's my latest version with arms!!!

This rig... is... what I've been searching for. I apologize if the bones seem to be a complex mess... I have to organize the control bones better. You can see why I have to put in control bones. There are no controls for the arms, I animated them directly. It gets a bit tricky when they pass over each other but this bone complexity is what I'm use to from my 3D software experience. I can animate very quickly with this rig. I can achieve virtually any body position.

http://www.lowrestv.com/moho_stuff/scripts/aim_rig2.mov
http://www.lowrestv.com/moho_stuff/scri ... _rig2.anme

The best part is that I've already put the code for the aimer script into the "flipper" script I am already using for all the layer flipping and other stuff. Everything is coming together.

Next up is the body.

-vern
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete » Mon Sep 10, 2007 6:28 pm

Quite cool!!!
the link of the zip file was not a cache problem (I verified the date of creation of the file). The latests links works perfectly.

I wonder how would you give asymmetry (decoration) to the legs and arms and how are you going to link them with a turning body...
Watching you progresses...
-G
User avatar
heyvern
Posts: 6964
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern » Mon Sep 10, 2007 8:46 pm

Genete wrote:I wonder how would you give asymmetry (decoration) to the legs and arms and how are you going to link them with a turning body...
Watching you progresses...
-G
Before I created this new script I had a system worked out with "sliding" shapes over the legs for the stripes using masking. The stripes shapes over the legs would "float" over the white area of the legs and would "slide" to the other side as the legs turn.

The leg shapes with the "spiky" fur is symmetrical, the spikes of hair or fur will be the same on each side just change direction using bones to simulate the turn.

The stripes on top will be masked and shift across. the feet will be tricky since the bottom of the foot becomes the top of the foot on either side of the turn... but I think if I keep the design very simplistic it should work.

I think the body shouldn't be too hard. Once again that area is symmetrical in design. It is the same on either side. Just a matter of moving bones to reshape it as it turns. I already had a system for this started with my Secret Agent character. I can apply the same concept to the body of this rig.

Because this rig is so simple to animate with I am not doing as much "automatic" motion. I am distorting the shapes by dragging the bones. It is almost like "point" motion animation but using bones to move larger areas of points consistently and easily.

For instance on the sort of 3/4 walk towards the camera on that last animation I had to use my own knowledge of perspective to move the bones and make the legs look correct. It wasn't automatic. This works quite well.

I won't be using a single control bone to rotate the whole body.

-vern
Post Reply