0
$\begingroup$

I've been trying to use a human based Yoshi model in unity. This model will be used for .VRM based animations. The model includes shapekeys for opening and closing the mouth, eyes and eyelids. In theory, these shapekeys work in unity and morph the geometry just as in blender. However, when adjusting a shape, all connected geometry gets darker and has the shader change the appearance of the model.

At first I considered that it only does so around non-quad and topologically inconsistent faces, but even after retopologizing it still occurs on the mesh that has shapekeys attached. Splitting the model based on geometry (only eyes and mouth are one merged geometry with all shapekeys affecting only that area, but not cheeks or the rest of the body for example) confirms that it only changes the shader on the connected geometry.

unity

The above is an example of what happens when I apply all shapekeys. I did so to illustrate how strong the corruption can get. It is still not subtle, even with only one shapekey active; this is the worst case. This is an example of the model in wakaru with applied VRM format and only one active Shapekey:

wakaru

This is as subtle of an effect as I can get... I have also tried different shaders in unity itself, but all are distorted by using shapekeys... My thought is that the .fbx exporter loses some detail when exporting geometry to unity and believes that each shape contains additional info about vertex movement that isn't directly affected by a shapekey. So if I had a shapekey that moves the upper left eyelid down, it might try to set every other vertex that isn't modified to a slightly different value (potentially float truncation or something).

I suppose my question is: how do I export from Blender to Unity with shapekeys and without this distortion? Is there something I am doing wrong during the export process? Please let me know, I am stumped after re-topologizing and adjusting for hours without any success...

EDIT: I have tried a variety of fixes with normals. I have done a bunch of 3-d printing and know better than not to hit ctrl-n before and export ;). However, that doesn't really seem to be the problem. For testing purposes I inverted the normals to face the wrong way and the issue persisted on top of the object simply being culled (Please ignore missing textures, that's a leftover from my retopologizing and texturing with baked maps instead of geometry).

Here is an example with correct normals, inactive and active shapekeys: correct normals, inactive shapekeys correct normals, active shapekeys

and an example of incorrect normals, inactive and active shapekeys (plus from the back to see that faces are being culled due to incorrect normals): incorrect normals, inactive shapekeys incorrect normals, active shapekeys rear view incorrect normals, active shapekeys

$\endgroup$
4
  • 1
    $\begingroup$ Hi and welcome :) Firstly, is your Q about unity or blender? At first it seems to be about unity, and then seems to change a little. I suggest an edit to make this more clear. Secondly, I think that you will have better luck exporting finished animation rather than shapekeys to begin animation in another software, others here may know better. $\endgroup$ Commented Oct 27, 2020 at 5:13
  • $\begingroup$ Welcome to BSE @sbruendl , from the look of the images, this looks related to normals, I've seen such cases a lot when importing 3D files, this has a fix in Blender when dealing with imported files, but I don't know about Unity, I suggest try to make sure that all normals are facing the right direction in Blender before exporting the file, and make sure you're not using normal editing modifiers $\endgroup$
    – Georges D
    Commented Oct 27, 2020 at 8:08
  • $\begingroup$ @Georges I adjusted the original post to show that I doubt that it's about normals. It seems to mostly occur with correct normals whereas it simply disappears when incorrect. $\endgroup$
    – sbruendl
    Commented Oct 27, 2020 at 17:53
  • $\begingroup$ @Timaroberts I am struggling trying to put Unity as the leading tag on here, it seems to be in alphabetical order, should I sacrifice other tags to make it more clear? Either way, I'll try looking into modifying shapekeys in unity itself. What would you suggest "exporting animation" to look like? Would it be entirely armature based? The reason I am so desperate about shapekeys is because the VRM format uses them to switch between gestures and facial expressions in the exported file. Warping between an "A" and "E" is done this way, so I am not sure if I can sacrifice shapekeys altogether. $\endgroup$
    – sbruendl
    Commented Oct 27, 2020 at 17:57

1 Answer 1

0
$\begingroup$

I tried my plan B and simply imported the .blend file instead of the .fbx file since I assumed the exporter was modifying each shapekey. My hypothesis may be correct since the error is subtle to a point of negligibility (unless I activate more than 5 shapekeys at once). I consider this a solution: simply import the .blend instead of exporting a .fbx and re-importing it to unity.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .