exporting animated shapekeys as triangulated .OBJ files with default exporter cause invalid mesh result #76715
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#76715
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: Win10PRO 64bit
Graphics card:
Blender Version
2.82
2.83
Short description of error
When exporting it as .OBJ files (with "Animation" and "Triangulate Faces" options) then the output is invalid and also the viewport shows the invalid mesh after export.
This does not happen, when "Triangulate Faces" is not selected;
Exact steps for others to reproduce the error
reproducer1.blend
Animation
Triangulate Faces
The object in the scene is changed as if the shapekey was applied multiple times
bmesh used together with "relative shape keys" seems to be the reason.
Written OBJs are false though.
In this other file, the code that brings the problem was copied in the Text Editor.
To reproduce the same problem just:
bm_to_mesh_bug.blend
The correct mesh data can be restored in the viewport to the original values by entering EditMode and then again changing back to ObjectMode.
Added subscriber: @(Deleted)
exporting .OBJ file with default exporter causes invalid resultto exporting animated shapeleys as .OBJ file with default exporter causes invalid resultexporting animated shapeleys as .OBJ file with default exporter causes invalid resultto exporting animated shapeleys as triangulated .OBJ files with default exporter causes invalid resultexporting animated shapeleys as triangulated .OBJ files with default exporter causes invalid resultto exporting animated shapekeys as triangulated .OBJ files with default exporter cause invalid mesh resultAdded subscriber: @lichtwerk
Changed status from 'Needs Triage' to: 'Confirmed'
Can confirm, checking...
Added subscriber: @mano-wii
Not sure from quick glance...
@mano-wii: does this ring a bell? (just thinking, because you authored D6514, D6516 -- which might be related?)
I am having trouble following the steps to reproduce the problem.
Can these steps be more detailed?
updated the report description, does this help?
I can confirm the problem.
It happens along these lines: https://developer.blender.org/diffusion/BA/browse/master/io_scene_obj/export_obj.py$40-46
The code to convert bmesh to mesh always "rebases" the shapekey by taking the difference between the bmesh and the original coordinates of the shapekey that is active.
But in my opinion this "rebase" should only be done when toogle edit mode and object mode.
I'm not sure if the problem is in
bm.from_mesh(me)
or if it is withbm.to_mesh(me)
.There may be something wrong there, but I find it redundant to use the
bmesh.ops.triangulate(bm, faces=bm.faces)
to triangulate the mesh.The mesh already informs the triangles through
mesh.loop_triangles
.Perhaps this conversion can be disregarded.
thanks for confirming my report as bug.
using mesh.loop_triangles would be tempting, but in this line:
https://developer.blender.org/diffusion/BA/browse/master/io_scene_obj/export_obj.py$376
"polygons" of type MeshPolygons are needed to build the face/UV pairs.
Is there a conversion from "MeshLoopTriangles" to "MeshPolygons" possible throught the bpy API ?
that would help a lot.
We could do something like this to fix it:
I believe there is no problem but I am not sure.
I will propose this patch for review and see with the developers later.