Export Modified Normals to FBX for Unity?

Export Modified Normals to FBX for Unity?

acornbringer
Enthusiast Enthusiast
10,192 Views
37 Replies
Message 1 of 38

Export Modified Normals to FBX for Unity?

acornbringer
Enthusiast
Enthusiast

In order to have interchangeable elements on my character model for use in game, I have separated my single body mesh into parts. For example, the head has been extracted from the main body mesh so it can be replaced with different head models.

 

To match the vertex normals at the edged of each mesh, I took them and averaged them out so they point in the same direction. In Maya, the seam is completely hidden but when I export to .fbx and bring into Unity, the edge vertex normals change back and show the seam. (Check out the attachment for a visual of what I'm seeing) I've also noticed that importing the .fbx back into Maya yields the same result - the edge vertex normals are no longer averaged and show a seam.

 

Is there something I'm missing when exporting to .fbx? It seems like with the way I'm going about it now, the locked normals aren't being carried over.

 

I'd really appreciate any input on this! Thanks 🙂

 

LockedNormals.png

0 Likes
10,193 Views
37 Replies
Replies (37)
Message 2 of 38

acornbringer
Enthusiast
Enthusiast

I'm just now discovering an important element to this issue: It seems like when I export the mesh with out blend shapes, I get the smooth edge result I expect. When I apply the blend shapes to the mesh, I then then see the seams again after exporting.

 

I'm now looking for a way to keep the blend shapes from effecting the normals of my base meshes. In the mean time, I would still appreciate any input if someone is familiar with this issue 🙂

0 Likes
Message 3 of 38

mspeer
Consultant
Consultant

Hi!

 

Try Edit -> Delete by Type - Non-Deformer History

0 Likes
Message 4 of 38

acornbringer
Enthusiast
Enthusiast

I usually do this before export but just to make sure, I went back and tried it again but I'm getting the same results.

0 Likes
Message 5 of 38

sean.heasley
Alumni
Alumni

Hi @acornbringer

 

You could try selecting the edge and going to Mesh Display->Soften Edge.

 

Let me know if anything changes!

 

 

If one or more of these posts helped answer your question, please click Accept as Solution on the posts that helped you so others in the community can find them easily.

 

 

 

Kudos are greatly appreciated. Everyone likes a thumbs up!

0 Likes
Message 6 of 38

acornbringer
Enthusiast
Enthusiast

Softening the edges does not fix this issue. The edge normals are locked when averaged to create a smooth look across the two separate mesh edges. Everything looks fine in Maya but when the mesh is exported to .fbx and brought into Unity or back into Maya, the normals are recalculated and show a hard edge again instead of the smooth normals I created.

 

If I export the file as a .mb and bring that into Unity or back into Maya, the normals stay locked so I know it's not some kind of incompatibility with Unity. Could it be that .fbx is unable to export this data? I'm hoping there is an export setting I'm missing because I can't use .mb in my game.

0 Likes
Message 7 of 38

sean.heasley
Alumni
Alumni

Hi @acornbringer

 

Its possible it might be an issue with Unity not being able to read it.

 

When you get a chance, can you please zip and attach the scene file here or via dropbox/google drive or another file sharing program so I can take a look at it?

0 Likes
Message 8 of 38

acornbringer
Enthusiast
Enthusiast

Sure thing @sean.heasley and thanks! Here is the scene for you to take a look at.

 

If you export this character as an fbx and bring it into Unity, you should see the seam around the neck just like in the image I attached to the main post.

 

Things worth noting while you are in there:

 

- All the vertex normals are being calculated and smoothed by Maya accept the edge normals on the neck. Those are the ones I averaged to get them to look smooth despite not being one contiguous mesh.

- There are blend shapes currently applied to the character model and the clothes. Removing the blend shape from the head and body will fix the normals issue when brought into Unity or back into Maya as an fbx.

 

I'm eager to know what you find! Thanks again 🙂

0 Likes
Message 9 of 38

sean.heasley
Alumni
Alumni

Hi @acornbringer

 

Thanks for attaching the scene files!

 

I deleted the clothing and just selected the body and head of one of the characters and exported as an fbx to Unity and had no issues.

 

I guess the seam is technically visible but it's barely noticeable on my machine.

 

character.png

 

 

Here are my export settings as well for reference.

 

fbx.png

 

 

It could be something in your fbx export settings and or something with your Unity. You may want to check to make sure Unity is up to date and or uninstall/reinstall it!

 

 

If one or more of these posts helped answer your question, please click Accept as Solution on the posts that helped you so others in the community can find them easily.

 

 

 

Kudos are greatly appreciated. Everyone likes a thumbs up!

 

 

 

 

0 Likes
Message 10 of 38

acornbringer
Enthusiast
Enthusiast

 

@sean.heasley I would definitely say things are working just fine on your end! When I get a seam, it's very apparent.

 

Unfortunately, even after copying your export settings, I still see the same results. Are the blend shapes still working in Unity on your end? If they were removed, the seams wouldn't show up for me either.

 

I'll download and try it with a new version of Unity - currently I'm on 5.6 - and see if that changes anything. In the mean time, would you mind sharing your Unity import settings as well? Those are much easier to switch on and off to see what effect they have but maybe I'm still missing something.

 

And thanks a lot for your help this far!

0 Likes
Message 11 of 38

sean.heasley
Alumni
Alumni

Hi @acornbringer

 

Yup blendshapes work fine. You may want to check your import settings on Unity as well just to be safe!

 

Let me know how updating Unity works for you!

0 Likes
Message 12 of 38

acornbringer
Enthusiast
Enthusiast

@sean.heasley I got Unity 2017 installed and exported from Maya using your fbx settings and importing using the default settings and I'm still seeing the same problem with the seam. Changing these model import settings here in the inspector doesn't seem to change anything for me.

 

MayaUnityExportSettings.png

 

I'm wondering if maybe the problem is with Maya and how it's exporting. With my version of Maya 2015, I have by default the FBX plugin 2014. I don't know if there's a way for me to update the plugin with out also updating Maya.

Just to test this out and maybe single out what program is starting the issue, would you mind importing the attached FBX into Unity and let me know what you see? If it's not showing the seam for you than something's going on with Unity, if you do see the seams now, it's probably a Maya problem.

 

I appreciate it!

 

 

Message 13 of 38

sean.heasley
Alumni
Alumni

Hi @acornbringer

 

Thanks for attaching the file!

 

Yup I can see the seam with this one in Unity and I can also see it in Maya.

0 Likes
Message 14 of 38

acornbringer
Enthusiast
Enthusiast

@sean.heasley Thanks for confirming that for me!

 

I just went back in and deselected all the Include > Geometry check boxes and found that the seams went away when I exported. Then I went on to checking them all individually and discovered that the "Smoothing Groups" option was causing the edges to become visible. Unfortunately for me, the caveat to deselecting that option is that when I import the mesh into Unity and adjust my blend shapes, the normals don't seem to adapt properly. In other words, when the character is in "Male" form, the mesh keeps the normals from the "Female" form.

 

I'm not completely sure what to do now because of the results you are getting but considering it's almost working for me aside from the normals not updating as the blend shapes move I'll look into that issue and see if something comes up.

0 Likes
Message 15 of 38

sean.heasley
Alumni
Alumni

Hi @acornbringer

 

When you say normals, do you mean the vertex normals of the male model or an actual normal map?

 

How different are the normals from the male to female model?

0 Likes
Message 16 of 38

acornbringer
Enthusiast
Enthusiast

@sean.heasley I mean the vertex normals. An easy way to see if there is a problem is to take the character's head in Unity and scrub through that blend shape. You will notice that the lighting on the lip doesn't change even though those polygons actually flip up-side-down. At least, that's what I'm seeing in my scene.

 

If you would, re-export the character from Maya and see if the blend shape normals are locked or change as the mesh deforms.

0 Likes
Message 17 of 38

acornbringer
Enthusiast
Enthusiast

I stumbled across this entry in the Unity Issue Tracker. It seems to be describing exactly what my issue has been.


Unity Issue Tracker - Blendshapes Do Not Update Normal Directions

 

Unfortunately it remains to be resolved so it seems like I'll need to rethink my workflow for this character.

 

@sean.heasley If by some magic your normals update in real time, I may just want to update my version of Maya to get this to work 😛 You are using 2018 right?

0 Likes
Message 18 of 38

sean.heasley
Alumni
Alumni

Hi @Acornbringer

 

Good catch with that article and it's definitely possible its an issue on their end.

 

I went ahead and made this video of myself going to Unity with the files so we can make sure no steps are being missed etc.

 

 

 

 

 

 

Let me know if anything changes!

Message 19 of 38

acornbringer
Enthusiast
Enthusiast

@sean.heasley Thanks a bunch for that video!

 

One thing I'm still left wondering is if you see correct normal calculations while moving the blend shapes in Unity when the seams are also smoothed. If you take a look at this video, I show what I'm seeing go wrong in Unity when I export under two different circumstances.

 

 

Aside from the blend shapes not working properly while the edges are smooth, something else I find strange is that while you export with Smoothing Groups and see no seams, I see the inverse effect where exporting Smoothing Groups causes seams.

 

Let me know what you think and if you are able to get the blend shape normals working along with the edge seam normals.

 

Thanks again!

0 Likes
Message 20 of 38

sean.heasley
Alumni
Alumni

Hi @acornbringer

 

This is a tough one Smiley Frustrated

 

I just tested on my laptop which is Unity 5.6.0 and the blendshapes actually wouldn't import for some odd reason.

 

I'm gonna do a bit more in depth testing and I'll get back to you tomorrow with a more detailed post.

 

Let me know if anything changes!

0 Likes