Bone Point binding from switch layers

Wondering how to accomplish a certain animation task? Ask here.

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
DK
Posts: 2895
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Bone Point binding from switch layers

Post by DK »

Is it possible to have your main Bone structure on a Bone layer then have points from within a sub switch layer, (say a mouth position), bound to a partcular bone in that main bone layer?

D.K
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

No, AS can't do that... but...

You can use the Mesh Instancing script to do it. I asked about this in another thread in tips and techniques...

viewtopic.php?t=11449

You have to create a duplicate of your switch layer vector layer that is a non-rendering layer in the main bone layer. Then make the switch layer an instance of that non rendering duplicate layer.

Now the bones will directly effect the "hidden" vector layer which passes on the point motion INSIDE the switch layer!!!

I haven't had time to test this yet. Synthsin75 tested for me and said that the meshinstance script works within a switch layer.

----

Maybe I've overcomplicated it... you could just bind the entire switch layer to the bone.

-vern
User avatar
DK
Posts: 2895
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Post by DK »

Ahh...that's right....I remember the thread now....I'll check it out.

Thanks Vern

Cheers
D.K
User avatar
DK
Posts: 2895
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Post by DK »

Hi Vern....just testing it now but i'm stuck....not sure what you meant by "Then make the switch layer an instance of that non rendering duplicate layer"?

Cheers
D.K
User avatar
DK
Posts: 2895
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Post by DK »

Either i'm going crazy or that script does'nt work with switch layers.

D.K
User avatar
synthsin75
Posts: 10272
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

User avatar
DK
Posts: 2895
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Post by DK »

Thanks for responding synthsin5 but i'm a bit confused.
Here is a sample file I tried to get working.

http://www.wienertoonz.com/dksample.anme

What I'm trying to do is get one of the points in a layer in the switch layer to be influenced by the main bone structure (3 points in the the head are binded to the head bone). I cannot seem to get this to work. Can you explain what I am doing wrong?

D.K
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Your file is "backwards" I think DK. You have the "dup" layer set when it should be the layer in the switch that is the "dup" layer. the other layer (1) should then be moved below the switch.

THIS IS FREAKING COOOOOOLLLLL BEANS BABY! I LOVE IT!!!!

This might help. It is the read me for the script.
This is a layer script for creating duplicate instances
of a vector layer's mesh points in other layers.

There is one "source" vector layer and any number of
"copy" vector layers. The script must be applied both to
the source and to all of the copy layers. The source and
the copy layer could be anywhere in the layers tree, but
the source layer's script must be executed first (must be
lower on the list). If the order is wrong, you get an
error message to swap the source and copy layers.

The copy layers must have a name composed from the name
of the source layer and a ".dup" extension, For example if
the source layer has the name "NAME" then the copy layers
must have the name "NAME.dup".

The script copies the actual position of the points in the
mesh. The original positions of the copy layers are unused
(even their bone transformations), so you can modify the
copy layers' points only through the source layer.

You can transform (replace, rotate etc.) the copy layers
through layer transformations.
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

I noticed something odd related to switch layers. It's easy to fix... maybe....

The problem arises when your switch is bound to a bone that also moves points. You get a "doubling" of the motion. So, the bone moves points on the master and the the master tells the instance to move the same way... but the instance is inside a switch bound to the same bone... so double the motion.

The key here would be not use bone binding on the switch layer. Release the layer, then the points of the mesh move like they should.

p.s. This could allow for some really... wonderful "control mechanisms" for character rigs! Yeee-freaking-haaa!

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

Post by heyvern »

DK,

I think you want to use Region Binding on that bone layer in your sample file. Not sure what you want to achieve but flexible binding causes the circle head to "squish" all up because all of the other bones are influencing it.

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

Post by heyvern »

This is... amazing.

It works EXACTLY as I hoped it would. You can control any layer inside a switch with bones from the parent bone layer! I am speechless! (yeah right).

This opens up a whole new cool opportunity for some wickedly cool control rigs for characters!!!! AMAZING AMAZING. Let your mind wander... think of the possibiltiies.... ahhhh.... (I'm thinking of them right now).

The draw back is of course duplicating all of the switch vector layers... I don't see a way around that. I have to think about it a little. But it's not a big deal. I just have them "turned off" and forget about them. Set them to not render and they are "grayed out" so as not to be too confusing.

p.s. My thought is that if a simple script can do this... then this functionality should be able to be added to the program. Instead of a "duplicate" layer, there should be a way to access the points from inside the layer itself and eliminate all this extra work... oh well... another feature request.

-vern
User avatar
synthsin75
Posts: 10272
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

Yeah Vern's covered it, but I'll put in my two cents. You want the original in your bone layer and the .dup in your switch layer. You also have to keep the original below the .dup instance.

Sometimes the script will spit out a lua error about these being in the wrong order when they aren't. I usually only notice this when I hit the play button. As long as everything is working, I just ignore it.


Vern, welcome to the meshinstance club. :wink: I really think this works much like your master bone script. I think it would be great if you could implement the master bone script more like meshinstance.

In other words, instead of using all the bone naming conventions, maybe use duplicated bone layers. But maybe bones aren't referenced internally like points are.

Either way, I think meshinstance covers the same ground (for the most part).

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

Post by heyvern »

I love this system for duping the motion. The big drawback is the duplicated layers.

If you have a lot of switches... it gets... messy. All those duplicated layers must be "loose" in the bone layer. You can't hide them away or collapse a group folder... they just sit there... taking up space in the palette... but still it works GREAT.

I agree it is much better than my bone master script, from a performance/ease of use aspect. I need to poke around in the script and see if it can't be made better... I doubt it though.

If there were some way to create "virtual" vector layers... but that would be an enormous performance hit trying to do that with a script. It all comes down to performance. The more the script has to do the slower, and klunkier it gets.

Must now combine meshinstance with the switch slave script. ;)

-vern
User avatar
synthsin75
Posts: 10272
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

As far as being messy, I'd just tend to hide and not render my entire main skeleton bone group and collapse it. Just have to get use to doing all the layer sorting in a group above this bone layer instead of within it.

So as far as my layer palette goes, there's just the extra collapsed bone layer.

I think. :wink:
User avatar
DK
Posts: 2895
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Post by DK »

Hey...thanks guys....just woke up dwn nder....i'l give it another shot...!!!

D.K
Post Reply