Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharp Edges Ignored #73

Closed
SurlyBird opened this issue Nov 8, 2018 · 7 comments · Fixed by #1127
Closed

Sharp Edges Ignored #73

SurlyBird opened this issue Nov 8, 2018 · 7 comments · Fixed by #1127
Labels
enhancement New feature or request exporter This involves or affects the export process Mesh_&_Object

Comments

@SurlyBird
Copy link

SurlyBird commented Nov 8, 2018

Exporter ignores manually-assigned hard/sharp edges in Blender 2.8, resulting in an 'all-soft' mesh.

Repro in Blender 2.80 Experimental with glTF-Blender-IO:

  1. Create a cube
  2. Display>Shading>Smooth Edges
  3. In Edit mode, select all edges. Edge>Edge Data>Mark Sharp
  4. Select the Object Data tab, Turn on Auto Smooth and set the angle to 180.
  5. Edges of cube should appear hard/sharp in the viewport.
  6. With cube selected File>Export glTF 2.0 (glb). Make sure Export normals and Export Tangents are checked.
  7. Write file to disk.
  8. Load file in sandbox.babylonjs.com/
  9. Hard edges will not be preserved.

Contrast the same workflow with Blender 2.79 using glTF-Blender-Exporter: Hard edges are preserved in .glb written to disk.

Note: In 2.80, setting Display>Shading>Flat faces does export a .glb with hard edges, but all edges are hard. What we want is the ability to define custom hard/soft edges on any given mesh (like we can do in Blender 2.79 with the glTF-Blender-Exporter addon).

Example files attached.
cube_hard_soft.zip

@julienduroure julienduroure added the exporter This involves or affects the export process label Nov 8, 2018
@UX3D-becher UX3D-becher added the enhancement New feature or request label Nov 27, 2018
@UX3D-nopper UX3D-nopper added this to the Community milestone Dec 2, 2018
@julienduroure
Copy link
Collaborator

Note that an issue has been opened in developer.blender.org regarding sharp edges management:
https://developer.blender.org/T58638

@julienduroure
Copy link
Collaborator

User from Blender Issue tracker closed the report, saying :

Even this issue seem resolved in the build of 19/01/2019

Someone here can confirm this is solved ???

@SurlyBird
Copy link
Author

SurlyBird commented Jan 21, 2019

I'll take a look. I have the 20/01/2019 build running right now.

Update: Simple cube test of setting shading to Smooth, checking the Auto Smooth option to selected, setting smoothing angle to 180 and then marking edges to 'Sharp' exports to glTF (a .glb for this test) with edge data preserved (hard edges) when 'Apply Modifiers' is checked. If 'Apply Modifiers' is NOT checked, then the object is exported with all edges soft (want to make sure I point that out).

In summary, it would appear the issue is resolved in the glTF exporter included with the Blender 2.8 download as recently as Jan. 20. I'll update further if I run some more tests and have different results. For now, from my limited test, I'd say the issue appears to be solved. Not an exhaustive test, though.

@Cyp
Copy link
Contributor

Cyp commented Jan 21, 2019

Was probably fixed in 85d2490 — auto-smooth used to be ignored.

@emackey
Copy link
Member

emackey commented Jan 30, 2019

I did a quick test and also confirmed what @SurlyBird and @Cyp posted above.

The "Edge Split" modifier is applied to a temporary object during export, which is the correct solution, but the solution is only effective if "Apply Modifiers" is checked during export, which is not the default.

So if the user manually puts a checkmark on "Apply Modifiers", then this is solved. I feel like that's not enough to close this issue though, since it's not default behavior. Which makes me wonder... Should Apply Modifiers be on by default? Also, it makes me wonder if there's some way to apply the temporarily added edge split modifier, even when other modifiers aren't applied.

@j-conrad
Copy link

j-conrad commented Mar 6, 2019

Apologies for adding this comment on multiple issues, but I've seen several issues discussing 'Apply Modifiers' as a solution to different problems. Unfortunately, it appears to be a less-than-ideal fix for certain situations like this:

It appears to be a known issue that one cannot export a model that has manually-defined smooth/hard edges unless 'Apply Modifiers' is turned on. (Doesn't make much sense considering defining smooth/hard edges can be done without the use of any modifiers, but 🤷‍♂️)
The problem I'm having now is that I'd like to be able to export my Shape Keys AND have proper smooth/hard edges. However, Shape Keys don't export when 'Apply Modifiers' is turned on, aka the opposite problem. (Also a bit of a misnomer since Shape Keys appear to have zero to do with modifiers.)
Does anyone know how to get around this?

@pafurijaz
Copy link

I'm the author of thread in blender, here a link of a my model and I get some errors and I can't export. https://drive.google.com/open?id=1RnLZ1OHdxNRgTU9E_jKdSc-1zp5SogkH
Anyway a noticed that, when you export with the script and with option apply modifiers, I get a very clean result, with smooth and sharp edges correctly, but if I do conversion of the model manually and then export the model I have a wrong shading loosing all sharp edges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request exporter This involves or affects the export process Mesh_&_Object
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants