Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #617 from pypeclub/feature/616-convert-nukestudio-…
Browse files Browse the repository at this point in the history
…to-hiero-host

Renaming nukestudio host folder to hiero
  • Loading branch information
mkolar authored Oct 7, 2020
2 parents c630b8a + 333c764 commit 81e80e0
Show file tree
Hide file tree
Showing 107 changed files with 131 additions and 123 deletions.
24 changes: 12 additions & 12 deletions pype/hosts/nukestudio/__init__.py → pype/hosts/hiero/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@
]

# get logger
log = Logger().get_logger(__name__, "nukestudio")
log = Logger().get_logger(__name__, "hiero")


''' Creating all important host related variables '''
AVALON_CONFIG = os.getenv("AVALON_CONFIG", "pype")

# plugin root path
PUBLISH_PATH = os.path.join(PLUGINS_DIR, "nukestudio", "publish")
LOAD_PATH = os.path.join(PLUGINS_DIR, "nukestudio", "load")
CREATE_PATH = os.path.join(PLUGINS_DIR, "nukestudio", "create")
INVENTORY_PATH = os.path.join(PLUGINS_DIR, "nukestudio", "inventory")
PUBLISH_PATH = os.path.join(PLUGINS_DIR, "hiero", "publish")
LOAD_PATH = os.path.join(PLUGINS_DIR, "hiero", "load")
CREATE_PATH = os.path.join(PLUGINS_DIR, "hiero", "create")
INVENTORY_PATH = os.path.join(PLUGINS_DIR, "hiero", "inventory")

# registering particular pyblish gui but `lite` is recomended!!
if os.getenv("PYBLISH_GUI", None):
Expand All @@ -50,7 +50,7 @@

def install():
"""
Installing Nukestudio integration for avalon
Installing Hiero integration for avalon
Args:
config (obj): avalon config module `pype` in our case, it is not
Expand All @@ -61,8 +61,8 @@ def install():
# adding all events
_register_events()

log.info("Registering NukeStudio plug-ins..")
pyblish.register_host("nukestudio")
log.info("Registering Hiero plug-ins..")
pyblish.register_host("hiero")
pyblish.register_plugin_path(PUBLISH_PATH)
avalon.register_plugin_path(avalon.Loader, LOAD_PATH)
avalon.register_plugin_path(avalon.Creator, CREATE_PATH)
Expand All @@ -87,11 +87,11 @@ def install():

def uninstall():
"""
Uninstalling Nukestudio integration for avalon
Uninstalling Hiero integration for avalon
"""
log.info("Deregistering NukeStudio plug-ins..")
pyblish.deregister_host("nukestudio")
log.info("Deregistering Hiero plug-ins..")
pyblish.deregister_host("hiero")
pyblish.deregister_plugin_path(PUBLISH_PATH)
avalon.deregister_plugin_path(avalon.Loader, LOAD_PATH)
avalon.deregister_plugin_path(avalon.Creator, CREATE_PATH)
Expand All @@ -102,7 +102,7 @@ def _register_events():
Adding all callbacks.
"""

# if task changed then change notext of nukestudio
# if task changed then change notext of hiero
avalon.on("taskChanged", _update_menu_task_label)
log.info("Installed event callback for 'taskChanged'..")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from .lib import sync_avalon_data_to_workfile, launch_workfiles_app
from .tags import add_tags_from_presets

log = Logger().get_logger(__name__, "nukestudio")
log = Logger().get_logger(__name__, "hiero")


def startupCompleted(event):
Expand Down
10 changes: 5 additions & 5 deletions pype/hosts/nukestudio/lib.py → pype/hosts/hiero/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import pype.api as pype
from pype.api import Logger, Anatomy

log = Logger().get_logger(__name__, "nukestudio")
log = Logger().get_logger(__name__, "hiero")

cached_process = None

Expand Down Expand Up @@ -82,7 +82,7 @@ def sync_avalon_data_to_workfile():

def launch_workfiles_app(event):
"""
Event for launching workfiles after nukestudio start
Event for launching workfiles after hiero start
Args:
event (obj): required but unused
Expand All @@ -109,9 +109,9 @@ def reload_config():
"pypeapp",
"{}.api".format(AVALON_CONFIG),
"{}.templates".format(AVALON_CONFIG),
"{}.hosts.nukestudio.lib".format(AVALON_CONFIG),
"{}.hosts.nukestudio.menu".format(AVALON_CONFIG),
"{}.hosts.nukestudio.tags".format(AVALON_CONFIG)
"{}.hosts.hiero.lib".format(AVALON_CONFIG),
"{}.hosts.hiero.menu".format(AVALON_CONFIG),
"{}.hosts.hiero.tags".format(AVALON_CONFIG)
):
log.info("Reloading module: {}...".format(module))
try:
Expand Down
4 changes: 2 additions & 2 deletions pype/hosts/nukestudio/menu.py → pype/hosts/hiero/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
set_workfiles
)

log = Logger().get_logger(__name__, "nukestudio")
log = Logger().get_logger(__name__, "hiero")

self = sys.modules[__name__]
self._change_context_menu = None
Expand All @@ -38,7 +38,7 @@ def _update_menu_task_label(*args):

def install():
"""
Installing menu into Nukestudio
Installing menu into Hiero
"""

Expand Down
File renamed without changes.
12 changes: 8 additions & 4 deletions pype/hosts/nukestudio/tags.py → pype/hosts/hiero/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
import json
import hiero

from pprint import pformat

from pype.api import Logger
from avalon import io

log = Logger().get_logger(__name__, "nukestudio")
log = Logger().get_logger(__name__, "hiero")


def tag_data():
Expand Down Expand Up @@ -65,21 +67,23 @@ def add_tags_from_presets():

log.debug("Setting default tags on project: {}".format(project.name()))

# get nukestudio tags.json
# get hiero tags.json
nks_pres_tags = tag_data()

# Get project task types.
tasks = io.find_one({"type": "project"})["config"]["tasks"]
nks_pres_tags["[Tasks]"] = {}
log.debug("__ tasks: {}".format(pformat(tasks)))
for task_type in tasks.keys():
nks_pres_tags["[Tasks]"][task_type] = {
nks_pres_tags["[Tasks]"][task_type.lower()] = {
"editable": "1",
"note": "",
"icon": {
"path": "icons:TagGood.png"
},
"metadata": {
"family": "task"
"family": "task",
"type": task_type
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
from pype.api import Logger


log = Logger().get_logger(__name__, "nukestudio")
log = Logger().get_logger(__name__, "hiero")


def file_extensions():
return api.HOST_WORKFILE_EXTENSIONS["nukestudio"]
return api.HOST_WORKFILE_EXTENSIONS["hiero"]


def has_unsaved_changes():
Expand Down
12 changes: 7 additions & 5 deletions pype/plugins/ftrack/publish/integrate_hierarchy_ftrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,17 @@ def import_to_ftrack(self, input_data, parent=None):
# existing_tasks.append(child['type']['name'])

for task in tasks:
if task.lower() in existing_tasks:
task_name = next(iter(task))
task_type = task[task_name]["type"]
if task_name.lower() in existing_tasks:
print("Task {} already exists".format(task))
continue
tasks_to_create.append(task)
tasks_to_create.append((task_name, task_type))

for task in tasks_to_create:
for task_name, task_type in tasks_to_create:
self.create_task(
name=task,
task_type=task,
name=task_name,
task_type=task_type,
parent=entity
)
try:
Expand Down
2 changes: 1 addition & 1 deletion pype/plugins/global/publish/extract_burnin.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ExtractBurnin(pype.api.Extractor):
"nuke",
"maya",
"shell",
"nukestudio",
"hiero",
"premiere",
"standalonepublisher",
"harmony"
Expand Down
13 changes: 7 additions & 6 deletions pype/plugins/global/publish/extract_hierarchy_avalon.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,13 @@ def import_to_avalon(self, input_data, parent=None):
# Do not override data, only update
cur_entity_data = entity.get("data") or {}
new_tasks = data.pop("tasks", {})
if "tasks" in cur_entity_data and new_tasks:
for task_name in new_tasks.keys():
if task_name \
not in cur_entity_data["tasks"].keys():
cur_entity_data["tasks"][task_name] = \
new_tasks[task_name]
if "tasks" not in cur_entity_data and not new_tasks:
continue
for task in new_tasks:
task_name = next(iter(task))
if task_name in cur_entity_data["tasks"].keys():
continue
cur_entity_data["tasks"][task_name] = task[task_name]
cur_entity_data.update(data)
data = cur_entity_data
else:
Expand Down
2 changes: 1 addition & 1 deletion pype/plugins/global/publish/extract_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ExtractReview(pyblish.api.InstancePlugin):
"nuke",
"maya",
"shell",
"nukestudio",
"hiero",
"premiere",
"harmony",
"standalonepublisher",
Expand Down
9 changes: 4 additions & 5 deletions pype/plugins/global/publish/integrate_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,8 @@ def register(self, instance):
# get 'files' info for representation and all attached resources
self.log.debug("Preparing files information ...")
representation["files"] = self.get_files_info(
instance,
self.integrated_file_sizes)
instance,
self.integrated_file_sizes)

self.log.debug("__ representation: {}".format(representation))
destination_list.append(dst)
Expand All @@ -543,10 +543,9 @@ def register(self, instance):
repre_ids_to_remove.append(repre["_id"])
io.delete_many({"_id": {"$in": repre_ids_to_remove}})

self.log.debug("__ representations: {}".format(representations))
for rep in instance.data["representations"]:
self.log.debug("__ represNAME: {}".format(rep['name']))
self.log.debug("__ represPATH: {}".format(rep['published_path']))
self.log.debug("__ rep: {}".format(rep))

io.insert_many(representations)
instance.data["published_representations"] = (
published_representations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ValidateFtrackAttributes(pyblish.api.InstancePlugin):
"houdini",
"maya",
"nuke",
"nukestudio",
"hiero",
"photoshop",
"premiere",
"resolve",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class CollectClipMetadata(api.InstancePlugin):

order = api.CollectorOrder + 0.01
label = "Collect Metadata"
hosts = ["nukestudio"]
hosts = ["hiero"]

def process(self, instance):
item = instance.data["item"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class CollectClipTimecodes(pyblish.api.InstancePlugin):

order = pyblish.api.CollectorOrder + 0.101
label = "Collect Timecodes"
hosts = ["nukestudio"]
hosts = ["hiero"]

def process(self, instance):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ExtractPlateCheck(api.ContextPlugin):

order = api.ExtractorOrder + 0.01
label = "Plates Export Waiting"
hosts = ["nukestudio"]
hosts = ["hiero"]
families = ["encode"]

def process(self, context):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class ExtractTasks(api.InstancePlugin):

order = api.ExtractorOrder
label = "Tasks"
hosts = ["nukestudio"]
hosts = ["hiero"]
families = ["clip"]
optional = True

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ValidateProjectRoot(api.ContextPlugin):

order = api.ValidatorOrder
label = "Project Root"
hosts = ["nukestudio"]
hosts = ["hiero"]
actions = [RepairProjectRoot]

def process(self, context):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class ValidateResolvedPaths(api.ContextPlugin):

order = api.ValidatorOrder
label = "Resolved Paths"
hosts = ["nukestudio"]
hosts = ["hiero"]

def process(self, context):
import os
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ValidateOutputRange(api.InstancePlugin):
order = api.ValidatorOrder
families = ["trackItem.task"]
label = "Output Range"
hosts = ["nukestudio"]
hosts = ["hiero"]
optional = True

def process(self, instance):
Expand Down Expand Up @@ -43,7 +43,7 @@ class ValidateImageSequence(api.InstancePlugin):
families = ["trackItem.task", "img"]
match = api.Subset
label = "Image Sequence"
hosts = ["nukestudio"]
hosts = ["hiero"]
optional = True

def process(self, instance):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ValidateClip(api.InstancePlugin):
families = ["clip"]
# match = api.Exact
label = "Validate Track Item"
hosts = ["nukestudio"]
hosts = ["hiero"]
optional = True

def process(self, instance):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@


class ValidateViewerLut(api.ContextPlugin):
"""Validate viewer lut in NukeStudio is the same as in Nuke."""
"""Validate viewer lut in Hiero is the same as in Nuke."""

order = api.ValidatorOrder
label = "Viewer LUT"
hosts = ["nukestudio"]
hosts = ["hiero"]
optional = True

def process(self, context):
import nuke
import hiero

# nuke_lut = nuke.ViewerProcess.node()["current"].value()
nukestudio_lut = context.data["activeProject"].lutSettingViewer()
self.log.info("__ nukestudio_lut: {}".format(nukestudio_lut))
hiero_lut = context.data["activeProject"].lutSettingViewer()
self.log.info("__ hiero_lut: {}".format(hiero_lut))

msg = "Viewer LUT can only be RGB"
assert "RGB" in nukestudio_lut, msg
assert "RGB" in hiero_lut, msg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from avalon import api
import hiero
from pype.hosts.nukestudio import lib
from pype.hosts.hiero import lib
reload(lib)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class CollectAssetBuilds(api.ContextPlugin):
# Run just after CollectClip
order = api.CollectorOrder + 0.02
label = "Collect AssetBuilds"
hosts = ["nukestudio"]
hosts = ["hiero"]

def process(self, context):
asset_builds = {}
Expand Down
Loading

0 comments on commit 81e80e0

Please sign in to comment.