bm.faces.layers.int.new() breaks bpy.ops.uv.reset()
Closed, ResolvedPublic

Description

System Information
Tested on multiple computers and OSs

Blender Version
Broken: Tested on 2.78 (2.78c) and newer builds

After adding a face int layer to a bmesh, the unwrap reset operator only produces weird UV maps.

Exact steps for others to reproduce the error

# Create a new mesh or use an existing one (e.g. from edit mode)
me = bpy.data.meshes.new(filename)
bm = bmesh.new()
bm.from_mesh(me)

# Then add a new integer layer (I'm intending to use this to store a bit field for each face)
type_layer = bm.faces.layers.int.new("Type")

# ... add geometry ...

# Link the object to the scene
ob = bpy.data.objects.new(filename, me)
scene.objects.link(ob)
scene.objects.active = ob

Then in edit mode, select everything, hit U and then Reset. The resulting UV map will consist of rather random lines. It's only broken for objects with this int layer.

File with a mesh that has a layer:

Screenshot: