I want to check if the active object is a mesh before I UV unwrap it. Here's my code and for some reason the execute runs even when a mesh is not selected. What am I missing?
@classmethod
def poll(cls, context):
our_case = False
selected = context.selected_objects
object = context.active_object
if object is None: return False
if object.mode == "OBJECT" and all(obj.type == "MESH" for obj in selected):
return True
return our_case
def execute(self, context):
bpy.ops.uv.smart_project(angle_limit=30, island_margin=0.06)
return {'FINISHED'}