Maya to UE4 - morph targets' shading breaks, help please!

Hey, I’ve spent almost a week trying to solve it, but I am running out of options, and I have to ask the community for help.

I first encountered the issue while exporting my character with animated corrective blend shapes. The animation works fine, but as you can see on the screenshot the shading is completely broken.

I’ve tried to solve the issue, but it didn’t get me anywhere, so I’ve decided to go with a simplier setup - setting up the blend shapes on a basic cylinder. The setup is simple: 3 bones, 2 of which influence the mesh, classic linear skinning, corrective blendshape made over mesh deformed by animation.

I did my testing on 3 slightly different setups :
a) a cylinder with default Maya smoothing;
b) a cylinder with soft/hard edges manually assigned;
c) a cylinder with soft/hard edges made using the script Maya unlock normals without destroying smoothing information — polycount (doesn’t really make a lot of sense in this case, but my character is made in Max, so might be useful in that case. An).

As you can see on the screenshot, the shading breaks too. It is not that obvious on static image, but when you move around it looks totally wrong.
I have tried a lot of stuff, and none of it works, am I missing something? I feel like it should be much simplier and I am missing something obvious, but can’t put my finger on it.

What is correct pipeline that works for you guys?

Or maybe I am misunderstanding blend shapes in animation, and they should be used for very minor corrections? They seem to work fine when I do extremely simple modifications, like ribcage expanding on breathing in, but in cases like fixing the elbow when the skinning can no longer hold the shape it just breaks.

What I have tried so far:

  1. Countless combinations of checkboxes (like export / import smoothing groups, import normals, import normals and tangents, etc.) both on export and import.
  2. Different software versions I have available at work and at home: Maya 2018 and 2019, UE 4.22.3 and 4.23.0, FBX ver. 2011, 2018, 2019.
  3. In Maya I’ve tried different combinations of locked and unlocked vertex normals, soft and hard edges, even used a script I found to convert locked vertex normals to soft and hard edges: Maya unlock normals without destroying smoothing information — polycount
  4. Tried making corrective blend shapes using sculpting, and tried with only moving vertices by manipulator (thought maybe sculpting does something to vertex normals). Used shape editor, and also tried manually making blend shapes. I even went as far as made whole pose as a blend shape, but it didn’t help too…
  5. Changed evaluation order so the blend shape is computed before the skin cluster. Though Unreal doesn’t care and evaluates morph target after the skin no matter how I set it up in Maya. But it doesn’t help too as I see shading issues anyway.
  6. I’ve lost track of what else I did, so I am out of ideas on how to fix it.

Thanks for any advice or suggestions :slight_smile:

Tick Recompute Tangent in mesh asset details, under LOD 0

Hm, I can’t seem to find the setting both in 4.22.3 and in 4.23.

The search in the panel doesn’t yield results either.

Someone suggested I should try the following checkboxes in the project settings. Probably somehow related as it is also about recomputing tangents.

Support Compute Skincache
Force all skinned meshes to recompute tangents

This actually solves my issue, and is a huge relief. Though there is a drawback - UV seams are now noticable where they were invisible previously. Far from ideal, but looks a lot better than what I had. I did some Google search on the issue and found people mentioning it as persistent bug that is still in the engine from like 4.16

I will keep this solution in mind, but would like to learn how to properly import morph target without such radical actions :slight_smile:

I believe that’s as good as it gets, there is no proper way of doing it. Another odd behaviour I found is that it messes with normal maps and you need to flip the green channel when you recompute tangents.

It’s not a Blend Shape issue as much of a starting Weight Paint issue for the elbow.
If you set a better starting base paint you can then have less of a bad effect.

The idea behind the corrective shape is to use the rotation rate of the bone to apply or subtract the shape.
Picture it this way, if the elbow is fully bent you have a morph target with a value of 1, if the elbow is completely open (or overextended) you have a blend shape value of 0.

The issues you are seeing have literally nothing to do with Shading and everything to do with Vertex Distortion.

The reason you don’t see the issue in your 3d program but see the issue in UE4 is Floating Point Precision. UE4 trims your weights when importing to a minimum threshold. So, ideally you want to re-paint your whole mesh or scale up (add) .1 to all of your mesh paint in order to get the weights to not get trimmed during import.

To verify that the vertices are Off, drop your FOV to something like 1 and go into Wireframe view.
Pan around and you should see that some vertices spike up or down.
Ideally, your morph target should take care of modifying that shape and putting those vertices back in a nice smooth form.
However you can’t expect it to work right if your initial paint values get truncated and the initial shape is not 1:1 with the morph target.

Thanks for the info, **MostHost LA. **I didn’t think Unreal truncates weights, good to know! I usually force normalization of 4 influences per vertex so their sum equals 1. I will try and look for a solution on how to keep all weights over 0.1. Maybe I’ll write a script to multiply every weight influence by some modifier. Could work, I guess.

I did some more careful tests during last couple of days. I usually get desired results when working with simple meshes like cylinders, but once I get back to complex shapes (characters, clothing), I still get artifacts here and there.

I’ve decided to stick with forced recalculation of tangents in Project Settings for now. While it has some issues with UV seams, it has accaptable quality, so it is good enough for me.

Thanks for the help and suggestions! :slight_smile: