The PSK and PSA import menu items will now be greyed out if in the wrong context, and a tooltip will be shown indicating what the issue is (e.g., having the wrong type of object selected)

This commit is contained in:
Colin Basnett
2022-05-05 20:56:52 -07:00
parent 19ff47cc83
commit d4a58caafe
2 changed files with 29 additions and 7 deletions

View File

@@ -102,6 +102,15 @@ class PskExportOperator(Operator, ExportHelper):
return {'RUNNING_MODAL'}
@classmethod
def poll(cls, context):
try:
PskBuilder.get_input_objects(context)
except RuntimeError as e:
cls.poll_message_set(str(e))
return False
return True
def draw(self, context):
layout = self.layout
scene = context.scene