diff options
Diffstat (limited to 'doc/python_api/examples/bpy.types.Depsgraph.5.py')
-rw-r--r-- | doc/python_api/examples/bpy.types.Depsgraph.5.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/python_api/examples/bpy.types.Depsgraph.5.py b/doc/python_api/examples/bpy.types.Depsgraph.5.py index 335e87071e5..0f578b37d47 100644 --- a/doc/python_api/examples/bpy.types.Depsgraph.5.py +++ b/doc/python_api/examples/bpy.types.Depsgraph.5.py @@ -30,16 +30,16 @@ class OBJECT_OT_mesh_from_object(bpy.types.Operator): def execute(self, context): # Access input original object. - object = context.object - if object is None: + obj = context.object + if obj is None: self.report({'INFO'}, "No active mesh object to convert to mesh") return {'CANCELLED'} # Avoid annoying None checks later on. - if object.type not in {'MESH', 'CURVE', 'SURFACE', 'FONT', 'META'}: + if obj.type not in {'MESH', 'CURVE', 'SURFACE', 'FONT', 'META'}: self.report({'INFO'}, "Object can not be converted to mesh") return {'CANCELLED'} depsgraph = context.evaluated_depsgraph_get() - object_eval = object.evaluated_get(depsgraph) + object_eval = obj.evaluated_get(depsgraph) mesh_from_eval = bpy.data.meshes.new_from_object(object_eval) self.report({'INFO'}, f"{len(mesh_from_eval.vertices)} in new mesh, and is ready for use!") return {'FINISHED'} |