Gltf-blender-io: Apply Modifier seems to have effect on "Auto Smooth" of the final GLB Exported

Created on 25 Nov 2019  路  11Comments  路  Source: KhronosGroup/glTF-Blender-IO

Describe the bug
Related to Auto Smooth,

To Reproduce
Have a 3D mesh that takes advantage of Auto Smooth, then when exporting GLB, turn on Apply Modifier and see the Auto Smooth seems unchecked on all other mesh(s)! Surprised.

Expected behavior
Expecting Apply Modifier to have no effect whatsoever on the Auto Smooth of other objects in the scene.

Screenshots
Screen Shot 2019-11-25 at 12 33 46 pm
Screen Shot 2019-11-25 at 12 33 42 pm

.blend file/ .gltf
auto_smooth_bug_002.blend.zip

Version

  • OS: MacOS Catalina 10.15.2 Beta (19C46a)
  • Blender Version 2.81 official, November 21, 2019

Additional context
I found out about this while working on a project BLEND that requires both Apply Modifier, but I am losing a lot of "Auto Smooth" and lots of objects become ... edgy.

Mesh_&_Object bug exporter

Most helpful comment

@scurest Thanks, perfect work!
I can confirm this is fixed in the current beta of b9 (v1.3.48).

All 11 comments

As GLB and as well as USDZ, below you can see:
With "Apply Modifier" turned on, somewhat it affects the Auto Smooth (OFF)

Screen Shot 2019-11-25 at 12 37 52 pm

With "Apply Modifier" turned off, somewhat it affects the Auto Smooth (ON, as expected)
Screen Shot 2019-11-25 at 12 37 40 pm

One more time, more obvious:

  • pink object has Solidify Modifier, and I like to Apply Modifier and it is affecting Auto Smooth

Screen Shot 2019-11-25 at 12 41 40 pm

Screen Shot 2019-11-25 at 12 41 26 pm

Related to #761? Did you test with that fix included?

Tested on alpha 2.82:
Blender:
image

glb with Apply modifier not checked:
image

glb with Apply modifier checked:
image

blend file after export (no changes):
image

  • Checked in code: AutoSmooth (with angle or with custom normals) are managed like a modifier, so they are exported only when "Apply modifier" is checked

So ... Not sure to understand what is exactly your problem.

can you please test again with blender 2.82 alpha? And display screenshots from blender before / glb on https://gltf-viewer.donmccurdy.com/ / blender after?

Thanks :)

So ... Not sure to understand what is exactly your problem.

I think the enabled Auto Smooth blender option should produce a gltf with a same normals as the blender renders and the viewport. There is no blender modifier involved, hence the "Apply Modifiers" option should be irrelevant.

Tested https://github.com/capnm/b8TransportRobot/tree/master/blender81
with the current gltf tip (1.1.16) + blender 2.81:

image

image

image

Tested with Blender 2.82.3 and 2.80.75
Normals are broken when exporting with apply Modifiers checked. See image below.
No additional modifiers on mesh.

Broken_Normals

This is not the same case, because you seems to have some custom normals, where the previous example was about using auto-smooth with split angle (without custom normals)
Can you please provide the .blend file?
(We should try reimporting it not in Blender too, to be sure that the bug is not in blender importer)

I agree with @capnm , currently the default setting for the GLTF exporter does not export a visually identical mesh as the blender viewport since it does not respect the 'autosmooth' setting. There is a workaround which is to add a custom split normal, which seems to bake the 'autosmooth' setting into the geo.

This appears to be fixed in master (by #1127 probably).

tef

capnm's file is also fixed.

@scurest Thanks, perfect work!
I can confirm this is fixed in the current beta of b9 (v1.3.48).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

spiraloid picture spiraloid  路  3Comments

Ali-RS picture Ali-RS  路  3Comments

cstfan picture cstfan  路  4Comments

spiraloid picture spiraloid  路  5Comments

donmccurdy picture donmccurdy  路  5Comments