I found a recent blender2.8 change has broken my addon’s shape key exporting. My shape key exporting works in the following procedure:
# make the shape key specified by `shape_key_index` active
mesh_object.show_only_shape_key = True
mesh_object.active_shape_key_index = shape_key_index
shape_key_mesh = self.object.to_mesh(
bpy.context.view_layer.depsgraph,
apply_modifiers=True,
calc_undeformed=True
)
mesh_object.show_only_shape_key = False
# triangulate `shape_key_mesh`
tri_mesh = bmesh.new()
tri_mesh.from_mesh(shape_key_mesh)
bmesh.ops.triangulate(
tri_mesh, faces=tri_mesh.faces, quad_method="ALTERNATE")
tri_mesh.to_mesh(shape_key_mesh)
tri_mesh.free()
shape_key_mesh.update(calc_loop_triangles=True)
# calculate normal/tangent
if self.has_tangents:
shape_key_mesh.calc_tangents()
else:
shape_key_mesh.calc_normals_split()
The issue is currently the generated shape_key_mesh's vertices is identical with the original mesh mesh_object.data
Besides, it is strange that if I execute these scripts in python console, I am able to get what I want. However, in executing addon, the shape_key_mesh is just identical to the original mesh.
By the way, I have CI setup, so I know this issue came after Mar 22th