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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user