I came up with another script addition for my version of this.
It is based on the flip layer script.
The flip layer script flips a layer's z depth based on the position of a bone. I added a feature that... scales a bone the same on either side of the "flip".
For instance the eyes. Let's imagine the two eyes get closer together as the head turns and you are using the scale of a bone to accomplish this. You can't do that with one bone scale because on the other side of the turn the scale reverses and the eyes move in the wrong direction.
My script uses the same layer flipping bones to make the scale of a bone the same on either side of a turn. If the scale is 1.2 on the left, it is 1.2 on the right.
It took me a while to wrap my head around this. I kept thinking I could use two bones, one with a reversed scale constraint... nope. Has to be scripted. In order to do what I need it to the same bone must scale the same on either side.
This creates a result very similar to Genete's spring gizmo but with just one bone instead of 3. Just 1 bone!! Genete!!! ONE FREAKING BONE!
In the begging on this journey I started, what seems now like ages and ages ago, I had wished for a way to "reverse" a constraint at a halfway point. I even tried to script this but the constraints wouldn't update in real time when changed via a script so I gave that up. Then Genete came up with that fantastic spring gizmo which eliminated the need for it.
Now I got something that works perfectly. The really really cool part is... it uses so few bones and in the script each "side" is "unique" and it "knows" left from right... so... you can increase or decrease the scale amount for each side for a better "3D" simulation.
And you could use constraints for any other bone and offset the children of these bones so they "translate" at different values... for elements that "spin" faster or slower.
Now I am thinking this could be applied to ANY movement of a bone... rotation, translation.
You could have a bone that moves in opposite directions on either side. Once you hit that middle point the direction reverses creating a mirror image of the motion.
This is new as of today... so I need to percolate it through my head to see what the potential is.
I also want to write a "general" script so you guys could play with it. I need to come up with bone naming rules for the different values based on the flip bones. I should be able to add all the flipping to one script; layer, rotation, scale, translation.
My thought is... name a bone with an extension like:
bonename.tx (flip x translation)
bonename.ty (flip y translation)
boneame.r (flip rotation)
bonename.s (flip scale)
Flipping the y translation... I just thought of that... it would require an optional set of flipping bones that go up and down.
I am thinking I could also add in all the other scripting gizmos like transRotate, RotateTrans, TransScale, etc etc... have the whole thing in one package... have to come up with a complex bone naming structure to do that...
bonename.r.trMstr
(master bone flips)
bonename.trSlv
(slave bone rotates based on master translation. Flip happens automatically based on the master.)
If you are interested in this and have any ideas for naming the bones or a better idea to identify bones for all these features in one script let me know.
I am flipping out right now... forgive the pun.
-vern