Wrong limits axis used during simulation

Hello!

I’m currently building a ragdoll setup for one of my personal project’s char (more on that in a proper topic as soon as the setup is done!), and I’m facing a weird issue: when applying limits to the legs, it seems as if the displayed limits are different from the actual limits used:


the limits when I set the values up in the manipulator


the limits that seem to be actually used by ragdoll - forgive the shaky snippingTool writing!

If I try to lock all the axis but the Z, I have this result:

And if I lock all but the X (to follow the displayed thing in the manipulator), I have this result:

I only got this issue on the legs, the rest of the body appears to be fine; if I remove the limits altogether, it works nicely, but it creates a weird result as the legs bend at angles they normally shouldn’t. Do you have any idea why it does that?
Thanks!

Yes, this is one of the things that’s hard to make a good default for.

Per default, Ragdoll assumes that the X axis is the axis your limb twists around. The axis that points in the direction of the length of the lower leg. That is mostly true, but sometimes not. Like in this case, where it looks like the X axis is pointing in the direction the character is facing.

Technically this isn’t a problem, and if you hit that little Reset button towards the end of the Manipulator UI in Limit Mode, it’ll get you back to a point where the limit is in a good state. From there, you will find that your leg is free to rotate 45 degrees in each axis, and from here you can tune the limit.

The trick here is that the little red and green lines represent where your leg is within that limit, and it isn’t going to look correct. So rather than putting the limits around your leg, you’d put it around those red and green lines.

Best to experiment, hit that reset button when your leg starts popping on the start frame or doesn’t reach enough of an angle. The red and green lines will try and stay within those limits at all times.

I’ll prepare some examples to solidify this once I’m back at my computer next week!

1 Like

I’m back! Let’s have a closer look at what’s going on here. :blush:

Here are 3 joint chains - the same applies to regular NURBS controls.

Notice how each of them have the X axis pointing in a different direction. To Ragdoll, these don’t matter. But to you, visually, it makes the most sense for the X axis to point in the direction of your limbs.

2. Assign Markers

Without limits, we won’t yet notice any effect of these differences.

3. Limits

But once we apply limits, we’ll notice how the axes look as though they don’t align with the joint/control!

4. Tweak

To Ragdoll, it doesn’t matter what these look like. It will always try and keep the red line within the red shape, and the green line within the green shape. That’s it’s mission, and that’ll work.

Edit Constraint Frames

As an advanced alternative, you can manually edit the constraints to have different axes to that of your control. Such that the Maya X-axis and Ragdoll X-axis are different. That way, you can edit the physics limits in bulk, and assume that X is always the twist axis.

Let’s have a look at how to do that!

1. Reset Limits

First off, let’s undo all of the things we did to the limits above via Ragdoll → Utilities → Reset Constraint Frames. You can skip this step if you haven’t changed them yet.

2. Edit Constraint Frames

Next, select the Marker(s) you would like to change the axes for and run Ragdoll → Utilities → Edit Constraint Frames. This will create 2 Maya handles, one for the limits and another for the red/green lines. These are called “Parent Frame” and “Child Frame” respectively.

  • Parent Frame is the space in which the Child Frame can move
  • Child Frame is the current orientation of the Marker

3. Display Limits

Per default, limits are only visible when a Marker is selected. To select these frames, we need to make them visible all the time, so go to the Solver Attribute Editor, and set Draw Limits = Always.

4. Reorient Limits

This is the tricky part.

  1. Make sure you have both frames selected
  2. Make sure they both rotate the same way

You’ll want to keep the red/green lines within their red/green limits at all times, like in this video here.

Keep an eye out for the red/green lines to rotate differently from the red/green limits. They are parented to different controls, which may have different axes. Set your Rotate Gizmo to World to avoid that. You can orient them separately, just make sure they line up by the time you are done.

5. Manipulate as One

At this point, they all have the X-axis facing in the same direction, so manipulating them now is as easy as a pie.

Hope it helps! Any questions, fire away.

1 Like