glTF export doesn't export tangents for non-triangulated meshes #81746
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#81746
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Linux-5.8.14-zen1-1-zen-x86_64-with-glibc2.29 64 Bits
Graphics card: Mesa DRI Intel(R) HD Graphics 4000 (IVB GT2) Intel Open Source Technology Center 4.2 (Core Profile) Mesa 20.2.0
Blender Version
Broken: version: 2.91.0 Alpha, branch: makepkg (modified), commit date: 2020-09-09 20:10, hash:
blender/blender@0721fbb6e1
Worked: (newest version of Blender that worked as expected)
Short description of error
Vertex tangents are not calculated/exported for non-triangulated meshes. When I manually triangulate the mesh, and re-export, tangents are exported. Since the export has to triangulate the mesh anyway, I don't see any reason for this not to work out of the box. Having the user manually triangulate the meshes before exporting degrades the model as it makes it less editable.
Exact steps for others to reproduce the error
Create face with more than 4 vertices. Export to glTF, check tangents, observe the result.
.blend tan.blend
.glb untitled.glb
Added subscriber: @skrat
Added subscriber: @JulienDuroure
This over here:
https://developer.blender.org/diffusion/BA/browse/master/io_scene_gltf2/blender/exp/gltf2_blender_extract.py$35
So it seems @JulienDuroure would be the most familiar person with this part of codebase? To me it seems that the code is giving up too soon. Or perhaps the order in which this is called is not right, ie. triangulate first, then try
calc_tangents()
Meshes are not triangulated during export. There are extracted using data.loop_triangles (after using data.calc_loop_triangles() )
Tangents are not known neither after these steps
Right, but isn't it the same thing at the end? We're getting triangles because that's what we need for the export, so we either use
data.loop_triangles
or we clone the mesh, triangulate, get tangents. And rather than keeping it the way it is, which IMO is broken, because if user requests tangents in the export, then the export should give him tangents, right?What I don't understand is that, if we have normals (
calc_normals
), why don't we have tangents available? IMO it's in the same domain space, I see no reason for this to be unavailable for export.Added subscriber: @ideasman42
I don't have more information on how it works internally. Result is that it's not available via bpy
Maybe @ideasman42 can have more information on that.
Note that there exactly the same behaviour in fbx export, so I supposed there is no easy way.
Changed status from 'Needs Triage' to: 'Archived'
Closing this ticket.
As explained, we can't get tangent if mesh is not triangulated by user before export.
If you need more information, please refer to this explanation : https://github.com/KhronosGroup/glTF-Blender-IO/issues/172#issuecomment-693684218
Note that there is already a ticket open to make warning more visible (https://github.com/KhronosGroup/glTF-Blender-IO/issues/1273)