add a couple poll messages

This commit is contained in:
Andrej730
2024-08-08 18:10:14 +05:00
parent 644f32d11c
commit 9671be1734
2 changed files with 4 additions and 10 deletions
@@ -720,11 +720,8 @@ class LoadProductCostItems(bpy.types.Operator):
@classmethod
def poll(cls, context):
if not tool.Ifc.get():
return False
if not context.active_object:
return False
if not context.active_object.BIMObjectProperties.ifc_definition_id:
if not tool.Ifc.get() or not (obj := context.active_object) or not (obj.BIMObjectProperties.ifc_definition_id):
cls.poll_message_set("No IFC object is active.")
return False
return True
@@ -1399,11 +1399,8 @@ class LoadProductTasks(bpy.types.Operator):
@classmethod
def poll(cls, context):
if not tool.Ifc.get():
return False
if not context.active_object:
return False
if not context.active_object.BIMObjectProperties.ifc_definition_id:
if not tool.Ifc.get() or not (obj := context.active_object) or not (obj.BIMObjectProperties.ifc_definition_id):
cls.poll_message_set("No IFC object is active.")
return False
return True