Page MenuHome

FBX exporter : average vertex normal is apply. Recalculate normals, average (or remove double vertices) changing the direction of the model mesh with custom vertex normal.
Closed, ArchivedPublic

Description

System Information
Operating system: Windows 10 64 Home
Graphics card: GTX 1080Ti

Blender Version
Broken: Version 2.80 Beta e7356bb01198, 2019-07-02 13:31

FBX exporter: custom vertex normals direction change when imported into Substance Painter

Exact steps for others to reproduce the error

VIDEO LINK

  • Open .blend Blender file and inspect the custom vertex normal.
  • The custom vertex normals are correct as shown in the screenshot (.zip).
  • And export the mesh with custom vertex normals as FBX with both ‘normals only’ and ‘edge’ smoothing.
  • Open it in Painter assign a metallic material to inspect the vertex normal direction as shown in the screenshot.
  • Painter vertex normal direction is not correct. Looks like an average vertex normal was applied.

Looks like Painter is not opening correctly the Blender FBX or
more possible,
the FBX exporter is recalculating (making average) of custom vertex normals or applying to remove double vertices when exporting.

Somehow exporting FBX from Blender the vertex normals are not imported correctly in Painter. If you import the Blender FBX to Unity or Rhinoceros, the custom vertex normals are correct. So in the first impression looks like is a Substance Painter side.
But it can be not the case because the exact same FBX Blender file, imported to Rhinoceros3D and exported from Rhinoceros3D as FBX, is imported correctly into Substance Painter. This means that Rhinoceros is somehow fixing the Blender FBX.

Conclusion after one-week debugging was that the FBX communication between Blender and Painter is not working well.

I submit the same bug to Substance Painter.

Painter ref:bug-21e1321f

As a user, I can't talk to Algorithmic: Please talk to each other.

The OBJ instead is working fine when is imported to S. Painter.
Consider in the FBX user interface a boolean to toggle off recalculating normals (so that custom vertex normals are preserved).

Enclose you will find:

  • Blender file including the mesh with custom vertex normals.
  • ZIP: Screenshots of the Blender FBX vertex normal direction inside Blender, Painter, Rhino and Unity software. FBX file exported from Blender, Blender FBX, Rhino FBX, Blender OBJ.


Details

Type
Bug

Event Timeline

Alan Mattano (AlanMattano) renamed this task from FBX exporter is applying removing vertex dobble and changing vertex normals to FBX exporter is applying remove double vertices (changing vertex normals)..
Alan Mattano (AlanMattano) renamed this task from FBX exporter is applying remove double vertices (changing vertex normals). to FBX bug: exporter is applying remove double vertices (changing vertex normals)..
Alan Mattano (AlanMattano) renamed this task from FBX bug: exporter is applying remove double vertices (changing vertex normals). to FBX bug: exporter is applying recalculate normals (or remove double vertices) changing the direction of the model mesh vertex normal..
Bastien Montagne (mont29) triaged this task as Needs Information from User priority.

This is not a clear description of the issue

Please follow our submission template and guidelines, also read these tips about bug reports, and make a complete, valid bug report, with required info, precise description of the issue (only ONE issue per report!), precise steps to reproduce it, small and simple .blend and/or other files to do so if needed, etc.

I will update as soon as possible.

I'm working hard trying to reproduce the problem for 2 days. Please be patient I will replay as soon as I get the correct mesh example, screenshot and workflow for debugging better the problem. Other software was exporting bad so I want to create no confusion providing a good clean example in the latest Blender version.

Alan Mattano (AlanMattano) updated the task description. (Show Details)EditedJul 19 2019, 10:06 AM

I was able to isolate and enclosed the file containing the mesh but not the workflow. Please be patient.

Alan Mattano (AlanMattano) updated the task description. (Show Details)EditedJul 19 2019, 8:40 PM
  • The zip file was added
  • New better description

Video version:

For debugging, better to use the latest "Video-bugReport.blend" and not the .Zip Blender file.
Video with the description of the file:
VIDEO: https://youtu.be/_-gqR8_-iRw

Updated screenshots, FBX .ZIP file

Alan Mattano (AlanMattano) renamed this task from FBX bug: exporter is applying recalculate normals (or remove double vertices) changing the direction of the model mesh vertex normal. to FBX exporter bug: exporter is applying recalculate normals, average (or remove double vertices) changing the direction of the model mesh vertex normal..Jul 21 2019, 10:01 PM
Alan Mattano (AlanMattano) renamed this task from FBX exporter bug: exporter is applying recalculate normals, average (or remove double vertices) changing the direction of the model mesh vertex normal. to FBX exporter : average vertex normal is apply. Recalculate normals, average (or remove double vertices) changing the direction of the model mesh with custom vertex normal..Jul 21 2019, 10:04 PM
Bastien Montagne (mont29) closed this task as Archived.Jul 22 2019, 4:58 PM

Thanks for the extend effort put in this report!

I think we already had kind of exact same report recently actually… Issue is that your mesh has some double vertices (two vertices at the exact same location), Blender does nothing to them, it just keeps them as-is (you can see that by exporting/re-importing thet mesh through FBX, you keep exact same amount of vertices, 32106).

But that seems to be an issue for Substance, which then merge them when importing FBX file (and presumably does not handle properly custom normals while doing so). So answer will be same as in other report: this is not a Blender issue, afaik.

PS: Ideally you should be able to fix the issue in Blender with Merge Vertices By Distance, but unfortunately that tool does not yet handle properly custom normals either…

Yes, hard surface modelling mesh has and need some double vertices (two vertices at the exact same location) as a flat transition between a flat surface and perfect radius surface. For this reason, the mesh needs this double vertex. Is made in purpose for getting a better custom vertex normal. Blender does nothing to them, it just keeps them as-is and that is nice and perfect.

Yes at first impression looks like Painter is failing and is not importing well but why Rhino can and Blender can't?
The Painter problem goes in hand with Blender.

What is interesting here is that Rhino FBX exporter is working well with Painter. And exporting from Rhino FBX to Substance Painter, when importing, it does not apply this average (to the vertex normals). So Rhino FBX exporter setup is making something more than Blender FBX exporter is missing or failing. So I included in the ZIP the Rhino FBX so that you can compare and look for a difference. I try using WinMerge but I was unable to understand.

Can you check if in the Rhino FBX included in the ZIP has the same amount of 32106 vertices?
And if the answer is yes, maybe the FBX header information?

Is there inside the FBX code file a setup (a boolean a parameter or a property) that explicitly asks to the application that is opening to import custom vertex normal?
For example, in Rhino I'm exporting in FBX version 7 and binary.
Can be that by default Blender exporter is saving in ASCII or another FBX version?
So that Painter is not picking up and failing reading the custom normals.

There is no way for the exporter to "say" anything to the future importer app. Each app exports and imports those files its own way. The FBX files exported by Blender are perfectly valid ones, cannot go much further really. I am not going to spend hours manually diffing the two FBXs to see what is different in them (could be the way the normal data are mapped to the faces' corners, or many other things). If other 'reference' apps like Unreal or the Autodesk products load Blender's FBX fine on that respect, then it’s up to Substance to fix their code to comply to FBX "standard" (even though there is no such thing, unfortunately…).

Both Rhino and Blender FBXs import in Blender exactly the same way, with same data, same normals, same amount of vertices, as far as I can see…

PS: no, you do not have to split your geometry to get proper 'hard' edges, there are many other ways to do so in modern softwares, mostly 'sharp' edges/ 'flat' faces tags (simpler solutions), and custom normals, which are stored per face corner and not per vertex, and hence allow for fully customized shading (though a more complex solution to set-up).

For example, in Rhino I'm exporting in FBX version 7 and binary.
Can be that by default Blender exporter is saving in ASCII or another FBX version?

Ok, Blender is exporting in FBX binary same as Rhino, because the ASCII file is x5 times bigger.
I was trying to help!
I place the bag also to Substance Painter in case you want to talk to them.
Painter ref:bug-21e1321f
Thanks for listening