FBX and USD import is broken - blender does not detect custom normals, puts hard edges where they are not. #120590

Open
opened 2024-04-12 18:33:14 +02:00 by Igor Unguryanov · 20 comments

System Information
Operating system: Windows-10-10.0.22631-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3090 Ti/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 551.86

Blender Version
Broken: version: 4.1.0, branch: blender-v4.1-release, commit date: 2024-03-25 20:42, hash: 40a5e739e270
Worked: (newest version of Blender that worked as expected)

Short description of error

4.1 4.0
image image

When importing a model in FBX or USD format from Houdini, I get problems with normals. For some reason I get hard edges where they should not be.
UDS import is broken in both versions. FBX import since version 4.1

image

**System Information** Operating system: Windows-10-10.0.22631-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3090 Ti/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 551.86 **Blender Version** Broken: version: 4.1.0, branch: blender-v4.1-release, commit date: 2024-03-25 20:42, hash: `40a5e739e270` Worked: (newest version of Blender that worked as expected) **Short description of error** | 4.1 | 4.0 | | -- | -- | | ![image](/attachments/d55b84f5-c262-4a2e-a0d8-d8c26626e71c) | ![image](/attachments/e826cc00-3c24-4e49-b7de-024f150e7c02) | When importing a model in FBX or USD format from Houdini, I get problems with normals. For some reason I get hard edges where they should not be. UDS import is broken in both versions. FBX import since version 4.1 ![image](/attachments/d42e6364-9c4a-434e-acfe-b6b8b67ef417)
1021 KiB
2.5 MiB
1.5 MiB
Igor Unguryanov added the
Status
Needs Triage
Priority
Normal
Type
Report
labels 2024-04-12 18:33:14 +02:00

I confirm. I too have encountered this problem.

I confirm. I too have encountered this problem.

Hi, can you check this: #120173 (comment)

Hi, can you check this: https://projects.blender.org/blender/blender/issues/120173#issuecomment-1158915

It is important to save custom normals when importing! Resetting normals is not a solution, also if you remove hard edges, shading breaks, which is also not a solution.

It is important to save custom normals when importing! Resetting normals is not a solution, also if you remove hard edges, shading breaks, which is also not a solution.

if you delete custom normals and then delete sharp edge, the shading of the model breaks.

if you delete custom normals and then delete sharp edge, the shading of the model breaks.

First of all, can you attach example files?

First of all, can you attach example files?
Iliya Katushenock added the
Interest
Modeling
label 2024-04-12 18:47:56 +02:00

First of all, can you attach example files?

> First of all, can you attach example files?
1.2 MiB
2.0 MiB
@HooglyBoogly /

I confirm. I too have encountered this problem.

I confirm. I too have encountered this problem.
Member

OK, the other linked report ( #120173 ) was different I think (as-in: the custom normals were not used there.

Here though, they are, and it just seems the custom normals are applied differently (and wrong it seems)

This is the same vertex in 4.0 after FBX import with (no sharp edges) custom normals

image

This is the same vertex in 4.0 after FBX import without (no sharp edges) custom normals

image

This is the same vertex in 4.1 after FBX import with (no sharp edges) custom normals

image

This is the same vertex in 4.1 after FBX import without (no sharp edges) custom normals

image

Will confirm for now. @HooglyBoogly : am I missing something or is this really wrong in 4.1?

OK, the other linked report ( #120173 ) was different I think (as-in: the custom normals were not used there. Here though, they are, and it just seems the custom normals are applied differently (and wrong it seems) This is the same vertex in 4.0 after FBX import with (no sharp edges) custom normals ![image](/attachments/a355dddb-ad4f-436f-851c-14054a442965) This is the same vertex in 4.0 after FBX import without (no sharp edges) custom normals ![image](/attachments/fd0b9fa5-80f0-4e9f-9486-969865d69362) This is the same vertex in 4.1 after FBX import with (no sharp edges) custom normals ![image](/attachments/014529c7-4f97-49b8-9281-b1a90ead56cb) This is the same vertex in 4.1 after FBX import without (no sharp edges) custom normals ![image](/attachments/4b939a64-fd62-4ec8-a826-86d24eb9ed4b) Will confirm for now. @HooglyBoogly : am I missing something or is this really wrong in 4.1?
Philipp Oeser added
Status
Confirmed
Module
Modeling
Priority
High
and removed
Status
Needs Triage
Priority
Normal
labels 2024-04-16 13:50:24 +02:00
Member

Could you give the index of that vertex? I imported the USD file in 4.0 and 4.2 here and saw the same number of sharp edges. And visually things are seeming the same to me, so I'm not sure what to look for here.

get hard edges where they should not be.

It would be helpful to know what this means in Blender's terms.

Could you give the index of that vertex? I imported the USD file in 4.0 and 4.2 here and saw the same number of sharp edges. And visually things are seeming the same to me, so I'm not sure what to look for here. >get hard edges where they should not be. It would be helpful to know what this means in Blender's terms.

this geometry is taken from another software, if you import FBX, then everything is smoothed out in 4.0, if you import USD, then sharpen edge appears. the geometry should be smoothed.

this geometry is taken from another software, if you import FBX, then everything is smoothed out in 4.0, if you import USD, then sharpen edge appears. the geometry should be smoothed.

I am working on version 3.6.10 lts and when importing FBX from other software (maya, max), the shading of the model does not break. In versions 4.1 and 4.2, shading breaks when importing FBX

I am working on version 3.6.10 lts and when importing FBX from other software (maya, max), the shading of the model does not break. In versions 4.1 and 4.2, shading breaks when importing FBX

hard edge in MAYA = sharpen edge in BLENDER

hard edge in MAYA = sharpen edge in BLENDER
Member

Could you give the index of that vertex? I imported the USD file in 4.0 and 4.2 here and saw the same number of sharp edges. And visually things are seeming the same to me, so I'm not sure what to look for here.

OK, here is again what I did:

  • in 4.0
    -- import FBX
    -- make sure we only look at custom normals
    --- no sharp edges (there should be none)
    --- mesh properties > Geometry Data (there should be Custom Split Normals on the mesh)
    --- mesh properties > Normals > Auto Smooth is checked (degrees should be greyed out, indicating we are using the custom normals)
    -- editmode overlays > Display Split Normals > constant screen size 50px
    -- editmode overlays > Display Developer Indices
    -- look at vertex 13513
    image
    -- mesh properties > Geometry Data > Clear Custom Split Normals Data
    image

  • in 4.1
    -- import FBX
    -- make sure we only look at custom normals
    --- no sharp edges (in editmode :Ctrl + E > Clear Sharp)
    --- mesh properties > Geometry Data (there should be Custom Split Normals on the mesh)
    -- editmode overlays > Display Split Normals > constant screen size 50px
    -- editmode overlays > Display Developer Indices
    -- look at vertex 13513
    image
    -- mesh properties > Geometry Data > Clear Custom Split Normals Data
    image

OK, and then I noticed that we actually have overlapping vertices (there is not only 13513 in that spot, but also 8201)

image

Anyways, this should not really make a difference?
@HooglyBoogly : does this make sense?

> Could you give the index of that vertex? I imported the USD file in 4.0 and 4.2 here and saw the same number of sharp edges. And visually things are seeming the same to me, so I'm not sure what to look for here. OK, here is again what I did: - in 4.0 -- import FBX -- make sure we only look at custom normals --- no sharp edges (there should be none) --- mesh properties > Geometry Data (there should be Custom Split Normals on the mesh) --- mesh properties > Normals > Auto Smooth is checked (degrees should be greyed out, indicating we are using the custom normals) -- editmode overlays > Display Split Normals > constant screen size 50px -- editmode overlays > Display Developer Indices -- look at vertex 13513 ![image](/attachments/eb290fda-6c81-4928-ac88-9fa86e87c1b9) -- mesh properties > Geometry Data > Clear Custom Split Normals Data ![image](/attachments/7e384405-bc01-4e79-9c11-8862ebfd1d28) - in 4.1 -- import FBX -- make sure we only look at custom normals --- no sharp edges (in editmode :Ctrl + E > Clear Sharp) --- mesh properties > Geometry Data (there should be Custom Split Normals on the mesh) -- editmode overlays > Display Split Normals > constant screen size 50px -- editmode overlays > Display Developer Indices -- look at vertex 13513 ![image](/attachments/7c1f9b19-487e-433f-b548-8518a830d329) -- mesh properties > Geometry Data > Clear Custom Split Normals Data ![image](/attachments/ce1fa639-5202-4304-a92c-7e421d8f7d00) OK, and then I noticed that we actually have overlapping vertices (there is not only 13513 in that spot, but also 8201) ![image](/attachments/108850e4-efd2-43a7-911e-82d3d237429e) Anyways, this should not really make a difference? @HooglyBoogly : does this make sense?

Could you give the index of that vertex? I imported the USD file in 4.0 and 4.2 here and saw the same number of sharp edges. And visually things are seeming the same to me, so I'm not sure what to look for here.

OK, here is again what I did:

  • in 4.0
    -- import FBX
    -- make sure we only look at custom normals
    --- no sharp edges (there should be none)
    --- mesh properties > Geometry Data (there should be Custom Split Normals on the mesh)
    --- mesh properties > Normals > Auto Smooth is checked (degrees should be greyed out, indicating we are using the custom normals)
    -- editmode overlays > Display Split Normals > constant screen size 50px
    -- editmode overlays > Display Developer Indices
    -- look at vertex 13513
    image
    -- mesh properties > Geometry Data > Clear Custom Split Normals Data
    image

  • in 4.1
    -- import FBX
    -- make sure we only look at custom normals
    --- no sharp edges (in editmode :Ctrl + E > Clear Sharp)
    --- mesh properties > Geometry Data (there should be Custom Split Normals on the mesh)
    -- editmode overlays > Display Split Normals > constant screen size 50px
    -- editmode overlays > Display Developer Indices
    -- look at vertex 13513
    image
    -- mesh properties > Geometry Data > Clear Custom Split Normals Data
    image

OK, and then I noticed that we actually have overlapping vertices (there is not only 13513 in that spot, but also 8201)

image

Anyways, this should not really make a difference?
@HooglyBoogly : does this make sense?

Overlapping vertexes on each other is due to the fact that therane pieces are separate objects and at a later stage, these pieces will be separate objects, but this in no way refers to the problem with importing custom normals in versions of Blender since 4.1 for FBX and all versions of Blender with USD, because in 3ds Max, Maya problems with the normals of the imported object is not.

> > Could you give the index of that vertex? I imported the USD file in 4.0 and 4.2 here and saw the same number of sharp edges. And visually things are seeming the same to me, so I'm not sure what to look for here. > > OK, here is again what I did: > - in 4.0 > -- import FBX > -- make sure we only look at custom normals > --- no sharp edges (there should be none) > --- mesh properties > Geometry Data (there should be Custom Split Normals on the mesh) > --- mesh properties > Normals > Auto Smooth is checked (degrees should be greyed out, indicating we are using the custom normals) > -- editmode overlays > Display Split Normals > constant screen size 50px > -- editmode overlays > Display Developer Indices > -- look at vertex 13513 > ![image](/attachments/eb290fda-6c81-4928-ac88-9fa86e87c1b9) > -- mesh properties > Geometry Data > Clear Custom Split Normals Data > ![image](/attachments/7e384405-bc01-4e79-9c11-8862ebfd1d28) > > - in 4.1 > -- import FBX > -- make sure we only look at custom normals > --- no sharp edges (in editmode :Ctrl + E > Clear Sharp) > --- mesh properties > Geometry Data (there should be Custom Split Normals on the mesh) > -- editmode overlays > Display Split Normals > constant screen size 50px > -- editmode overlays > Display Developer Indices > -- look at vertex 13513 > ![image](/attachments/7c1f9b19-487e-433f-b548-8518a830d329) > -- mesh properties > Geometry Data > Clear Custom Split Normals Data > ![image](/attachments/ce1fa639-5202-4304-a92c-7e421d8f7d00) > > OK, and then I noticed that we actually have overlapping vertices (there is not only 13513 in that spot, but also 8201) > > ![image](/attachments/108850e4-efd2-43a7-911e-82d3d237429e) > > Anyways, this should not really make a difference? > @HooglyBoogly : does this make sense? Overlapping vertexes on each other is due to the fact that therane pieces are separate objects and at a later stage, these pieces will be separate objects, but this in no way refers to the problem with importing custom normals in versions of Blender since 4.1 for FBX and all versions of Blender with USD, because in 3ds Max, Maya problems with the normals of the imported object is not.
Member

@lichtwerk Sorry, but your screenshot looks the same in 4.0 and 4.1. What am I missing again?

@lichtwerk Sorry, but your screenshot looks the same in 4.0 and 4.1. What am I missing again?

@HooglyBoogly /

3.6.11 4.2
image image
image image
@HooglyBoogly / | 3.6.11 | 4.2 | | -- | -- | | ![image](/attachments/9f7df22f-c882-4533-b2eb-d978bf02427c) | ![image](/attachments/ec4be0aa-43c6-4270-8627-df7be13f1011) | | ![image](/attachments/1e0113cf-14f7-4cd2-a0e9-768588ccc34a) | ![image](/attachments/b6116ef5-ad22-4c6e-bcee-9f11a4042bf5) |
Member

@lichtwerk Sorry, but your screenshot looks the same in 4.0 and 4.1. What am I missing again?

Compare the first and the third screenshots from my previous comment

image

image

4.0 has a "unified" normal, in 4.1 it is split

> @lichtwerk Sorry, but your screenshot looks the same in 4.0 and 4.1. What am I missing again? Compare the first and the third screenshots from my previous comment ![image](/attachments/2e010f1b-1403-4a82-b76f-2cefb222dc4c) ![image](/attachments/1f8ca026-a998-4a59-8f30-2ef82122b203) 4.0 has a "unified" normal, in 4.1 it is split
9.4 KiB
9.5 KiB

@lichtwerk Sorry, but your screenshot looks the same in 4.0 and 4.1. What am I missing again?

Compare the first and the third screenshots from my previous comment

image

image

4.0 has a "unified" normal, in 4.1 it is split

This is correct, as the vertex normals look in different directions in 4.1 Since this version blender is clearly not handling importing custom normals correctly.

> > @lichtwerk Sorry, but your screenshot looks the same in 4.0 and 4.1. What am I missing again? > > Compare the first and the third screenshots from my previous comment > > ![image](/attachments/2e010f1b-1403-4a82-b76f-2cefb222dc4c) > > ![image](/attachments/1f8ca026-a998-4a59-8f30-2ef82122b203) > > 4.0 has a "unified" normal, in 4.1 it is split This is correct, as the vertex normals look in different directions in 4.1 Since this version blender is clearly not handling importing custom normals correctly.
Member

Worth mentioning that exporting the FBX from 4.0 and then importing in 4.1 has the correct result (this then also does not mark edges as sharp).

But I also checked if just omitting setting sharp edges upon setting custom normals in 4.1 (see the below hack) would fix this with the original FBX -- and it does not get rid of the problem...

diff --git a/source/blender/blenkernel/intern/mesh_normals.cc b/source/blender/blenkernel/intern/mesh_normals.cc
index 974b0815e17..c6c09b69d94 100644
--- a/source/blender/blenkernel/intern/mesh_normals.cc
+++ b/source/blender/blenkernel/intern/mesh_normals.cc
@@ -1388,7 +1388,7 @@ static void mesh_normals_corner_custom_set(const Span<float3> positions,
           const int edge = corner_edges[lidx];
           const int edge_prev = corner_edges[corner_prev];
           const int prev_edge = corner_edges[prev_corner];
-          sharp_edges[prev_edge == edge_prev ? prev_edge : edge] = true;
+          sharp_edges[prev_edge == edge_prev ? prev_edge : edge] = false;
 
           org_nor = nor;
         }
@@ -1411,7 +1411,7 @@ static void mesh_normals_corner_custom_set(const Span<float3> positions,
           const int edge = corner_edges[lidx];
           const int edge_prev = corner_edges[corner_prev];
           const int prev_edge = corner_edges[prev_corner];
-          sharp_edges[prev_edge == edge_prev ? prev_edge : edge] = true;
+          sharp_edges[prev_edge == edge_prev ? prev_edge : edge] = false;
         }
       }
     }
Worth mentioning that exporting the FBX from 4.0 and then importing in 4.1 has the correct result (this then also does not mark edges as sharp). But I also checked if just omitting setting sharp edges upon setting custom normals in 4.1 (see the below hack) would fix this with the original FBX -- and it does not get rid of the problem... ```diff diff --git a/source/blender/blenkernel/intern/mesh_normals.cc b/source/blender/blenkernel/intern/mesh_normals.cc index 974b0815e17..c6c09b69d94 100644 --- a/source/blender/blenkernel/intern/mesh_normals.cc +++ b/source/blender/blenkernel/intern/mesh_normals.cc @@ -1388,7 +1388,7 @@ static void mesh_normals_corner_custom_set(const Span<float3> positions, const int edge = corner_edges[lidx]; const int edge_prev = corner_edges[corner_prev]; const int prev_edge = corner_edges[prev_corner]; - sharp_edges[prev_edge == edge_prev ? prev_edge : edge] = true; + sharp_edges[prev_edge == edge_prev ? prev_edge : edge] = false; org_nor = nor; } @@ -1411,7 +1411,7 @@ static void mesh_normals_corner_custom_set(const Span<float3> positions, const int edge = corner_edges[lidx]; const int edge_prev = corner_edges[corner_prev]; const int prev_edge = corner_edges[prev_corner]; - sharp_edges[prev_edge == edge_prev ? prev_edge : edge] = true; + sharp_edges[prev_edge == edge_prev ? prev_edge : edge] = false; } } } ```
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
7 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#120590
No description provided.