Genete! Bone "points" at another bone

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

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
Víctor Paredes
Site Admin
Posts: 5664
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Post by Víctor Paredes »

Genete wrote:Aaaarggh! Again the zip file is empty! :(
It is only me or the file itself...?
-G
seems to be it's only you... :roll:
anyway, here is the file
http://tazatriste.cl/cosas_subidas/3/mo ... _arm2.anme
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

Thanks selgin... It is weirs because the second link to the aim_bone.lua worked and the first time don't...
-G
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

I think it has to do with the program I am using. I am on a mac and I use "Zipit".

It has always worked in the past but suddenly I am have trouble. I will try to zip files on the PC from now on.

-vern
muuvist
Posts: 54
Joined: Tue Dec 05, 2006 9:24 pm
Location: Australia

Post by muuvist »

Great work Vern, hope you can work out the problems you are having. I played with your example arm and it works very well, thanks for putting in the effort.
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

The script is pretty cool Vern!
It looks like a rubber arm!!
It could be even more cool if there were some way to maintain the maximum length of the aim bone inside a top limit...
It would include a limit into the target bone translation... Mmmm I have to understand fist your script and then we will discuss.

Anyway it is COOL! 8)
-G
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

I am working on the scale limit.

The problem I ran into is that if I limit the scale the whole thing "breaks". I think I have a solution for it though.

EDIT:

Actually I fixed that part. The other problem now is translating the forearm "aimer" bone. If it stops scaling when it reaches "1" it still moves the bone which pulls the bone away and that's no good either.

And the aimer bone still should move so the bone can rotate even when it isn't scaling. It needs some kind of translation limit... which might be tricky.

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

Post by heyvern »

Dagnabit!

I think using constraints with the aimer bones is out of the question.

For instance:

I want to use a single "fan bone" at the elbow. It is a child of the bicep and has a 50% angle constraint to the forearm aimer bone.

If I adjust the bones of that arm rig so the whole arm is still straight but is rotated at an angle, the forearm aimer bone has a different rotation value from its original position. Dragging either the forearm parent of target alters the angle which is used in the constraint.

Technically it doesn't "appear" rotated because it is "straight" in alignment with the bicep, but in reality the angle is different so any constraint is effected. I get "extra" rotation of any constrained bones.

Normally a fan bone works because the target is a bone that is a child of the fan parent. This child bone target doesn't change rotation because it rotates with the parent. If the parent is at 45 degrees the child is 0 degrees.

In this rig the target of the constraint is not constrained to the same bone so it does rotate.

I don't see any possible way to alter this behavior. Constraints are built in to AS and it is working correctly. The best I could do would be to create my own "custom" fan bones for aimer bones in the code itself. Kind of a pain but not out of the question.

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

Post by Genete »

heyvern wrote:I am working on the scale limit.

The problem I ran into is that if I limit the scale the whole thing "breaks". I think I have a solution for it though.

EDIT:

Actually I fixed that part. The other problem now is translating the forearm "aimer" bone. If it stops scaling when it reaches "1" it still moves the bone which pulls the bone away and that's no good either.

And the aimer bone still should move so the bone can rotate even when it isn't scaling. It needs some kind of translation limit... which might be tricky.

-vern
What about this?

Create a 3D skeleton using .pt bones and masterX. masterY and .mX .mY bones (using 3Dgrid and my auto3Drig script. THEN attach a .trg bone to every .pt bone and link them using .aim bones. Then the aim. bone would connect the joints of the limbs of the 3D skeleton and always would maintain theright combination of size and angle...

-G
Post Reply