Bone dynamics across layers
Moderators: Víctor Paredes, Belgarath, slowtiger
-
- Posts: 279
- Joined: Thu Mar 30, 2006 6:12 pm
- Location: Verona, New Jersey
Bone dynamics across layers
Hey guys...
Perhaps this has been asked about before now, if so please link me to the topic, I'm wondering if there's a way, or a script, or something that will allow for setting up bone dynamics across layers.
The thing is this: I have a character that is rather highly designed in a kind of low-design way (makes sense, no?). Anyway, I have the model separated pretty severely, I have some layers that are set on switch layers but I need for them to be linked directly to the parent layers. I know that switch layers can carry their own bones, It would be helpful to have them doing the exact same thing as their parent bones so that the lines can bend and stretch the way they did before I separated the vector art out so that I could create the switch layers.
Thanks for your help,
S
Perhaps this has been asked about before now, if so please link me to the topic, I'm wondering if there's a way, or a script, or something that will allow for setting up bone dynamics across layers.
The thing is this: I have a character that is rather highly designed in a kind of low-design way (makes sense, no?). Anyway, I have the model separated pretty severely, I have some layers that are set on switch layers but I need for them to be linked directly to the parent layers. I know that switch layers can carry their own bones, It would be helpful to have them doing the exact same thing as their parent bones so that the lines can bend and stretch the way they did before I separated the vector art out so that I could create the switch layers.
Thanks for your help,
S
Bones can't control vectors or layers inside other bone or group layers like switches. The best you can do is bind the whole layer as a unit to a bone of the parent layer.
The only way to do what you describe is use the "Mesh Instance" layer scripts mentioned in the scripting forum.
These scripts require duplicate layers of any layer you want to be controlled by bones that are in the parent layer. So if you have layers in a switch you want controlled by bones that are on the parent layer, you need duplicates of all the switch layers in the bone layer. Their motion is controlled by the bones directly and "pass" that motion to the layers inside the switch layer.
So to reiterate, once you put layers inside a group type layer that is inside a bone layer, only the bones on the sub group layer can effect the vector layers inside it. Bones in the parent can not reach inside that group layer to move the vectors.
-vern
The only way to do what you describe is use the "Mesh Instance" layer scripts mentioned in the scripting forum.
These scripts require duplicate layers of any layer you want to be controlled by bones that are in the parent layer. So if you have layers in a switch you want controlled by bones that are on the parent layer, you need duplicates of all the switch layers in the bone layer. Their motion is controlled by the bones directly and "pass" that motion to the layers inside the switch layer.
So to reiterate, once you put layers inside a group type layer that is inside a bone layer, only the bones on the sub group layer can effect the vector layers inside it. Bones in the parent can not reach inside that group layer to move the vectors.
-vern
-
- Posts: 279
- Joined: Thu Mar 30, 2006 6:12 pm
- Location: Verona, New Jersey
Well, it sounds like "mesh instance" is what I need then! -Yeah, I can duplicate the parent bones onto the switch layer (I was planning to do that anyway), I just need them to be doing exactly what their duplicate parent bones are doing.heyvern wrote:The only way to do what you describe is use the "Mesh Instance" layer scripts mentioned in the scripting forum.
These scripts require duplicate layers of any layer you want to be controlled by bones that are in the parent layer. So if you have layers in a switch you want controlled by bones that are on the parent layer, you need duplicates of all the switch layers in the bone layer. Their motion is controlled by the bones directly and "pass" that motion to the layers inside the switch layer.
-vern
I, uh, kinda set up a bone offset on the head of a character when I was doing my initial run and then later placed the vectors for that head inside a switch layer. -Wouldn't be so bad but the client's design requires the neck to be a part of the head also and I need that to bend with the neck bone. Unfortunately since the vectors for the head are in a switch layer now I don't much need the offset anymore.
So how do you use this "mesh instance" thingy anyway?
Thanks, Vern. You always come through.
- synthsin75
- Posts: 10276
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
viewtopic.php?t=11572&highlight=meshinstance
First, you may want to pick up this fixed version of Mesh_instance. The original gives faulty error messages.
For each layer you want to instanced (be a controlling vector layer), you need to embed fa_mesh_instance on the layer settings panel. Duplicating this layer will now also duplicate the embedding. So the only thing left is to and the name extension.
Name the duplicate layer the same as the original, but put ".dup" (for duplicate) at the end. Thus a layer named "head" would have the instance named "head.dup".
After that all you need to do is make sure you keep the original below its duplicate in the layer stack. AS renders from the bottom of the stack up, so it must read the master layer first.
If you intend to use it for switch layers, you will need a unique master layer for each instance. This is because a switch only identifies its sub-layers by name. So if you're doing, say, hands in a switch layer, you'll need all of those switch layers in a separate bone layer for bone manipulation.
This is where you'd control the hand bones. Then each of these would be instanced into the switch layer. You just have to get use to controlling the bone from a lower layer.
Hopefully all that's clear.
First, you may want to pick up this fixed version of Mesh_instance. The original gives faulty error messages.
For each layer you want to instanced (be a controlling vector layer), you need to embed fa_mesh_instance on the layer settings panel. Duplicating this layer will now also duplicate the embedding. So the only thing left is to and the name extension.
Name the duplicate layer the same as the original, but put ".dup" (for duplicate) at the end. Thus a layer named "head" would have the instance named "head.dup".
After that all you need to do is make sure you keep the original below its duplicate in the layer stack. AS renders from the bottom of the stack up, so it must read the master layer first.
If you intend to use it for switch layers, you will need a unique master layer for each instance. This is because a switch only identifies its sub-layers by name. So if you're doing, say, hands in a switch layer, you'll need all of those switch layers in a separate bone layer for bone manipulation.
This is where you'd control the hand bones. Then each of these would be instanced into the switch layer. You just have to get use to controlling the bone from a lower layer.
Hopefully all that's clear.

-
- Posts: 279
- Joined: Thu Mar 30, 2006 6:12 pm
- Location: Verona, New Jersey
I understood all up until this point. I guess I got thrown off because I'm not making a hand layer. What I have is a switch layer for mouth phenomes (the drawing for this includes the mouth elements plus the head and neck structure), then a switch layer for each eye (to facilitate blinking and winking). I'd like to be able to have the switch layers for the eyes and mouth have bones on them that do [/b]exactly what the corresponding parent bones do in the parent bone layer.synthsin75 wrote:
If you intend to use it for switch layers, you will need a unique master layer for each instance. This is because a switch only identifies its sub-layers by name. So if you're doing, say, hands in a switch layer, you'll need all of those switch layers in a separate bone layer for bone manipulation.
This is where you'd control the hand bones. Then each of these would be instanced into the switch layer. You just have to get use to controlling the bone from a lower layer.
Hopefully all that's clear.
Is this possible with "mesh instance"?
If you understand the first part, the second part about switches is the same thing. You need a duplicate of each layer inside the switch as described in the first part.slice11217 wrote:
I understood all up until this point...
The only difference is that the duped layers are inside a switch.
If you have phonemes for a mouth switch you need TWO of each layer, the duplicated layers (AI.dup, E.dup for example) and the original that is outside the switch layer but still in the main bone layer.
EDIT: You can't use a dat file for the phonemes with the ".dup" extension on the lip sync switch layers. Make sure that you put in the dat file BEFORE you rename the layers if you are using something like papagayo to do the lip sync.
--------
Make sure that the switch layer IS NOT BOUND TO ANY BONES. This would double the motion. The script duplicates ALL point motion caused by bones. If the switch is bound to a bone and the layers inside are replicating motion from a master than this doubles the motion because the points are moving as well as the parent switch layer.
Also remember to turn off "render this layer" for the master layers properties so they don't show when rendering.
--------
Why not put the head and neck outside of the switch? Put just the mouth in the switch (no bones needed, no script needed) put the head and neck below the mouth switch in the bone layer.What I have is a switch layer for mouth phenomes (the drawing for this includes the mouth elements plus the head and neck structure),
Does the head actually change in the switch layers or does it stay the same on each layer? If it stays the same there is no need for it to be in the switch layer. The head and neck could be outside. Make it much easier.
-vern
-
- Posts: 279
- Joined: Thu Mar 30, 2006 6:12 pm
- Location: Verona, New Jersey
So does this mean that I'll have to embed the script to the head/mouth, duplicate the layer, and rebuild the phenomes, or can I simply embed the script to the existing phenome layers and add .dup to the end of the name (the phenome layers are duplicates of the head layer anyway)?heyvern wrote:You need a duplicate of each layer inside the switch as described in the first part.
The only difference is that the duped layers are inside a switch.
If you have phonemes for a mouth switch you need TWO of each layer, the duplicated layers (AI.dup, E.dup for example) and the original that is outside the switch layer but still in the main bone layer.
Aaaah, wait it just dawned on me.... each phenome would be duped outside the switch layer, have the embedded script, but have "render this layer" turned off -am I right?
--------
Thanks, I probably saw "render this layer" on the layer settings window and never really thought about it. So as I'm understanding all this, the original head layer would need to be outside the switch to serve as a reference for the point motion that would be controlled by the bones in the parent bone layer.heyvern wrote:Make sure that the switch layer IS NOT BOUND TO ANY BONES. This would double the motion. The script duplicates ALL point motion caused by bones. If the switch is bound to a bone and the layers inside are replicating motion from a master than this doubles the motion because the points are moving as well as the parent switch layer.
Also remember to turn off "render this layer" for the master layers properties so they don't show when rendering.
Does this mean that all the layers in the switch have to be named "head.dup" or can I name them like, "head.dup.ai, head.dup.sh, head.dup.ee, etc."? -I'm just wondering how you distinguish one layer in the switch from another.
You're right it would be much easier, unfortunately the design the client wants isn't so easy. It's kinda primitively high design, if that makes any sense. The mouth is built into the head, and the head is built into the neck which is also built into the body. I managed to make a fairly believable separation of the neck from the body but anything more would be pushing it, I believe.heyvern wrote:Why not put the head and neck outside of the switch? Put just the mouth in the switch (no bones needed, no script needed) put the head and neck below the mouth switch in the bone layer.
Does the head actually change in the switch layers or does it stay the same on each layer? If it stays the same there is no need for it to be in the switch layer. The head and neck could be outside. Make it much easier.
-vern
Anyway if what you're describing here works, this is a pretty incredible script. I can think of a few earlier projects that this would have been helpful for.
thanks!
S
Yes, MASTER layers OUTSIDE the switch so the bones can effect the points. These layers are set to not render and DO NOT have the .dup extension. these layers are the masters. the layers INSIDE the switch have the .dup extension.Aaaah, wait it just dawned on me.... each phenome would be duped outside the switch layer, have the embedded script, but have "render this layer" turned off -am I right?
The names of the layers are up to you. The only requirement is that each layer name must have a unique name and the .dup extension MUST BE LAST in the name. Everything else is up to you.Does this mean that all the layers in the switch have to be named "head.dup" or can I name them like, "head.dup.ai, head.dup.sh, head.dup.ee, etc."? -I'm just wondering how you distinguish one layer in the switch from another.
WARNING!
If you already have switch keys on the switches... ooops! You are SOL! Changing the names will break the keys to the switches. You will have to rekey them all. *
AS stores the switch keys as a text string that is the name of the layer. When you change the name of the layer or move it out of the switch AS still has that info in there but the layer doesn't exist anymore.
----------------------
*However... if you send me the file or feel adventurous, you can fix this with a text editor lickity split. Using a text editor you do a search and replace to change the key references to the new name. Yes, you have to do it for all the layers but still faster than rekeying a whold file.
-vern
-
- Posts: 279
- Joined: Thu Mar 30, 2006 6:12 pm
- Location: Verona, New Jersey
-
- Posts: 279
- Joined: Thu Mar 30, 2006 6:12 pm
- Location: Verona, New Jersey
WOW!!!!
that worked amazingly!! Thanks guys, it really solved a big dilemma for me!
suggestion for Mike Clifton: in a future version of ASPro, incorporate a more elegant version of fa_meshinstance, perhaps where you click on the layer properties dialogue window and there's a heading called "use bone instance from (layer x -user defined)". That way we don't have to keep two copies of the layer in our projects and carry a script around with the project.
Again thanks guys, you're a lifesaver!
-S
that worked amazingly!! Thanks guys, it really solved a big dilemma for me!
suggestion for Mike Clifton: in a future version of ASPro, incorporate a more elegant version of fa_meshinstance, perhaps where you click on the layer properties dialogue window and there's a heading called "use bone instance from (layer x -user defined)". That way we don't have to keep two copies of the layer in our projects and carry a script around with the project.
Again thanks guys, you're a lifesaver!
-S
- synthsin75
- Posts: 10276
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Always glad to have another meshinstance convert. I can't use it enough.
Just some extra info: You can change almost everything in an instance. Line width, fill & outline colors, curvature, etc. You can even have your vector points connected differently as long as you never add or remove any points from the duplicate. (As long as you add the new connecting line first, deleting an edge won't mess up your instance. Just make sure your point has at least one spline to maintain it.)
Have fun!
Just some extra info: You can change almost everything in an instance. Line width, fill & outline colors, curvature, etc. You can even have your vector points connected differently as long as you never add or remove any points from the duplicate. (As long as you add the new connecting line first, deleting an edge won't mess up your instance. Just make sure your point has at least one spline to maintain it.)
Have fun!

I've been thinking of something CRAZY. You can get the bone info from a parent layer. With vectors inside a switch you get the parent of a parent. The transformation matrix of a skeleton could technically be applied to the vectors inside the switch. No duplicate needed.slice11217 wrote:WOW!!!!
that worked amazingly!! Thanks guys, it really solved a big dilemma for me!
suggestion for Mike Clifton: in a future version of ASPro, incorporate a more elegant version of fa_meshinstance, perhaps where you click on the layer properties dialogue window and there's a heading called "use bone instance from (layer x -user defined)". That way we don't have to keep two copies of the layer in our projects and carry a script around with the project.
Again thanks guys, you're a lifesaver!
-S
This would only work INSIDE a bone layer. Bone data can't be accessed outside of it... unless by layer ID which is a pain in the arse.
I had been thinking about this since discovering how cool the Meshinstnace script is. The original intention of it was to duplicate vector motion. We are using it in a very roundabout fashion to duplicate BONE MOTION.
I know this will work because I did a quick edit of my copy/flip bones to copy bones from a child layer and pasted them onto a parent bone layer. Works pretty good. If you a bone setup you want to copy from one layer to another, just drag the bone layer you want to copy into the bone layer you want to copy to.
I will make this available when I work out the bugs. For now it doesn't copy them accurately when the parent bones are "missing" in the pasted layer.
-vern
-vern
-
- Posts: 279
- Joined: Thu Mar 30, 2006 6:12 pm
- Location: Verona, New Jersey
How did you use copy/flip bones to copy from one layer to another? I thought it pretty much pasted the copy right after you click the button. I guess since you wrote the script you probably know some workaround to do this. It would be handy for copying bones to switch layers.heyvern wrote: I know this will work because I did a quick edit of my copy/flip bones to copy bones from a child layer and pasted them onto a parent bone layer. Works pretty good. If you a bone setup you want to copy from one layer to another, just drag the bone layer you want to copy into the bone layer you want to copy to.
Copying and pasting of bones doesn't really copy or paste bones.
What is actually happening is the script makes a list of the bones to copy first. It stores all the properties in that list, then it creates new bones, then changes those new bones attributes to match the list of the copied bones. It all happens in a spit second.
You need two lists of bones. Old, and New. You have to have a bone exist before you can change it and you must have access to the skeleton of the bone layer to do it. That is where things get tricky.
In scripting a bone layer's skeleton is accessed by the class "Skeleton". That is how you add or change bones. Without access to the "Skeleton" you can't do anything. Even if you say "I'm on layer 2. List the bones on layer 4. It's a bone layer dangit now list all the stupid bones!" It won't work. there is no "Skeleton" for another layer. You can't get to it... at all... ever... nada... without selecting that dang layer.
All of my "bone copy/paste" stuff was based on a script by a member of the forum ThaNarie. The bone copying in that script was based on switching layers. It required two different scripts, one to copy, one to paste after selecting a different layer.
-----------
When I created my copy/flip bones script I was working on ONE layer. It was much easier. All the bones are there. I have access to the skeleton of the layer I'm on. Piece of cake.
I then discovered a funny thing I missed in the script interface... ParentSkeleton. It's exactly the same as if you selected that bone layer. I found that the Skeleton of the PARENT layer can be accessed by child layers using this function.
I was so desperate to copy a perfect set of bones from a child layer to the parent layer without having to painstakingly transfer all the numbers that I gave it a shot and modified my script to paste on the PARENT layer.
I never expected it to work. All I did was change the script so that instead of making the copies of the bones on the same layer, I had it make the copies on THE PARENT BONE LAYER. I just added a few lines of code. It worked. I didn't have to select the parent layer to add new bones. This was a revelation to me.
(Ironically, there is no way to get the skeleton of children layers inside a bone layer without selecting it first).
This is a very easy way to get around the limitation of not having access to other bone layers in the document through the script interface. You drag the bone layer inside a bone layer and then it is much easier to copy those bones to it.
I hope that Mike would add a "Any Layer Skeleton" function to AS. That would really make things wicked cool for copy/paste bones functionality. It would also make it VERY easy to have bones on ANY LAYER control the points of ANY VECTOR LAYER. You just get the skeleton of any layer and apply it's influence to any other layer. Currently this won't work at all. You can't "switch layers" back and forth copying values while the animation is playing.
-vern
What is actually happening is the script makes a list of the bones to copy first. It stores all the properties in that list, then it creates new bones, then changes those new bones attributes to match the list of the copied bones. It all happens in a spit second.
You need two lists of bones. Old, and New. You have to have a bone exist before you can change it and you must have access to the skeleton of the bone layer to do it. That is where things get tricky.
In scripting a bone layer's skeleton is accessed by the class "Skeleton". That is how you add or change bones. Without access to the "Skeleton" you can't do anything. Even if you say "I'm on layer 2. List the bones on layer 4. It's a bone layer dangit now list all the stupid bones!" It won't work. there is no "Skeleton" for another layer. You can't get to it... at all... ever... nada... without selecting that dang layer.
All of my "bone copy/paste" stuff was based on a script by a member of the forum ThaNarie. The bone copying in that script was based on switching layers. It required two different scripts, one to copy, one to paste after selecting a different layer.
-----------
When I created my copy/flip bones script I was working on ONE layer. It was much easier. All the bones are there. I have access to the skeleton of the layer I'm on. Piece of cake.
I then discovered a funny thing I missed in the script interface... ParentSkeleton. It's exactly the same as if you selected that bone layer. I found that the Skeleton of the PARENT layer can be accessed by child layers using this function.
I was so desperate to copy a perfect set of bones from a child layer to the parent layer without having to painstakingly transfer all the numbers that I gave it a shot and modified my script to paste on the PARENT layer.
I never expected it to work. All I did was change the script so that instead of making the copies of the bones on the same layer, I had it make the copies on THE PARENT BONE LAYER. I just added a few lines of code. It worked. I didn't have to select the parent layer to add new bones. This was a revelation to me.
(Ironically, there is no way to get the skeleton of children layers inside a bone layer without selecting it first).
This is a very easy way to get around the limitation of not having access to other bone layers in the document through the script interface. You drag the bone layer inside a bone layer and then it is much easier to copy those bones to it.
I hope that Mike would add a "Any Layer Skeleton" function to AS. That would really make things wicked cool for copy/paste bones functionality. It would also make it VERY easy to have bones on ANY LAYER control the points of ANY VECTOR LAYER. You just get the skeleton of any layer and apply it's influence to any other layer. Currently this won't work at all. You can't "switch layers" back and forth copying values while the animation is playing.
-vern
-
- Posts: 12
- Joined: Tue Aug 12, 2008 2:06 pm
- Contact:
Hi,
I've read through this thread with much interest as I think this is the technique I need to use for a character I'm trying to rig.
I've built a character whose whole body (from head to toes) has to be one shape and used point binding to a controlling bone layer to make it move as I want to.
The problem I have arises when I try to use a switch layer to switch between different versions of this single body shape to make the character speak. I have used the instructions above and the mesh instance script to set up the file but am not getting the results I was expecting. The crazy thing is I thought I had this working in a previous test!
I'd really appreciate it if someone could take a look at my file and give me some pointers... Have I got it all set up wrong? Is there a simpler way of achieving this?
You can find it here:
http://www.sproutling.co.uk/dinosaurs/stevetest.zip
Many thanks for your help...
I've read through this thread with much interest as I think this is the technique I need to use for a character I'm trying to rig.
I've built a character whose whole body (from head to toes) has to be one shape and used point binding to a controlling bone layer to make it move as I want to.
The problem I have arises when I try to use a switch layer to switch between different versions of this single body shape to make the character speak. I have used the instructions above and the mesh instance script to set up the file but am not getting the results I was expecting. The crazy thing is I thought I had this working in a previous test!
I'd really appreciate it if someone could take a look at my file and give me some pointers... Have I got it all set up wrong? Is there a simpler way of achieving this?
You can find it here:
http://www.sproutling.co.uk/dinosaurs/stevetest.zip
Many thanks for your help...