Nuke: fixing menu and publish callback

This commit is contained in:
Jakub Jezek 2021-04-21 17:17:54 +02:00
parent ee598d1521
commit a8ac382c8a
No known key found for this signature in database
GPG key ID: D8548FBF690B100A
2 changed files with 15 additions and 15 deletions

View file

@ -106,7 +106,7 @@ def on_pyblish_instance_toggled(instance, old_value, new_value):
log.info("instance toggle: {}, old_value: {}, new_value:{} ".format(
instance, old_value, new_value))
from avalon.api.nuke import (
from avalon.nuke import (
viewer_update_and_undo_stop,
add_publish_knob
)

View file

@ -26,9 +26,9 @@ def install():
menu.addCommand(
name,
workfiles.show,
index=(rm_item[0])
index=2
)
menu.addSeparator(index=3)
# replace reset resolution from avalon core to pype's
name = "Reset Resolution"
new_name = "Set Resolution"
@ -63,27 +63,27 @@ def install():
# add colorspace menu item
name = "Set Colorspace"
menu.addCommand(
name, lambda: WorkfileSettings().set_colorspace(),
index=(rm_item[0] + 2)
name, lambda: WorkfileSettings().set_colorspace()
)
log.debug("Adding menu item: {}".format(name))
# add item that applies all setting above
name = "Apply All Settings"
menu.addCommand(
name,
lambda: WorkfileSettings().set_context_settings()
)
log.debug("Adding menu item: {}".format(name))
menu.addSeparator()
# add workfile builder menu item
name = "Build Workfile"
menu.addCommand(
name, lambda: BuildWorkfile().process(),
index=(rm_item[0] + 7)
name, lambda: BuildWorkfile().process()
)
log.debug("Adding menu item: {}".format(name))
# add item that applies all setting above
name = "Apply All Settings"
menu.addCommand(
name,
lambda: WorkfileSettings().set_context_settings(),
index=(rm_item[0] + 3)
)
log.debug("Adding menu item: {}".format(name))
# adding shortcuts
add_shortcuts_from_presets()