Problem: Artifacts on surface of character model when BlendShapes (via Blender) are present

(EDIT: Fixed in Blender v2.72!)

For the last couple of days I’ve been struggling with BlendShapes in Unity, or more specifically, I’ve been struggling with issues caused by the presence of BlendShapes (which I’m using for character customization purposes). Without BlendShapes, my character model (based on a model exported from MakeHuman, though it does not seem to be particular to models originating from that software) appears fine in Unity. However, if I add BlendShapes - in the form of Shape Keys in Blender - artifacts appear on the surface of the character model after importing it to Unity. See attached screenshot.

I cannot for the life of me figure out why this is happening; I’ve flipped normals like they were pancakes, recalculated them too, triangulated the mesh, UV unwrapped in different ways, tried cleaning up the mesh as best I could, tried every single mesh-adjusting option in Blender, with very little to show for. It matters not if the Shape Keys are “empty” or actually contain shape changes. Neither does the format in which the model is imported to Unity seem to matter (I’ve tried .blender and .fbx exported from three different Blender versions). Switching to unlit shaders in Unity hides the problem to some extent, but does not fix it.

I’ve found only one “solution” so far. It is an ugly hack that involves scaling the character model up 5 times in Blender, applying scale transform, then scaling it back down to regular size without reapplying scale transform. Ye gods! :eyes: After that, it works perfectly in Unity; no artifacts, the rig works, animations, textures, blend shapes, all good.

This hack does not, however, seem like a long-term solution. Any other suggestions for fixing the issue and/or thoughts on what could be causing it?

A zip-file with a test-model from Blender is attached, containing some dummy Shape Keys.

1654307–103288–testmodel_shapekeys.zip (1.2 MB)

So, a month has passed, and I’m going nowhere fast with this issue. I have found out that more problem areas appear when subdividing the mesh, and that un-subdividing the mesh causes the existing problem areas to shrink - but I’ve tried un-subdividing it all the way down to the early 1990s and the black artifacts are still showing up in locations such as the nose/fingertips (observe screenshot).

At this point I have tweaked and adjusted and cursed my way through all of Blender’s features (and Unity’s import settings), and nothing seems to get rid of the problem except for scaling the model up ~5 times (yay for 8m tall humans!), applying the scale transform, and then either leaving it like that and scaling it to a usable size through Unity’s importer settings, or scaling it back down in Blender without applying the new scale transform.

I’m stumped. :frowning:

The problem appears to be in relation to the Normals. if I take your sample file, export as FBX and import to Unity I get the same issue as the first screenshot when the Normals are set to Calculate, but it seems fine when set to Import.

Interesting. I get the artifacts using the sample file no matter if the Normals setting is Calculate or Import. What options did you use when you exported the FBX, and which version of Blender? Thanks for the reply, btw.

Note, that the visibility of the issue depends on the lighting in the scene (whether the character is facing a light source or not, for instance).

I’m a Blender noob, so I just grabbed the latest version off the site (2.71), installed and then just exported with whatever the default settings where. Here’s the settings on the export panel:

For comparison, here’s what I’m seeing in Unity: -

Blend File, Normals Imported:

FBX File, Normals Calculated (Blend with Calculate gives similar to this as well):

FBX File, Normals Imported:

Ah. Hm. Does the mesh still have the blendshapes, though? I thought I read earlier that the FBX exporter in Blender 2.71 doesn’t currently export shape keys (will be re-added for in 2.72).

This is correct… though you can still use the legacy exporter for ASCII and I think it might still export the blend shapes.

Blender noob here, so no idea. I’ll upload the FBX here and let you check it :slight_smile:

In regards to the issue as a whole, the fact that your hack actually solves the problem makes me think that the resizing is forcing blender to re-calc whatever data is causing the import issue.

1692120–106195–testmodel1.rar (970 KB)

Thanks!

Alas, as suspected, the blendshapes are not included in the FBX you uploaded, which would explain why the artifacts aren’t showing up. However, since very similar artifacts do actually appear when import settings for normals are set to Calculate, even without blendshapes, it seems like the issue does have its roots in the normals, somehow.

I did another quick export to FBX using the ASCII format and both Calculate and Import gives the error :frowning:

You can download the standalone .zip file:

http://download.blender.org/release/Blender2.70/blender-2.70-windows64.zip

That’s 2.7 which has the old exporter. You should be able to just extract the zip to a folder and run Blender standalone from it without installing… that way you have the old exporter to fall back on.

I see you attached the .blend earlier… I’ll play with it.

One workaround posted on the Answers site suggests exporting FBX from Blender, importing it into 3ds Max, then re-exporting the FBX from there. This seems to work (I tested using the trial version of 3ds Max 2015), though there’s a couple of caveats:

  1. You need access to 3ds max to use this workaround.
  2. 3ds max supports a maximum of 100 morph targets and will thus crash if you try to import an FBX from blender with more than 100 shape keys in it.
1 Like

How many shape keys does Unity support? I thought it was much less than 100 :slight_smile:

I have a mesh which currently has something like 106 shape keys on it (combined body & facial morphs), and all of those shape keys work fine in Unity :slight_smile:

Submitted a bug report about this to Blender: #41316 - FBX exporter in Blender cause artifacts to appear on meshes with Shape Keys - blender - Blender Projects

Hi,

don’t know if it helps now, but I had the same problem and solved it applying the scale to my mesh in blender. I had a mesh with the following scale values x=1.0 y=0.92 z=1.0. When exporting to Unity with fbx, it showed the same artifact that you have discussed here. Then I tried to apply the scale in Blender (Ctrl + A and then choosing scale) and solved this issues.
This solution came to my mind trying with a previous model that worked without problems. While trying to resize it in unity I noticed the artifact showing up when the scale was different on the three axes, but everything fixed when the scale was the same.

It seems they’ve fixed it for fbx-exports. But Blender files still have the same problem. I think Unity is using an old fbx-exporter when importing from Blender. It would be nice if they fixed that …

Sorry for necroing this thread. But I noticed that I have this exact same issue if I export a fbx with blendshapes from Blender 2.77. Is there another workaround besides importing the fbx from 3ds max?

Image:

Thanks for your time!

Since you already bumped this thread…
I am having the same exact issue with a particular blender model.

Right now I dont know if its a blender issue or Unity issue. I replace the skinned mesh renderer with a regular mesh renderer, and the problem goes away.
There is some issue with the normals.
.

I just want to confirm that the hack mentioned by Xoduz in the second reply (scaling up 5-10x, applying scale) does work for me too.
I didn’t see it at first and went through the entirety of the internet until I found the info elsewhere. Went back here and there it was all along! :sweat_smile: :slight_smile:
And it makes sense since the artifacts are appearing always in areas with a lot of detailed (small) geometry.