mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
make it works on nuke 12
This commit is contained in:
parent
08e04911b3
commit
eb590602c3
3 changed files with 11 additions and 4 deletions
|
|
@ -24,7 +24,7 @@ class GizmoMenu():
|
|||
config = {key: value for key, value in
|
||||
item.items() if key != "type"}
|
||||
|
||||
command = config['command']
|
||||
command = str(config['command'])
|
||||
|
||||
if command.find('{pipe_path}') > -1:
|
||||
command = command.format(
|
||||
|
|
|
|||
|
|
@ -71,6 +71,9 @@ def add_scripts_gizmo():
|
|||
)
|
||||
return
|
||||
|
||||
# load configuration of custom menu
|
||||
project_settings = get_project_settings(os.getenv("AVALON_PROJECT"))
|
||||
|
||||
for gizmo in project_settings["nuke"]["gizmo"]:
|
||||
config = gizmo["gizmo_definition"]
|
||||
toolbar_name = gizmo["toolbar_menu_name"]
|
||||
|
|
@ -88,7 +91,9 @@ def add_scripts_gizmo():
|
|||
try:
|
||||
icon = icon.format(**os.environ)
|
||||
except KeyError as e:
|
||||
log.warning(f"This environment variable doesn't exist: {e}")
|
||||
log.warning(
|
||||
"This environment variable doesn't exist: {}".format(e)
|
||||
)
|
||||
|
||||
for gizmo in gizmo_path:
|
||||
try:
|
||||
|
|
@ -96,7 +101,9 @@ def add_scripts_gizmo():
|
|||
gizmo_path.append(gizmo)
|
||||
gizmo_path.pop(0)
|
||||
except KeyError as e:
|
||||
log.warning(f"This environment variable doesn't exist: {e}")
|
||||
log.warning(
|
||||
"This environment variable doesn't exist: {}".format(e)
|
||||
)
|
||||
|
||||
nuke_toolbar = nuke.menu("Nodes")
|
||||
toolbar = nuke_toolbar.addMenu(toolbar_name, icon=icon)
|
||||
|
|
|
|||
|
|
@ -306,4 +306,4 @@
|
|||
}
|
||||
],
|
||||
"filters": {}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue