Skip to content

Commit

Permalink
Merge pull request #270 from tokejepsen/nukeassist
Browse files Browse the repository at this point in the history
Add NukeAssist support.
  • Loading branch information
tokejepsen authored Nov 23, 2017
2 parents a6e00d7 + abe2416 commit b18e9b4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
33 changes: 32 additions & 1 deletion pyblish_qml/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ def install_host(modal):
for install in (_install_maya,
_install_houdini,
_install_nuke,
_install_nukeassist,
_install_hiero,
_install_nukestudio):
try:
Expand Down Expand Up @@ -377,7 +378,12 @@ def _install_nuke(modal):
"""Helper function to The Foundry Nuke support"""
import nuke

if "--hiero" in nuke.rawArgs or "--studio" in nuke.rawArgs:
not_nuke_launch = (
"--hiero" in nuke.rawArgs or
"--studio" in nuke.rawArgs or
"--nukeassist" in nuke.rawArgs
)
if not_nuke_launch:
raise ImportError

def threaded_wrapper(func, *args, **kwargs):
Expand All @@ -398,6 +404,31 @@ def threaded_wrapper(func, *args, **kwargs):
settings.WindowTitle = "Pyblish (Nuke)"


def _install_nukeassist(modal):
"""Helper function to The Foundry NukeAssist support"""
import nuke

if "--nukeassist" not in nuke.rawArgs:
raise ImportError

def threaded_wrapper(func, *args, **kwargs):
return nuke.executeInMainThreadWithResult(
func, args, kwargs)

sys.stdout.write("Setting up Pyblish QML in NukeAssist\n")
if not modal:
register_dispatch_wrapper(threaded_wrapper)

app = QtWidgets.QApplication.instance()
app.aboutToQuit.connect(_on_application_quit)
_connect_host_event(app)

if settings.ContextLabel == settings.ContextLabelDefault:
settings.ContextLabel = "NukeAssist"
if settings.WindowTitle == settings.WindowTitleDefault:
settings.WindowTitle = "Pyblish (NukeAssist)"


def _install_hiero(modal):
"""Helper function to The Foundry Hiero support"""
import hiero
Expand Down
2 changes: 1 addition & 1 deletion pyblish_qml/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

VERSION_MAJOR = 1
VERSION_MINOR = 5
VERSION_MINOR = 6
VERSION_PATCH = 0

version_info = (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)
Expand Down

0 comments on commit b18e9b4

Please sign in to comment.