Gltf-blender-io: Can't export custom normals (use_auto_smooth)

Created on 1 Dec 2017  ·  12Comments  ·  Source: KhronosGroup/glTF-Blender-IO

I'm using two addons to manually change the normals for my model. When I export, it doesn't get saved out. Is the exported checking if auto smooth is turned on and that the custom data is there being used?

Data should be stored in "Custom Split Normals Data" datablock.

I can upload a sample file if you need it.

Mesh_&_Object enhancement exporter

Most helpful comment

I hope this gets some attention. We're currently in the middle of a project that needs proper user normals / vertex normals to look the way it should.

All 12 comments

I guess the addons are not taken into account. But yes, please provide an example.

https://drive.google.com/open?id=1RGwIt7a3AAapJVdnTxi7ZQEv9434cZ9v
Here is a cube sample with all the normals set to 0,0,1. This should make testing easy since its just a few vertices and a single direction for all of them. I used the blend4web plugin that makes it easier to edit the normals which then gets stored in Custom Split Normals Data.

I have been able to export to OBJ, and the custom normals do output correctly. I found an online tutorial about getting custom normals in gltf by means of exporting to collada then use the colladatogltf. This isn't the ideal workflow since most of the exports for blender uses the custom norms when auto smooth is enabled.

https://imgur.com/a/qD7EK here's an image of how it looks. Blue lines are the original normals, purple are the custom ones.

Also found this, someone with a bit of code to add the ability to export custom normals to FBX. Maybe this can help.

https://forums.epicgames.com/udk/udk-development/modeling-and-skinning/298304-custom-vertex-normals-for-blender-fbx

Is this issue resolved since it was closed?

Doesn't look resolved, reopening.

Is there any news on this? Would be good to have it working for the hard-surface-custom-normal workflow in order to cheaply round out the edges without making normal maps.

image

In the browser window I have A-Frame loading, from left to right, collada, glTF, and OBJ models exported from the pictured Blender file. I was using the Data Transfer modifier to get my custom normals from an object without the bevel modifier but, for the test, I've applied the modifiers.

These were the glTF exporter settings used:

image

Interested in a solution to this as well, trying to create custom normals for foliage per https://www.artstation.com/artwork/9QGVy. Current result (with custom normals on the left shrub) is:

| Blender | Export |
|---|---|
| screen shot 2018-09-16 at 8 36 53 pm | screen shot 2018-09-16 at 8 37 26 pm |

Can share an example .blend if helpful.

Transferring this to the new import/export repository, this is still a feature we'd like to get.

I think this is related to this issue-- looking for a good place to report 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?

one cannot export a model that has manually-defined smooth/hard edges unless 'Apply Modifiers' is turned on

@j-conrad As a workaround you can try, since it might take a while to get this bug fixed, is you could add an "Edge Split" modifier, and manually apply it, prior to export. Then it won't matter if the "Apply Modifiers" checkbox is set or not.

This is actually what's happening with the addon's own "Apply Modifiers" checkbox, since there's a temporary Edge Split modifier that gets used as part of the export process, and applying it is what gives you the requested hard edges. In glTF, the data is packed as needed for rendering on hardware, so, edge vertices must be split apart to have different normal vectors such as for hard edges. But the bug is basically that these normal vectors don't come from Blender's custom normal data, as they should.

See also comments in #230.

@emackey thanks for the suggestion. Unfortunately, when attempting to apply an Edge Split modifier, Blender throws an error stating that you ‘cannot apply this modifier to an object that has shape keys’. 😣
Seems unreasonable to make people redo all their shape keys AFTER using the modifier which they don’t even want to apply permanently in the first place.
Looks like this problem doesn’t actually have a viable workaround.

I hope this gets some attention. We're currently in the middle of a project that needs proper user normals / vertex normals to look the way it should.

This should be fixed in #414.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

scurest picture scurest  ·  4Comments

UX3D-nopper picture UX3D-nopper  ·  3Comments

dsinni picture dsinni  ·  3Comments

Quinten123 picture Quinten123  ·  5Comments

cstfan picture cstfan  ·  4Comments