Maniphest T96894

Regression: Exported sculpt details are missing till you press clear custom split normals (e.g. after FBX export/import roundtrip)
Closed, ResolvedBUG

Assigned To
Hans Goudey (HooglyBoogly)
Authored By
Angelos Axiotis (angelo9888)
Mar 30 2022, 3:52 PM
Tags
  • Import/Export
  • BF Blender
  • Sculpt, Paint & Texture
Subscribers
Angelos Axiotis (angelo9888)
Hans Goudey (HooglyBoogly)
Philipp Oeser (lichtwerk)
Pratik Borhade (PratikPB2123)
TheRedWaxPolice (TheRedWaxPolice)

Description

System Information
Operating system: Windows-11 64 Bits
Graphics card: NVIDIA GeForce RTX 3080 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 497.17

Blender Version
Broken: version: 3.1.0, branch: master, commit date: 2022-03-08 18:16, hash: rBc77597cd0e15
Worked: 3.0.1

Caused by rBcfa53e0fbeed: Refactor: Move normals out of MVert, lazy calculation

Short description of error
Sculpting - When you export a sculpted mesh and you reimport it details are missing till you press clear custom split normals.
For example if I try to bake the high poly to substance painter I don't have the details of my sculpted mesh.

Exact steps for others to reproduce the error

  • Open default sculpting file -> sculpt a mesh

  • Export it in FBX format with default settings
  • Open default scene -> delete everything -> import the FBX file

(this is what you see when you re-import it)

the sculpted are shows on the side view

if you hit clear custom split normals the details will show up!

Related Objects

Mentioned Here
rBe8f4010611e7: Geometry: Cache bounds min and max, share between data-blocks
D15982: Mesh: Move positions to a generic attribute
rB97c2c3991620: Fix T94624: Object as font instances don't work
rBcfa53e0fbeed: Refactor: Move normals out of MVert, lazy calculation
rBe69020ad0f52: CMake: only ever enable one alternative linker for UNIX/GCC

Event Timeline

Angelos Axiotis (angelo9888) created this task.Mar 30 2022, 3:52 PM
Philipp Oeser (lichtwerk) changed the task status from Needs Triage to Needs Information from User.Mar 30 2022, 5:01 PM
Philipp Oeser (lichtwerk) added a subscriber: Philipp Oeser (lichtwerk).

First things first:

When you export a sculpted mesh and you reimport it

Which exporter/importer is used here? Or do you mean save/append?

Angelos Axiotis (angelo9888) added a comment.Mar 30 2022, 6:13 PM

The fbx importer/exporter.

Pratik Borhade (PratikPB2123) added a subscriber: Pratik Borhade (PratikPB2123).Mar 31 2022, 7:14 AM
TheRedWaxPolice (TheRedWaxPolice) added a subscriber: TheRedWaxPolice (TheRedWaxPolice).Apr 1 2022, 3:12 AM
In T96894#1332411, @Angelos Axiotis (angelo9888) wrote:

The fbx importer/exporter.

Interesting...
If you turn off "Auto Smooth" it fixes it, right?
Alternatively you can uncheck "Custom Normals" when importing the fbx to not include it...
So not sure if there's a bug here.. 🤔

Angelos Axiotis (angelo9888) added a comment.Apr 1 2022, 4:54 PM

"If you turn off "Auto Smooth" it fixes it, right?"
-no it doesn't .
My problem is not when importing it. My problem is when I export it and want to bake it as high poly in substance painter. There are no details!

Angelos Axiotis (angelo9888) added a comment.Apr 1 2022, 4:57 PM

"If you turn off "Auto Smooth" it fixes it, right?"
Correction it does fix the problem but when you import the model, not when you export it.
In a few words I want to use the high poly model outside of blender and I cannot because there are no details on the model!

Pratik Borhade (PratikPB2123) changed the task status from Needs Information from User to Confirmed.Apr 14 2022, 7:54 AM
Pratik Borhade (PratikPB2123) added a project: Modeling.
Pratik Borhade (PratikPB2123) added a subscriber: Hans Goudey (HooglyBoogly).

I'm able to reproduce this. Behavior changed between 97c2c3991620 - e69020ad0f52.
I suspect rBcfa53e0fbeed7178c7876413e2010fd3347d7f72
@Hans Goudey (HooglyBoogly) hi, I don't think this is expected. Can you take a look?

Pratik Borhade (PratikPB2123) renamed this task from Sculpting - exported sculpt details are missing till you press clear custom split normals to FBX: Exported sculpt details are missing till you press clear custom split normals.Apr 14 2022, 7:59 AM
Pratik Borhade (PratikPB2123) updated the task description.
Pratik Borhade (PratikPB2123) added a project: Import/Export.
Philipp Oeser (lichtwerk) triaged this task as High priority.Apr 14 2022, 1:03 PM

Will raise priority here since it is a regression.

Philipp Oeser (lichtwerk) renamed this task from FBX: Exported sculpt details are missing till you press clear custom split normals to Regression: Exported sculpt details are missing till you press clear custom split normals (e.g. after FBX export/import roundtrip).Apr 14 2022, 1:04 PM
Philipp Oeser (lichtwerk) updated the task description.
Hans Goudey (HooglyBoogly) added a comment.EditedApr 15 2022, 7:51 PM

I think I've found the problem-- while sculpt mode does update the mesh's original normals array while sculpting, it doesn't seem to set the dirty tags correctly.

I think the ideal loop (when there are no modifiers and we sculpt without Dyntopo or Multires) is this:

  • Sculpt brush adjusts positions
  • Sculpt code tags normals dirty
  • Sculpt code recalculates normals with PBVH structure, and clear dirty flag (a future optimization is skipping this step if modifiers will change the mesh anyway)

It seems that changes to vertex positions aren't always flushed to the original object when sculpting, which complicates this design a bit. (Conceptually, is sculpt mode really adjusting the original mesh, or some quasi-copy of it?)
I think I'll have to get some feedback from the people who have designed this area before applying that solution.

Hans Goudey (HooglyBoogly) edited projects, added BF Blender (3.2); removed BF Blender.Apr 15 2022, 7:52 PM
Hans Goudey (HooglyBoogly) edited projects, added BF Blender; removed BF Blender (3.2).Jun 1 2022, 3:23 PM
Hans Goudey (HooglyBoogly) edited projects, added Sculpt, Paint & Texture; removed Modeling.Sep 13 2022, 4:41 AM
Julien Kaspar (JulienKaspar) moved this task from Backlog to Bugs on the Sculpt, Paint & Texture board.Sep 16 2022, 10:28 AM
Julien Kaspar (JulienKaspar) changed the subtype of this task from "Report" to "Bug".
Hans Goudey (HooglyBoogly) closed this task as Resolved.Nov 17 2022, 1:00 AM
Hans Goudey (HooglyBoogly) claimed this task.

This was resolved as part of e8f4010611e7. Sculpt mode needed proper handling of "positions changed" tagging for bounding boxes, which also applied here. I think there are still some logical issues with sharing the positions and normals arrays with the original mesh in some cases, but D15982 will give us new opportunities to simplify this area, so I think we can look at it again after that lands.