提交 2eb4b1d2 编写于 作者: T tschw

Switch to Object mode before applying modifiers to avoid exception.

上级 b41f7600
......@@ -330,6 +330,8 @@ def extract_mesh(obj, options, recalculate=False):
"""
logger.debug('object.extract_mesh(%s, %s)', obj, options)
apply_modifiers = options.get(constants.APPLY_MODIFIERS, True)
if apply_modifiers:
bpy.ops.object.mode_set(mode='OBJECT')
mesh_node = obj.to_mesh(context.scene, apply_modifiers, RENDER)
# transfer the geometry type to the extracted mesh
......@@ -350,6 +352,7 @@ def extract_mesh(obj, options, recalculate=False):
original_mesh.name,
mesh_node.name)
bpy.ops.object.mode_set(mode='OBJECT')
obj.select = True
bpy.context.scene.objects.active = obj
logger.info('Applying triangulation to %s', obj.data.name)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册