Page MenuHome

VRML2 export bug and fix
Closed, ResolvedPublic

Description

System Information
Fedora Linux 21, GeForce GT 240

Blender Version
Broken: 2.74

Short description of error
When exporting objects with complex faces (concave etc) sometimes the exported object is broken. This happens because the VRML2 export plugin first invokes bmesh.transform(), and after that does bmesh.ops.triangulate(). If we change the order of these calls, all works fine.

This looks more like a Blender bug rather than a export plugin bug; still, the workaround is attached.

Exact steps for others to reproduce the error
Load the attached .blend file, enable the VRML2 plugin and and export it to *.WRL. Then look at it with e.g. freewrl viewer. You'll see a rectangle rather than the U-shaped face from the example.

If you apply the fix, the U-shaped face is exported ok.

Event Timeline

Andrey Zabolotnyi (anpaza) raised the priority of this task from to 90.
Andrey Zabolotnyi (anpaza) updated the task description. (Show Details)
Andrey Zabolotnyi (anpaza) edited a custom field.

The .blend file demonstrating the problem


The fix

@Andrey Zabolotnyi (anpaza), the workaround is arbitrary: it might make some cases to work and other to prevent working. Imagine situation when you'll apply transform on your object in Blender (on the mesh itself) and then transform object back. That situation wouldn't work correct after your fix.

@Campbell Barton (campbellbarton) might have a look into a traingulation issue. However triangulating concave faces is always a pain.

Sergey Sharybin (sergey) lowered the priority of this task from 90 to Normal.May 2 2016, 10:19 AM

Applied the patch.

Applying the matrix will typically move the mesh away from having its zero centered origin. Its more likely the triangulation will have worse precision.

In any case, triangulating first will match the view-port result, so its preferred.

This case is not about losing precision. You can apply the transforms before export with Ctrl+A, nothing changes.
At the same time, triangulation in Blender Ctrl+T works fine.