• Editor
  • Possible For Constraint to Invert Scale (-1)?

I have tried a number of different methods, but I cannot find a way to use a constraint to invert the scale of another bone


causing it to go from positive to negative scale (or vice versa). From what I can tell, if a bone is set to positive scale, it remains positive even if the bone to which it is constrained is set to a negative scale. The opposite is also true.

Example: I would like to be able to use a constraint to invert scale in a case where I want to flip some textures (but not all) when I flip a character in a specific animation state.

Obviously I could do this on a bone by bone basis, but in my case, I will actually need to do it via a constraint.

Specifically, my actual use case is much more complicated, because I am attempting to flip certain bones to negative scale based on another bone’s rotation - I want scale to be positive when the bone is rotated toward the right (0 +/- 90), and scale to be negative when the bone is rotated toward the left (90-270). But if a normal scale constraint could be used to invert (-1) the scale, then that would provide the solution I need.

Related Discussions
...

Hello! currently you can only set transforms and rotations to negative numbers, I see how scale could be useful, let's hear what Nate thinks of this (:

Did you consider using 1 bone IK constraints with the stretch option activated maybe? could you maybe post a more detailed example of what you want to do? it sounds interesting, maybe it's possible to find a solution with what is already available in Spine.

I tried using the 1-bone IK with stretch, but it will just rotate to 180 when it's flipped rather than scaling into negative numbers. I also tried every combination of setting the scale offset to -1, setting the scale constraint to -100 (which I guess does not do anything), and every combination of setting the constraint target and child to + or - scale.

Here is an example of what I'm actually trying to do:
SpineRotateLeg_RCB - YouTube

Our game is top-down, with a slight perspective. I'm simulating perspective through bones scaled to 0.8. What you are looking at in the video is an updated version of the character's leg, which I'm trying to improve to make it look a bit more 3D. We are controlling character rotation programmatically, so I'm trying to create a single animation that can be rotated without changing animation states.

As you can see, the leg looks like it's in perfect 3D-esque perspective until the bone rotates past the vertical (any angle between 90-270 degrees). The leg flips around backwards. This could easily be corrected through negative scale, but as mentioned, I can't key this in every case because the code is controlling rotation. What I'd like to do is use a constraint to flip the leg backwards (in other words, to the correct orientation) when the angle of the leg crosses that 90/270-degree threshold.

I'd find something like this very useful too. Tried to do it once but the bones behaved in a different way than I expected.

That's quite an intense rig!

Unfortunately a transform constraint that copies a world transform is limited by the math involved. Determining the world scale from a bone's worlds transform involves a square root operation, which by definition is always a positive number. If your transform constraint has Local checked, then it will behave as you want.

Relying on world scale tends to make everything complicated. When the bone's world transform is computed from its local transform and its ascendant's local transforms, the sign of the scale is no longer clear. Eg, consider that -1 scaleY, rotation 0 is identical to -1 scaleX, rotation 180. Once the local transforms have been combined, it's no longer possible to tell which was used. Both provide the same results, so both are correct, but it means you can't rely on just rotation or just scale. Eg, if you copied scale and not rotation to another bone, it may give you surprising results.

19 gün sonra

I came here looking for the same thing!

I'm trying to fake 3D on this guy's trumpet:
As you can see, I'd scale down the trumpet lengthwise, and I'd want the "hole" to scale up in reaction to that.
Setting the transorm relation to -100 (in my mind) seems a logical way to do that.

I'd actually love to have inverse scale too. makes puppy eyes towards Nate

But while we wait for the response, your trumbet can also be done in another way: merge the hole with the trumpet, then rig the trumpet more or less like this:

I made two ugly dots to represent two bones you could bind it too, one fixed (in yellow) and the other one controls the 2.5d-ness (in green) and it's the one you move around.
It resembles this cube: https://twitter.com/Er1k4r1/status/1037431932093689857 the principle behind it is the same.

I know a trumpet is not a cube, so it might not work as good, but I hope it might give you some inspiration to go past the obstacle!

@Erikari: I can't see that image 🙁
@Nate: I did try with local checked, but that didn't work for me. I'm also not quite sure what "local" means in this context, I'll look it up!

Is issue #1227 a fix for our relative negative scaling woes?

@nimbling, it is. The negative scaling mix works in 3.7.74-beta, available now!

It's working! Sweet!