mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Hide action if setting is empty
This commit is contained in:
parent
56fb5c4c02
commit
8383fdefa4
1 changed files with 10 additions and 0 deletions
|
|
@ -10,6 +10,16 @@ class CreateProjectFoldersAction(LauncherAction):
|
|||
order = 1000
|
||||
|
||||
def is_compatible(self, selection) -> bool:
|
||||
|
||||
# Disable when the project folder structure setting is empty
|
||||
# in settings
|
||||
project_settings = selection.get_project_settings()
|
||||
folder_structure = (
|
||||
project_settings["core"]["project_folder_structure"]
|
||||
).strip()
|
||||
if not folder_structure or folder_structure == "{}":
|
||||
return False
|
||||
|
||||
return (
|
||||
selection.is_project_selected
|
||||
and not selection.is_folder_selected
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue