Home Website Youtube GitHub

How To Prevent Shear On Joints

I have a bit of an issue here that i found a somewhat of a work around for but it would be great if This would be an option somewhere that you can tick when generating your rigs.

When Creating Rigs that are going to be imported via FBX into Unity. You can’t have “Shear” values on your joints. since the FBX exporter does not export them.

When Generating my rigs i make sure to click the “Force Uniform Scaling” option.

image

This option prevents the joints of an ik chain from shearing when its stretched witch is wonderful!

BUT there is a a very big exception. If one of the animators decides to scale one of the main “body” controllers to give the character some squash and stretch. . . Even if Force uniform scaling is on it still starts messing with the shear values. and once the animation is baked and exported there is a VERY noticeable disconnect between the maya file and what the FBX looks like.

Here is the issue on a very simple Rig : Its just a Root with a body, hips and an Epic Leg+Foot.

The only way i’ve gotten around the issue is to break the connection to the shear on every single joint. that seems to do the trick. But since the whole “EPIC” components were made in mind for game engines. it would be wonderful if they just didn’t shear anything at all since no game engine (that i know of) supports that.

Or is there a way to stop mGear from doing this all together that I don’t’ know of?

Thanks again!

2 Likes

I recently ran into this issue as well. Here’s how I handled it: while FBX doesn’t support shear, it does support segment scale compensation. They are two ways of accomplishing the same thing in this case. It’s fairly easy to switch the node graph from relying on shear to using ssc. I run this as part of a post-script suite:

import pymel.core as pmc

# note: I rename the mGear joint hierarchy  to have "driver_" prefix
for j in pmc.listRelatives("driver_root", allDescendents=True):
    jp = j.getParent()
    jp.s >> j.inverseScale
    j.segmentScaleCompensate.set(1)
    j.shear.disconnect()
    j.shear.set(0, 0, 0)

    # clear scale and shear from parent matrix before inverting
    # and piping into mGear xform node as parent inverse
    # (this mimics what segment scale compensation does)
    mtx = j.t.inputs()[0]
    gate = pmc.nt.PickMatrix()
    gate.useScale.set(0)
    gate.useShear.set(0)
    jp.wm >> gate.imat
    inv = pmc.nt.InverseMatrix()
    gate.tmat >> inv.imat
    inv.omat >> mtx.drivenParentInverseMatrix

Let me know if that works out for you.

3 Likes

@clamdragon as far I know segment scale compensation was not supported by Unity and Unreal Engine. Are you working with one of this engines?
To be honest I am not sure if that still the case. I will research on it again. :sweat_smile:

Here are some links referencing this limitation:

is someone has more information or can confirm this, it is very welcome. Thanks

Hi Miquel. I can’t speak to Unity, but these days SSC seems to work fine in unreal. Here’s the little test I did to confirm (done in UE5.0):


1 Like

@clamdragon thanks for the confirmation and the gif. I will keep the research and add an option to use or not SSC on the rigs.
I have open a ticket

2 Likes

Unfortunately we’re on Unity T_T so RIP… lol

Buuut thanks a bunch for the info! VERY useful!!

@Hobbz I am planning to add leaf joints to the epic components. That should help Unity users to have squash and stretch.
I have this ticket open for this improvement

1 Like

optional SCC is implemented :slight_smile:

7 Likes

Which version is this?

is not yet released, but you can get the change from github

I tried to do that but couldn’t find it, I am not that good at github, sorry :sweat_smile:

I copied files in 4.0.19 but still can’t see that option

I think I found it, this one?

yep that is the ticket, But if you are not familiar with git, maybe will be better to wait until the official release is ready :slight_smile:

re-opening the ticket. I have found some issues with the current implementation

I have found a bug in Maya and this feature will be on hold until the bug is fixed:
Here is an explanation of the but:

1 Like