diff --git a/pype/api.py b/pype/api.py index 0acb80e383..83d52cbc03 100644 --- a/pype/api.py +++ b/pype/api.py @@ -43,7 +43,8 @@ from .lib import ( get_asset_data, modified_environ, add_tool_to_environment, - get_data_hierarchical_attr + get_data_hierarchical_attr, + get_avalon_project_template ) __all__ = [ @@ -81,6 +82,7 @@ __all__ = [ "set_hierarchy", "set_project_code", "get_data_hierarchical_attr", + "get_avalon_project_template", # preloaded templates "Anatomy", diff --git a/pype/nuke/__init__.py b/pype/nuke/__init__.py index a2b1aeda6e..912585feb8 100644 --- a/pype/nuke/__init__.py +++ b/pype/nuke/__init__.py @@ -109,12 +109,6 @@ def install(): # api.set_avalon_workdir() # reload_config() - # import sys - - # for path in sys.path: - # if path.startswith("C:\\Users\\Public"): - # sys.path.remove(path) - log.info("Registering Nuke plug-ins..") pyblish.register_plugin_path(PUBLISH_PATH) avalon.register_plugin_path(avalon.Loader, LOAD_PATH) diff --git a/pype/nuke/lib.py b/pype/nuke/lib.py index 20e7dfb210..06735fc8b0 100644 --- a/pype/nuke/lib.py +++ b/pype/nuke/lib.py @@ -3,7 +3,6 @@ import sys import os from collections import OrderedDict from pprint import pprint -from avalon.vendor.Qt import QtGui from avalon import api, io, lib import avalon.nuke import pype.api as pype @@ -20,6 +19,12 @@ self = sys.modules[__name__] self._project = None +for path in sys.path: + log.info(os.path.normpath(path)) + if "C:\\Users\\Public" in os.path.normpath(path): + log.info("_ removing from sys.path: `{}`".format(path)) + sys.path.remove(path) + def onScriptLoad(): if nuke.env['LINUX']: nuke.tcl('load ffmpegReader') @@ -472,30 +477,30 @@ def update_frame_range(start, end, root=None): else: nuke.root()[key].setValue(value) - -def get_additional_data(container): - """Get Nuke's related data for the container - - Args: - container(dict): the container found by the ls() function - - Returns: - dict - """ - - node = container["_tool"] - tile_color = node['tile_color'].value() - if tile_color is None: - return {} - - hex = '%08x' % tile_color - rgba = [ - float(int(hex[0:2], 16)) / 255.0, - float(int(hex[2:4], 16)) / 255.0, - float(int(hex[4:6], 16)) / 255.0 - ] - - return {"color": QtGui.QColor().fromRgbF(rgba[0], rgba[1], rgba[2])} +# +# def get_additional_data(container): +# """Get Nuke's related data for the container +# +# Args: +# container(dict): the container found by the ls() function +# +# Returns: +# dict +# """ +# +# node = container["_tool"] +# tile_color = node['tile_color'].value() +# if tile_color is None: +# return {} +# +# hex = '%08x' % tile_color +# rgba = [ +# float(int(hex[0:2], 16)) / 255.0, +# float(int(hex[2:4], 16)) / 255.0, +# float(int(hex[4:6], 16)) / 255.0 +# ] +# +# return {"color": Qt.QtGui.QColor().fromRgbF(rgba[0], rgba[1], rgba[2])} def get_write_node_template_attr(node): diff --git a/pype/nukestudio/__init__.py b/pype/nukestudio/__init__.py index 36f3453cf7..c8cdc3e0f8 100644 --- a/pype/nukestudio/__init__.py +++ b/pype/nukestudio/__init__.py @@ -5,18 +5,13 @@ from pyblish import api as pyblish from .. import api -from .menu import install as menu_install - -from .lib import ( - show, - setup, - add_to_filemenu +from .menu import ( + install as menu_install, + _update_menu_task_label ) - from pypeapp import Logger - log = Logger().get_logger(__name__, "nukestudio") AVALON_CONFIG = os.getenv("AVALON_CONFIG", "pype") @@ -35,41 +30,9 @@ if os.getenv("PYBLISH_GUI", None): pyblish.register_gui(os.getenv("PYBLISH_GUI", None)) -def reload_config(): - """Attempt to reload pipeline at run-time. - - CAUTION: This is primarily for development and debugging purposes. - - """ - - import importlib - - for module in ( - "pypeapp", - "{}.api".format(AVALON_CONFIG), - "{}.templates".format(AVALON_CONFIG), - "{}.nukestudio.inventory".format(AVALON_CONFIG), - "{}.nukestudio.lib".format(AVALON_CONFIG), - "{}.nukestudio.menu".format(AVALON_CONFIG), - ): - log.info("Reloading module: {}...".format(module)) - try: - module = importlib.import_module(module) - reload(module) - except Exception as e: - log.warning("Cannot reload module: {}".format(e)) - importlib.reload(module) - - def install(config): - # api.set_avalon_workdir() - # reload_config() - - # import sys - # for path in sys.path: - # if path.startswith("C:\\Users\\Public"): - # sys.path.remove(path) + _register_events() log.info("Registering NukeStudio plug-ins..") pyblish.register_host("nukestudio") @@ -104,6 +67,11 @@ def uninstall(): api.reset_data_from_templates() +def _register_events(): + avalon.on("taskChanged", _update_menu_task_label) + log.info("Installed event callback for 'taskChanged'..") + + def ls(): """List available containers. diff --git a/pype/nukestudio/lib.py b/pype/nukestudio/lib.py index fba8572235..9b05d8af68 100644 --- a/pype/nukestudio/lib.py +++ b/pype/nukestudio/lib.py @@ -8,7 +8,11 @@ import pyblish.api # Host libraries import hiero -from PySide2 import (QtWidgets, QtGui) +from pypeapp import Logger +log = Logger().get_logger(__name__, "nukestudio") + + +from avalon.vendor.Qt import (QtWidgets, QtGui) cached_process = None @@ -19,6 +23,35 @@ self._has_been_setup = False self._has_menu = False self._registered_gui = None +AVALON_CONFIG = os.getenv("AVALON_CONFIG", "pype") + +def reload_config(): + """Attempt to reload pipeline at run-time. + + CAUTION: This is primarily for development and debugging purposes. + + """ + + import importlib + + for module in ( + "avalon.lib", + "avalon.pipeline", + "pypeapp", + "{}.api".format(AVALON_CONFIG), + "{}.templates".format(AVALON_CONFIG), + "{}.nukestudio.lib".format(AVALON_CONFIG), + "{}.nukestudio.menu".format(AVALON_CONFIG), + "{}.nukestudio.tags".format(AVALON_CONFIG) + ): + log.info("Reloading module: {}...".format(module)) + try: + module = importlib.import_module(module) + reload(module) + except Exception as e: + log.warning("Cannot reload module: {}".format(e)) + importlib.reload(module) + def setup(console=False, port=None, menu=True): """Setup integration diff --git a/pype/nukestudio/menu.py b/pype/nukestudio/menu.py index b6e17aeab2..fd63bec2a9 100644 --- a/pype/nukestudio/menu.py +++ b/pype/nukestudio/menu.py @@ -1,7 +1,5 @@ import os -from avalon.api import Session -from pprint import pprint - +import sys import hiero.core try: @@ -12,8 +10,39 @@ except Exception: from hiero.ui import findMenuAction +from avalon.api import Session + +from .tags import add_tags_from_presets + +from .lib import ( + reload_config +) +from pypeapp import Logger + +log = Logger().get_logger(__name__, "nukestudio") + +self = sys.modules[__name__] +self._change_context_menu = None + + +def _update_menu_task_label(*args): + """Update the task label in Avalon menu to current session""" + + object_name = self._change_context_menu + found_menu = findMenuAction(object_name) + + if not found_menu: + log.warning("Can't find menuItem: {}".format(object_name)) + return + + label = "{}, {}".format(Session["AVALON_ASSET"], + Session["AVALON_TASK"]) + + menu = found_menu.menu() + self._change_context_menu = label + menu.setTitle(label) + -# def install(): # here is the best place to add menu from avalon.tools import ( @@ -26,13 +55,17 @@ def install(): libraryloader ) - menu_name = os.environ['PYPE_STUDIO_NAME'] + menu_name = os.environ['AVALON_LABEL'] + + context_label = "{0}, {1}".format( + Session["AVALON_ASSET"], Session["AVALON_TASK"] + ) + + self._change_context_menu = context_label + # Grab Hiero's MenuBar M = hiero.ui.menuBar() - # Add a Menu to the MenuBar - file_action = None - try: check_made_menu = findMenuAction(menu_name) except Exception: @@ -43,50 +76,83 @@ def install(): else: menu = check_made_menu.menu() - actions = [{ - 'action': QAction('Set Context', None), - 'function': contextmanager.show, - 'icon': QIcon('icons:Position.png') - }, + actions = [ { - 'action': QAction('Create...', None), - 'function': creator.show, - 'icon': QIcon('icons:ColorAdd.png') - }, + 'parent': context_label, + 'action': QAction('Set Context', None), + 'function': contextmanager.show, + 'icon': QIcon('icons:Position.png') + }, + "separator", { - 'action': QAction('Load...', None), - 'function': cbloader.show, - 'icon': QIcon('icons:CopyRectangle.png') - }, + 'action': QAction("Work Files...", None), + 'function': (lambda: workfiles.show(os.environ["AVALON_WORKDIR"])), + 'icon': QIcon('icons:Position.png') + }, { - 'action': QAction('Publish...', None), - 'function': publish.show, - 'icon': QIcon('icons:Output.png') - }, + 'action': QAction('Create Default Tags..', None), + 'function': add_tags_from_presets, + 'icon': QIcon('icons:Position.png') + }, + "separator", { - 'action': QAction('Manage...', None), - 'function': cbsceneinventory.show, - 'icon': QIcon('icons:ModifyMetaData.png') - }, + 'action': QAction('Create...', None), + 'function': creator.show, + 'icon': QIcon('icons:ColorAdd.png') + }, { - 'action': QAction('Library...', None), - 'function': libraryloader.show, - 'icon': QIcon('icons:ColorAdd.png') - }] + 'action': QAction('Load...', None), + 'function': cbloader.show, + 'icon': QIcon('icons:CopyRectangle.png') + }, + { + 'action': QAction('Publish...', None), + 'function': publish.show, + 'icon': QIcon('icons:Output.png') + }, + { + 'action': QAction('Manage...', None), + 'function': cbsceneinventory.show, + 'icon': QIcon('icons:ModifyMetaData.png') + }, + { + 'action': QAction('Library...', None), + 'function': libraryloader.show, + 'icon': QIcon('icons:ColorAdd.png') + }, + "separator", + { + 'action': QAction('Reload pipeline...', None), + 'function': reload_config, + 'icon': QIcon('icons:ColorAdd.png') + }] + # Create menu items for a in actions: - pprint(a) - # create action - for k in a.keys(): - if 'action' in k: - action = a[k] - elif 'function' in k: - action.triggered.connect(a[k]) - elif 'icon' in k: - action.setIcon(a[k]) + add_to_menu = menu + if isinstance(a, dict): + # create action + for k in a.keys(): + if 'parent' in k: + submenus = [sm for sm in a[k].split('/')] + submenu = None + for sm in submenus: + if submenu: + submenu.addMenu(sm) + else: + submenu = menu.addMenu(sm) + add_to_menu = submenu + if 'action' in k: + action = a[k] + elif 'function' in k: + action.triggered.connect(a[k]) + elif 'icon' in k: + action.setIcon(a[k]) - # add action to menu - menu.addAction(action) - hiero.ui.registerAction(action) + # add action to menu + add_to_menu.addAction(action) + hiero.ui.registerAction(action) + elif isinstance(a, str): + add_to_menu.addSeparator() diff --git a/pype/nukestudio/precomp_clip.py b/pype/nukestudio/precomp_clip.py new file mode 100644 index 0000000000..9920a2aa31 --- /dev/null +++ b/pype/nukestudio/precomp_clip.py @@ -0,0 +1,148 @@ +from hiero.core import * +from hiero.ui import * +import ft_utils +import re +import os + + +def create_nk_script_clips(script_lst, seq=None): + ''' + nk_scripts is list of dictionaries like: + [{ + 'path': 'P:/Jakub_testy_pipeline/test_v01.nk', + 'name': 'test', + 'timeline_frame_in': 10, + 'handles': 10, + 'source_start': 0, + 'source_end': 54, + 'task': 'Comp-tracking', + 'work_dir': 'VFX_PR', + 'shot': '00010' + }] + ''' + env = ft_utils.Env() + proj = projects()[-1] + root = proj.clipsBin() + + if not seq: + seq = Sequence('NewSequences') + root.addItem(BinItem(seq)) + # todo will ned to define this better + # track = seq[1] # lazy example to get a destination# track + clips_lst = [] + for nk in script_lst: + task_short = env.task_codes[nk['task']] + script_file = task_short + task_path = '/'.join([nk['work_dir'], nk['shot'], nk['task']]) + bin = create_bin_in_project(task_path, proj) + task_path += script_file + + if nk['task'] not in seq.videoTracks(): + track = hiero.core.VideoTrack(nk['task']) + seq.addTrack(track) + else: + track = seq.tracks(nk['task']) + + # create slip media + print nk['path'] + media = MediaSource(nk['path']) + print media + source = Clip(media) + print source + name = os.path.basename(os.path.splitext(nk['path'])[0]) + split_name = split_by_client_version(name, env)[0] or name + print split_name + # print source + # add to bin as clip item + items_in_bin = [b.name() for b in bin.items()] + if split_name not in items_in_bin: + binItem = BinItem(source) + bin.addItem(binItem) + print bin.items() + new_source = [ + item for item in bin.items() if split_name in item.name() + ][0].items()[0].item() + print new_source + # add to track as clip item + trackItem = TrackItem(split_name, TrackItem.kVideo) + trackItem.setSource(new_source) + trackItem.setSourceIn(nk['source_start'] + nk['handles']) + trackItem.setSourceOut(nk['source_end'] - nk['handles']) + trackItem.setTimelineIn(nk['source_start'] + nk['timeline_frame_in']) + trackItem.setTimelineOut( + (nk['source_end'] - (nk['handles'] * 2)) + nk['timeline_frame_in']) + track.addTrackItem(trackItem) + track.addTrackItem(trackItem) + clips_lst.append(trackItem) + + return clips_lst + + +def create_bin_in_project(bin_name='', project=''): + ''' + create bin in project and + if the bin_name is "bin1/bin2/bin3" it will create whole depth + ''' + + if not project: + # get the first loaded project + project = projects()[0] + if not bin_name: + return None + if '/' in bin_name: + bin_name = bin_name.split('/') + else: + bin_name = [bin_name] + + clipsBin = project.clipsBin() + + done_bin_lst = [] + for i, b in enumerate(bin_name): + if i == 0 and len(bin_name) > 1: + if b in [bin.name() for bin in clipsBin.bins()]: + bin = [bin for bin in clipsBin.bins() if b in bin.name()][0] + done_bin_lst.append(bin) + else: + create_bin = Bin(b) + clipsBin.addItem(create_bin) + done_bin_lst.append(create_bin) + + elif i >= 1 and i < len(bin_name) - 1: + if b in [bin.name() for bin in done_bin_lst[i - 1].bins()]: + bin = [ + bin for bin in done_bin_lst[i - 1].bins() + if b in bin.name() + ][0] + done_bin_lst.append(bin) + else: + create_bin = Bin(b) + done_bin_lst[i - 1].addItem(create_bin) + done_bin_lst.append(create_bin) + + elif i == len(bin_name) - 1: + if b in [bin.name() for bin in done_bin_lst[i - 1].bins()]: + bin = [ + bin for bin in done_bin_lst[i - 1].bins() + if b in bin.name() + ][0] + done_bin_lst.append(bin) + else: + create_bin = Bin(b) + done_bin_lst[i - 1].addItem(create_bin) + done_bin_lst.append(create_bin) + # print [bin.name() for bin in clipsBin.bins()] + return done_bin_lst[-1] + + +def split_by_client_version(string, env=None): + if not env: + env = ft_utils.Env() + + client_letter, client_digits = env.get_version_type('client') + regex = "[/_.]" + client_letter + "\d+" + try: + matches = re.findall(regex, string, re.IGNORECASE) + return string.split(matches[0]) + except Exception, e: + print e + return None diff --git a/pype/nukestudio/tags.py b/pype/nukestudio/tags.py new file mode 100644 index 0000000000..863ef80eeb --- /dev/null +++ b/pype/nukestudio/tags.py @@ -0,0 +1,108 @@ +import hiero +import re +from pypeapp import config + + +def create_tag(key, value): + """ + Creating Tag object. + + Args: + key (str): name of tag + value (dict): parameters of tag + + Returns: + object: Tag object + """ + + tag = hiero.core.Tag(str(key)) + tag.setNote(value['note']) + tag.setIcon(value['icon']['path']) + mtd = tag.metadata() + pres_mtd = value.get('metadata', None) + if pres_mtd: + [mtd.setValue("tag.{}".format(k), v) + for k, v in pres_mtd.items()] + + return tag + +def update_tag(tag, value): + """ + Fixing Tag object. + + Args: + tag (obj): Tag object + value (dict): parameters of tag + """ + + tag.setNote(value['note']) + tag.setIcon(value['icon']['path']) + mtd = tag.metadata() + pres_mtd = value.get('metadata', None) + if pres_mtd: + [mtd.setValue("tag.{}".format(k), v) + for k, v in pres_mtd.items()] + + +def add_tags_from_presets(): + """ + Will create default tags from presets. + """ + + # get all presets + presets = config.get_presets() + + # get nukestudio tag.json from presets + nks_pres = presets['nukestudio'] + nks_pres_tags = nks_pres.get("tags", None) + + # get project and root bin object + project = hiero.core.projects()[-1] + root_bin = project.tagsBin() + + for _k, _val in nks_pres_tags.items(): + pattern = re.compile(r"\[(.*)\]") + bin_find = pattern.findall(_k) + if bin_find: + # check what is in root bin + bins = [b for b in root_bin.items() + if b.name() in str(bin_find[0])] + + if bins: + bin = bins[0] + else: + # create Bin object + bin = hiero.core.Bin(str(bin_find[0])) + + for k, v in _val.items(): + tags = [t for t in bin.items() + if str(k) in t.name()] + + if not tags: + # create Tag obj + tag = create_tag(k, v) + + # adding Tag to Bin + bin.addItem(tag) + else: + # update Tag if already exists + update_tag(tags[0], v) + + if not bins: + # adding Tag to Root Bin + root_bin.addItem(bin) + + else: + tags = None + tags = [t for t in root_bin.items() + if str(_k) in t.name()] + + if not tags: + # create Tag + tag = create_tag(_k, _val) + + # adding Tag to Root Bin + root_bin.addItem(tag) + else: + # update Tag if already exists + update_tag(tags[0], _val) diff --git a/pype/plugins/nukestudio/publish/collect_active_project.py b/pype/plugins/nukestudio/publish/collect_active_project.py index 0ac6192e4a..7fcd3c30a0 100644 --- a/pype/plugins/nukestudio/publish/collect_active_project.py +++ b/pype/plugins/nukestudio/publish/collect_active_project.py @@ -4,6 +4,7 @@ import pyblish.api class CollectActiveProject(pyblish.api.ContextPlugin): """Inject the active project into context""" + label = "Collect Active Project" order = pyblish.api.CollectorOrder - 0.2 def process(self, context): diff --git a/pype/plugins/nukestudio/publish/collect_hierarchy_context.py b/pype/plugins/nukestudio/publish/collect_hierarchy_context.py index b421d31f79..6d780c62c8 100644 --- a/pype/plugins/nukestudio/publish/collect_hierarchy_context.py +++ b/pype/plugins/nukestudio/publish/collect_hierarchy_context.py @@ -2,7 +2,7 @@ import pyblish.api from avalon import api -class CollectHierarchyContext(pyblish.api.ContextPlugin): +class CollectHierarchyContext(pyblish.api.InstancePlugin): """Collecting hierarchy context from `parents` and `hierarchy` data present in `clip` family instances coming from the request json data file @@ -13,6 +13,7 @@ class CollectHierarchyContext(pyblish.api.ContextPlugin): label = "Collect Hierarchy Context" order = pyblish.api.CollectorOrder + 0.1 + families = ["clip"] def update_dict(self, ex_dict, new_dict): for key in ex_dict: @@ -22,51 +23,85 @@ class CollectHierarchyContext(pyblish.api.ContextPlugin): new_dict[key] = ex_dict[key] return new_dict - def process(self, context): - json_data = context.data.get("jsonData", None) - temp_context = {} - for instance in json_data['instances']: - if instance['family'] in 'projectfile': - continue + def convert_to_entity(self, key, value): + types = {"shot": "Shot", + "folder": "Folder", + "episode": "Episode", + "Sequence": "Sequence", + } + return {"entity_type": types.get(key, None), "entity_name": value} - in_info = {} - name = instance['name'] - # suppose that all instances are Shots - in_info['entity_type'] = 'Shot' + def process(self, instance): + context = instance.context + tags = instance.data.get("tags", None) + self.log.info(tags) + if tags: + for t in tags: + t_metadata = dict(t["metadata"]) + t_type = t_metadata.get("tag._type", "") + if "hierarchy" in t_type: + self.log.info("__ type: {}".format(t_type)) + d_metadata = dict() + for k, v in t_metadata.items(): + new_k = k.split(".")[1] + try: + d_metadata[new_k] = str(v).format(**context.data) + except Exception: + d_metadata[new_k] = v - instance_pyblish = [ - i for i in context.data["instances"] if i.data['asset'] in name][0] - in_info['custom_attributes'] = { - 'fend': instance_pyblish.data['endFrame'], - 'fstart': instance_pyblish.data['startFrame'], - 'fps': instance_pyblish.data['fps'] - } - in_info['tasks'] = instance['tasks'] + self.log.info("__ projectroot: {}".format(context.data["projectroot"])) + self.log.info("__ d_metadata: {}".format(d_metadata)) + self.log.info( + "__ hierarchy: {}".format(d_metadata["note"])) + # self.log.info("__ hierarchy.format: {}".format(d_metadata["note"].format( + # **d_metadata))) - parents = instance.get('parents', []) - - actual = {name: in_info} - - for parent in reversed(parents): - next_dict = {} - parent_name = parent["entityName"] - next_dict[parent_name] = {} - next_dict[parent_name]["entity_type"] = parent["entityType"] - next_dict[parent_name]["childs"] = actual - actual = next_dict - - temp_context = self.update_dict(temp_context, actual) - self.log.debug(temp_context) - - # TODO: 100% sure way of get project! Will be Name or Code? - project_name = api.Session["AVALON_PROJECT"] - final_context = {} - final_context[project_name] = {} - final_context[project_name]['entity_type'] = 'Project' - final_context[project_name]['childs'] = temp_context - - # adding hierarchy context to instance - context.data["hierarchyContext"] = final_context - self.log.debug("context.data[hierarchyContext] is: {}".format( - context.data["hierarchyContext"])) + # + # json_data = context.data.get("jsonData", None) + # temp_context = {} + # for instance in json_data['instances']: + # if instance['family'] in 'projectfile': + # continue + # + # in_info = {} + # name = instance['name'] + # # suppose that all instances are Shots + # in_info['entity_type'] = 'Shot' + # + # instance_pyblish = [ + # i for i in context.data["instances"] if i.data['asset'] in name][0] + # in_info['custom_attributes'] = { + # 'fend': instance_pyblish.data['endFrame'], + # 'fstart': instance_pyblish.data['startFrame'], + # 'fps': instance_pyblish.data['fps'] + # } + # + # in_info['tasks'] = instance['tasks'] + # + # parents = instance.get('parents', []) + # + # actual = {name: in_info} + # + # for parent in reversed(parents): + # next_dict = {} + # parent_name = parent["entityName"] + # next_dict[parent_name] = {} + # next_dict[parent_name]["entity_type"] = parent["entityType"] + # next_dict[parent_name]["childs"] = actual + # actual = next_dict + # + # temp_context = self.update_dict(temp_context, actual) + # self.log.debug(temp_context) + # + # # TODO: 100% sure way of get project! Will be Name or Code? + # project_name = api.Session["AVALON_PROJECT"] + # final_context = {} + # final_context[project_name] = {} + # final_context[project_name]['entity_type'] = 'Project' + # final_context[project_name]['childs'] = temp_context + # + # # adding hierarchy context to instance + # context.data["hierarchyContext"] = final_context + # self.log.debug("context.data[hierarchyContext] is: {}".format( + # context.data["hierarchyContext"])) diff --git a/pype/plugins/nukestudio/publish/collect_project_root.py b/pype/plugins/nukestudio/publish/collect_project_root.py new file mode 100644 index 0000000000..d6e1fbc560 --- /dev/null +++ b/pype/plugins/nukestudio/publish/collect_project_root.py @@ -0,0 +1,12 @@ +import pyblish.api + + +class CollectActiveProjectRoot(pyblish.api.ContextPlugin): + """Inject the active project into context""" + + label = "Collect Project Root" + order = pyblish.api.CollectorOrder - 0.1 + + def process(self, context): + project = context.data["activeProject"] + context.data["projectroot"] = project.projectRoot() diff --git a/pype/plugins/nukestudio/publish/collect_tags.py b/pype/plugins/nukestudio/publish/collect_tags.py index 9ae34d415f..8c1e12f2be 100644 --- a/pype/plugins/nukestudio/publish/collect_tags.py +++ b/pype/plugins/nukestudio/publish/collect_tags.py @@ -4,7 +4,7 @@ from pyblish import api class CollectClipTags(api.InstancePlugin): """Collect Tags from selected track items.""" - order = api.CollectorOrder + order = api.CollectorOrder + 0.005 label = "Collect Tags" hosts = ["nukestudio"] families = ['clip'] diff --git a/setup/nukestudio/hiero_plugin_path/Icons/2D.png b/setup/nukestudio/hiero_plugin_path/Icons/2D.png new file mode 100644 index 0000000000..69a22ad815 Binary files /dev/null and b/setup/nukestudio/hiero_plugin_path/Icons/2D.png differ diff --git a/setup/nukestudio/hiero_plugin_path/Icons/3D.png b/setup/nukestudio/hiero_plugin_path/Icons/3D.png new file mode 100644 index 0000000000..b3a4af9e24 Binary files /dev/null and b/setup/nukestudio/hiero_plugin_path/Icons/3D.png differ diff --git a/setup/nukestudio/hiero_plugin_path/Icons/add_handles.png b/setup/nukestudio/hiero_plugin_path/Icons/add_handles.png new file mode 100644 index 0000000000..9c8be0d207 Binary files /dev/null and b/setup/nukestudio/hiero_plugin_path/Icons/add_handles.png differ diff --git a/setup/nukestudio/hiero_plugin_path/Icons/add_handles_end.png b/setup/nukestudio/hiero_plugin_path/Icons/add_handles_end.png new file mode 100644 index 0000000000..3885925f99 Binary files /dev/null and b/setup/nukestudio/hiero_plugin_path/Icons/add_handles_end.png differ diff --git a/setup/nukestudio/hiero_plugin_path/Icons/add_handles_start.png b/setup/nukestudio/hiero_plugin_path/Icons/add_handles_start.png new file mode 100644 index 0000000000..ecfd2c2621 Binary files /dev/null and b/setup/nukestudio/hiero_plugin_path/Icons/add_handles_start.png differ diff --git a/setup/nukestudio/hiero_plugin_path/Icons/edit.png b/setup/nukestudio/hiero_plugin_path/Icons/edit.png new file mode 100644 index 0000000000..b0f4c436ec Binary files /dev/null and b/setup/nukestudio/hiero_plugin_path/Icons/edit.png differ diff --git a/setup/nukestudio/hiero_plugin_path/Templates/fusion.png b/setup/nukestudio/hiero_plugin_path/Icons/fusion.png similarity index 100% rename from setup/nukestudio/hiero_plugin_path/Templates/fusion.png rename to setup/nukestudio/hiero_plugin_path/Icons/fusion.png diff --git a/setup/nukestudio/hiero_plugin_path/Icons/hierarchy.png b/setup/nukestudio/hiero_plugin_path/Icons/hierarchy.png new file mode 100644 index 0000000000..55b4f9843b Binary files /dev/null and b/setup/nukestudio/hiero_plugin_path/Icons/hierarchy.png differ diff --git a/setup/nukestudio/hiero_plugin_path/Templates/houdini.png b/setup/nukestudio/hiero_plugin_path/Icons/houdini.png similarity index 100% rename from setup/nukestudio/hiero_plugin_path/Templates/houdini.png rename to setup/nukestudio/hiero_plugin_path/Icons/houdini.png diff --git a/setup/nukestudio/hiero_plugin_path/Templates/maya.png b/setup/nukestudio/hiero_plugin_path/Icons/maya.png similarity index 100% rename from setup/nukestudio/hiero_plugin_path/Templates/maya.png rename to setup/nukestudio/hiero_plugin_path/Icons/maya.png diff --git a/setup/nukestudio/hiero_plugin_path/Templates/nuke.png b/setup/nukestudio/hiero_plugin_path/Icons/nuke.png similarity index 100% rename from setup/nukestudio/hiero_plugin_path/Templates/nuke.png rename to setup/nukestudio/hiero_plugin_path/Icons/nuke.png diff --git a/setup/nukestudio/hiero_plugin_path/Templates/volume.png b/setup/nukestudio/hiero_plugin_path/Icons/volume.png similarity index 100% rename from setup/nukestudio/hiero_plugin_path/Templates/volume.png rename to setup/nukestudio/hiero_plugin_path/Icons/volume.png diff --git a/setup/nukestudio/hiero_plugin_path/Templates/SharedTags.hrox b/setup/nukestudio/hiero_plugin_path/Templates/SharedTags.hrox deleted file mode 100644 index 128bde5456..0000000000 --- a/setup/nukestudio/hiero_plugin_path/Templates/SharedTags.hrox +++ /dev/null @@ -1,472 +0,0 @@ - - - - - - - 2 - 70 - 0 - 0 - 13 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2 - 70 - 0 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 70 - 0 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2 - 70 - 0 - 0 - - - 2 - 70 - 0 - 0 - 17 - - - 2 - 70 - 0 - 0 - 2 - - - - - - - - -