Smart bone flipping and mirror point tool
Posted: Sat Oct 26, 2013 10:04 am
Download the scripts:
Mirror translate points tool:
http://hubumedia.com/anime-studio-servi ... oints-tool
Mirror points menu scripts
http://hubumedia.com/anime-studio-servi ... nu-scripts
Finally!
I was going nuts "flipping" mirrored smart bones for multiple vector layers. I had to do a TON of duplicate smart bones for a full body and head turn on multiple layers for the opposite side. It was so frustrating because the layers are all symmetrical, the point positions are right there but no easy way to flip them for the opposite turn of the smart bone. You can't use the "flip horizontal" point tool because that reverses everything.
I finally have a solution. It's a working prototype but should be ready very shortly. Instead of hours of recreating the same point movement for a ton of layers for the opposite turn of a smart bone, it only took a few minutes.
Basically it works based only on perfectly symmetrical vector layers for doing "full turns" like head or body turns. It is limited a bit because the vector layers have to be symmetrical but there really is no way to work around this and it's pretty much how you would do something like this anyway. If the vector layer isn't symmetrical to begin with, creating mirrored smart bone actions would have to be done by hand anyway.
To make things easier I also created a script to make vectors symmetrical. For example if the layer is "close" but not "perfect", you run the script and it mirrors the left and right sides by selecting the closest point on the opposite side. Not perfect but it gets it pretty close and still saves a ton of time. This could also be useful just for regular character designs.
While I was at it I also created a "mirror" point translation tool that works pretty well. Still tweaking a "radius" setting for it.
Smart Bone Flipper
So the smart bone flipper works by using the point positions on frame 0 where they aren't moved to create a table of matching points. That was the tricky part. How to find the "opposite" point if they are moved around on a frame. It's virtually impossible. Point IDs aren't "matching" unless they are drawn that way to start. If you draw a shape then insert points between other points later the IDs on the opposite sides won't match. The only way to get the exact opposite side point is to use their translations so this would be done on frame 0 only. This is why they have to be exactly symmetrical which required creating another script to do this first on frame 0. Many times you might have points that are really close to each other and if they aren't exactly the opposite value on either side it won't work as well.
Once that left/right point table is created it's a piece of cake to simply "reverse" the point positions on any other frame to flip the point movement.
The steps are simple. For my current usage, I had already created a full front to side turn of the body to the right. With a full front to side right turn, I now needed to do the exact same thing for the left turn. The body is a switch to go from front to back on the cross of the turn so I had to create smart bone turn point keys for a whole pile of layers.
I created my new left turn smart bone action (body turn 2) and inserted a copy of the original left body turn action. I now had all the keys for the points but in the wrong direction. I went to each key frame and ran the script which "flips" the point movement. The bone movements wasn't a big deal because that is simple to copy and didn't take long to do by hand, although I am thinking of adding in that feature to make it a one step process.
Just to be clear, this is NOT like the point flipping tool. That completely flips the points in the opposite direction. That won't work with smart bone turns. This changes the position of opposite points to create the same motion but "mirrored".
Mirror translate points tool:
http://hubumedia.com/anime-studio-servi ... oints-tool
Mirror points menu scripts
http://hubumedia.com/anime-studio-servi ... nu-scripts
Finally!
I was going nuts "flipping" mirrored smart bones for multiple vector layers. I had to do a TON of duplicate smart bones for a full body and head turn on multiple layers for the opposite side. It was so frustrating because the layers are all symmetrical, the point positions are right there but no easy way to flip them for the opposite turn of the smart bone. You can't use the "flip horizontal" point tool because that reverses everything.
I finally have a solution. It's a working prototype but should be ready very shortly. Instead of hours of recreating the same point movement for a ton of layers for the opposite turn of a smart bone, it only took a few minutes.
Basically it works based only on perfectly symmetrical vector layers for doing "full turns" like head or body turns. It is limited a bit because the vector layers have to be symmetrical but there really is no way to work around this and it's pretty much how you would do something like this anyway. If the vector layer isn't symmetrical to begin with, creating mirrored smart bone actions would have to be done by hand anyway.
To make things easier I also created a script to make vectors symmetrical. For example if the layer is "close" but not "perfect", you run the script and it mirrors the left and right sides by selecting the closest point on the opposite side. Not perfect but it gets it pretty close and still saves a ton of time. This could also be useful just for regular character designs.
While I was at it I also created a "mirror" point translation tool that works pretty well. Still tweaking a "radius" setting for it.
Smart Bone Flipper
So the smart bone flipper works by using the point positions on frame 0 where they aren't moved to create a table of matching points. That was the tricky part. How to find the "opposite" point if they are moved around on a frame. It's virtually impossible. Point IDs aren't "matching" unless they are drawn that way to start. If you draw a shape then insert points between other points later the IDs on the opposite sides won't match. The only way to get the exact opposite side point is to use their translations so this would be done on frame 0 only. This is why they have to be exactly symmetrical which required creating another script to do this first on frame 0. Many times you might have points that are really close to each other and if they aren't exactly the opposite value on either side it won't work as well.
Once that left/right point table is created it's a piece of cake to simply "reverse" the point positions on any other frame to flip the point movement.
The steps are simple. For my current usage, I had already created a full front to side turn of the body to the right. With a full front to side right turn, I now needed to do the exact same thing for the left turn. The body is a switch to go from front to back on the cross of the turn so I had to create smart bone turn point keys for a whole pile of layers.
I created my new left turn smart bone action (body turn 2) and inserted a copy of the original left body turn action. I now had all the keys for the points but in the wrong direction. I went to each key frame and ran the script which "flips" the point movement. The bone movements wasn't a big deal because that is simple to copy and didn't take long to do by hand, although I am thinking of adding in that feature to make it a one step process.
Just to be clear, this is NOT like the point flipping tool. That completely flips the points in the opposite direction. That won't work with smart bone turns. This changes the position of opposite points to create the same motion but "mirrored".