Page MenuHome

Python mesh.from_pydata() misses first edge if there are faces
Closed, ResolvedPublic

Description

System Information
Operating system: macOS 10.13.6
Graphics card: NVIDIA GeForce GT 650M

Blender Version
Broken: 2.80 and 2.81
Worked: 2.79

Short description of error
Expected:


But got:

The diagonal loose edge and its two vertices are missing.
As far as I can tell, this only happens to the first edge and only if there is at least one face.

Exact steps for others to reproduce the error
Open the default scene and enter this in the python console:

bpy.context.object.data = bpy.data.meshes.new(name='Test')
bpy.context.object.data.from_pydata([(1.0, 0.0, 0.0), (0.0, 1.0, 0.0), (0.0, 0.0, 1.0), (1.0, 1.0, 0.0), (1.0, 0.0, 1.0), (0.0, 1.0, 1.0)], [(3, 4)], [(0, 1, 2)])

It has nothing to do with the indices, this example causes the same problem:

bpy.context.object.data = bpy.data.meshes.new(name='Test')
bpy.context.object.data.from_pydata([(0.0, 0.0, 0.0), (1.0, 0.0, 0.0), (0.0, 1.0, 0.0), (0.0, 0.0, 1.0), (1.0, 1.0, 0.0), (1.0, 0.0, 1.0), (0.0, 1.0, 1.0)], [(4, 5)], [(1, 2, 3)])