diff --git a/doc/python_api/examples/bpy.types.Depsgraph.6.py b/doc/python_api/examples/bpy.types.Depsgraph.6.py index 1f809356b13..7d46fe8b5bd 100644 --- a/doc/python_api/examples/bpy.types.Depsgraph.6.py +++ b/doc/python_api/examples/bpy.types.Depsgraph.6.py @@ -30,7 +30,8 @@ class OBJECT_OT_simple_exporter(bpy.types.Operator): continue print(f"Exporting mesh with {len(mesh.vertices)} vertices " f"at {object_instance.matrix_world}") - object_instace.to_mesh_clear() + + self.clear_mesh_for_object_instance(object_instance) return {'FINISHED'} @@ -47,6 +48,12 @@ class OBJECT_OT_simple_exporter(bpy.types.Operator): return object_instance.object.to_mesh() else: return object_instance.object.original.to_mesh() + + def clear_mesh_for_object_instance(self, object_instance): + if self.apply_modifiers: + return object_instance.object.to_mesh_clear() + else: + return object_instance.object.original.to_mesh_clear() def register():