Bone has an fPos does layer have something similar?

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
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Bone has an fPos does layer have something similar?

Post by heyvern »

Does a layer have a translation property similar to a bones fPos property?

fPos is the location of the bone even if there is no key frame. You can set this property without adding a key.

Is there anyway to do this with a layer?

Layer has fTranslation which is an animated property. To change a layers fTranslation you must add a key.

Could it be done using the layers transformation matrix or something?

If anyone knows if it is possible to somehow change a layers translation without adding a key frame I would be thrilled...

... if not... I will add it to my list of feature requests. ;)

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

Post by heyvern »

Yeeeeeeehaaaaaaa!!!!

Okay kids pay attention...

I was desperate to find a way to switch a layer's z depth using a bone's location. Rasheed wrote that flipbybones script that worked... sort of... but it had big problems for my use since it wouldn't place key frames correctly and conflicted with other scripts.

I finally figured it out! Wooohooo! I can change the z depth of a layer ON FRAME 0 from any other frame of the animation!!!

Changing a layer's translation on frame 0 will update throughout the animation without using keys. It can be done "on the fly" based on the location of a bone.

I plan to use this for my face rig but will try to make a script for general use. This is pretty powerful.

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

Post by Genete »

heyvern wrote:Yeeeeeeehaaaaaaa!!!!

Okay kids pay attention...

I was desperate to find a way to switch a layer's z depth using a bone's location. Rasheed wrote that flipbybones script that worked... sort of... but it had big problems for my use since it wouldn't place key frames correctly and conflicted with other scripts.

I finally figured it out! Wooohooo! I can change the z depth of a layer ON FRAME 0 from any other frame of the animation!!!

Changing a layer's translation on frame 0 will update throughout the animation without using keys. It can be done "on the fly" based on the location of a bone.

I plan to use this for my face rig but will try to make a script for general use. This is pretty powerful.

-vern
But with the normal tools (layer translation) or with a lua script command...? I don't understand... Can you, please, explain it a little more slow?

Thanks for share.
Genete
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Oops!

Forgot to mention I'm using a script.

The simplicity of it is beautiful!

I can now EASILY target any layer and flip its z translation exactly like Rasheed's script but with out any key frames and no other problems. It is ten times simpler. Just a few lines of code.

It works PERFECTLY!

I have it set up the same as Rasheed's script using 2 bones. When one bone crosses past another bone on the x-axis the layer/s flip the z translation on frame 0. By changing layer translation on frame 0 it updates the whole time line without using any key frames.

Since it is a layer script it checks the location of the bones on every frame and updates the layers z translation on the fly. All it does is checks that one bone is "ahead" or "behind" another bone. I don't have to calculate key frame spacing or check previous key frames etc.

I AM SO FREAKING HAPPY I COULD CRY!!!!!

I have a body rig now that flips the arms and legs up and down for a BODY TURN! I have a body that can be turned just like the head on my rig!!!!!!!!

With this script I can go back to the head and fix all the stupid things I had to do to work around the layer flipping!!!! I can simplify the art work by 50% at least. Removing a bunch of unneccessary layes/shapes.... I can go back to my original idea of flipping the ear layers instead of covering them with extra shapes.

I can now do hair on the sides of the head easy as pie by flipping layers! This is a major breakthrough for me.

I will post a sample of the body turn in another thread. I have to finish tweaking some bones for the chest and hips. It looks so cool. As cool as the head turn!

I am using bones with constraints to deform the body on the turn to change the shape of the chest and hips.

I am freaking out.

-vern
Post Reply