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. #66925

Closed
opened 2019-07-14 17:35:07 +02:00 by Alan Mattano · 17 comments

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.

Forza 04 Bug 01 import .blend
FBX_and_Sceenshots.zip

**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 ](https://youtu.be/_-gqR8_-iRw) - 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. [Forza 04 Bug 01 import .blend](https://archive.blender.org/developer/F7617894/Forza_04_Bug_01_import_.blend) [FBX_and_Sceenshots.zip](https://archive.blender.org/developer/F7622189/FBX_and_Sceenshots.zip)
Author

Added subscriber: @AlanMattano

Added subscriber: @AlanMattano
Alan Mattano changed title from FBX exporter is applying removing vertex dobble and changing vertex normals to FBX exporter is applying remove double vertices (changing vertex normals). 2019-07-14 17:36:01 +02:00
Alan Mattano changed title from FBX exporter is applying remove double vertices (changing vertex normals). to FBX bug: exporter is applying remove double vertices (changing vertex normals). 2019-07-14 17:36:25 +02:00
Alan Mattano changed title 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. 2019-07-15 04:20:12 +02:00

Added subscriber: @mont29

Added subscriber: @mont29

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.

This is not a clear description of the issue Please follow our [submission template and guidelines](https:*developer.blender.org/maniphest/task/edit/form/1/), also read [these tips about bug reports](https:*wiki.blender.org/wiki/Process/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.
Author

I will update as soon as possible.

I will update as soon as possible.
Author

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.

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.
Author

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

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

PainterFBX-Bug-vertexNormalDirection.png

BlenderFBX-Import.png

![PainterFBX-Bug-vertexNormalDirection.png](https://archive.blender.org/developer/F7618601/PainterFBX-Bug-vertexNormalDirection.png) ![BlenderFBX-Import.png](https://archive.blender.org/developer/F7618603/BlenderFBX-Import.png)
Author
  • The zip file was added
  • New better description
- The zip file was added - New better description
Author

Video version:
Video-BugReport.blend

Video version: [Video-BugReport.blend](https://archive.blender.org/developer/F7621351/Video-BugReport.blend)
Author

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

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 ](https:*youtu.be/_-gqR8_-iRw)
Author

Updated screenshots, FBX .ZIP file

FBX_and_Sceenshots.zip

Updated screenshots, FBX .ZIP file [FBX_and_Sceenshots.zip](https://archive.blender.org/developer/F7622189/FBX_and_Sceenshots.zip)
Alan Mattano changed title 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. 2019-07-21 22:01:29 +02:00
Bastien Montagne was assigned by Alan Mattano 2019-07-21 22:01:29 +02:00
Alan Mattano changed title 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. 2019-07-21 22:04:29 +02:00

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

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…

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…
Author

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 ASCIIor another FBX version?
So that Painter is not picking up and failing reading the custom normals.

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).

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).
Author

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?

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?
Author

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

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
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#66925
No description provided.