diff --git a/.github/workflows/automate-projects.yml b/.github/workflows/automate-projects.yml new file mode 100644 index 0000000000..b605071c2d --- /dev/null +++ b/.github/workflows/automate-projects.yml @@ -0,0 +1,19 @@ +name: Automate Projects + +on: + issues: + types: [opened, labeled] +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + assign_one_project: + runs-on: ubuntu-latest + name: Assign to One Project + steps: + - name: Assign NEW bugs to triage + uses: srggrs/assign-one-project-github-action@1.2.0 + if: contains(github.event.issue.labels.*.name, 'bug') + with: + project: 'https://github.com/pypeclub/pype/projects/2' + column_name: 'Needs triage' diff --git a/pype/__init__.py b/pype/__init__.py index 9ca0380bf3..2a922547e8 100644 --- a/pype/__init__.py +++ b/pype/__init__.py @@ -2,8 +2,8 @@ import os from pyblish import api as pyblish from avalon import api as avalon +from .api import config, Anatomy from .lib import filter_pyblish_plugins -from pypeapp import config, Anatomy import logging diff --git a/pype/api.py b/pype/api.py index 2c227b5b4b..ae42bd99ba 100644 --- a/pype/api.py +++ b/pype/api.py @@ -1,5 +1,12 @@ -from .plugin import ( +from pypeapp import ( + Logger, + Anatomy, + project_overrides_dir_path, + config, + execute +) +from .plugin import ( Extractor, ValidatePipelineOrder, @@ -16,8 +23,6 @@ from .action import ( RepairContextAction ) -from pypeapp import Logger - from .lib import ( version_up, get_asset, @@ -33,6 +38,12 @@ from .lib import ( from .lib import _subprocess as subprocess __all__ = [ + "Logger", + "Anatomy", + "project_overrides_dir_path", + "config", + "execute", + # plugin classes "Extractor", # ordering diff --git a/pype/harmony/__init__.py b/pype/harmony/__init__.py new file mode 100644 index 0000000000..b3edca7d15 --- /dev/null +++ b/pype/harmony/__init__.py @@ -0,0 +1,39 @@ +import os + +from avalon import api, harmony +import pyblish.api + + +def install(): + print("Installing Pype config...") + + plugins_directory = os.path.join( + os.path.dirname(os.path.dirname(__file__)), "plugins", "harmony" + ) + + pyblish.api.register_plugin_path( + os.path.join(plugins_directory, "publish") + ) + api.register_plugin_path( + api.Loader, os.path.join(plugins_directory, "load") + ) + api.register_plugin_path( + api.Creator, os.path.join(plugins_directory, "create") + ) + + pyblish.api.register_callback( + "instanceToggled", on_pyblish_instance_toggled + ) + + +def on_pyblish_instance_toggled(instance, old_value, new_value): + """Toggle node enabling on instance toggles.""" + func = """function func(args) + { + node.setEnable(args[0], args[1]) + } + func + """ + harmony.send( + {"function": func, "args": [instance[0], new_value]} + ) diff --git a/pype/hooks/premiere/prelaunch.py b/pype/hooks/premiere/prelaunch.py index f2edb60195..c2cb73645a 100644 --- a/pype/hooks/premiere/prelaunch.py +++ b/pype/hooks/premiere/prelaunch.py @@ -1,8 +1,8 @@ import os import traceback from pype.lib import PypeHook -from pypeapp import Logger -from pype.premiere import lib as prlib +from pype.api import Logger +from pype.hosts.premiere import lib as prlib class PremierePrelaunch(PypeHook): @@ -27,7 +27,7 @@ class PremierePrelaunch(PypeHook): env = os.environ try: - __import__("pype.premiere") + __import__("pype.hosts.premiere") __import__("pyblish") except ImportError as e: diff --git a/pype/hooks/unreal/unreal_prelaunch.py b/pype/hooks/unreal/unreal_prelaunch.py index 5b6b8e08e0..9f0cc45b96 100644 --- a/pype/hooks/unreal/unreal_prelaunch.py +++ b/pype/hooks/unreal/unreal_prelaunch.py @@ -2,8 +2,8 @@ import logging import os from pype.lib import PypeHook -from pype.unreal import lib as unreal_lib -from pypeapp import Logger +from pype.hosts.unreal import lib as unreal_lib +from pype.api import Logger log = logging.getLogger(__name__) diff --git a/pype/fusion/scripts/__init__.py b/pype/hosts/__init__.py similarity index 100% rename from pype/fusion/scripts/__init__.py rename to pype/hosts/__init__.py diff --git a/pype/blender/__init__.py b/pype/hosts/blender/__init__.py similarity index 88% rename from pype/blender/__init__.py rename to pype/hosts/blender/__init__.py index 4f52b4168a..a6d3cd82ef 100644 --- a/pype/blender/__init__.py +++ b/pype/hosts/blender/__init__.py @@ -5,9 +5,7 @@ import traceback from avalon import api as avalon from pyblish import api as pyblish -PARENT_DIR = os.path.dirname(__file__) -PACKAGE_DIR = os.path.dirname(PARENT_DIR) -PLUGINS_DIR = os.path.join(PACKAGE_DIR, "plugins") +from pype import PLUGINS_DIR PUBLISH_PATH = os.path.join(PLUGINS_DIR, "blender", "publish") LOAD_PATH = os.path.join(PLUGINS_DIR, "blender", "load") diff --git a/pype/blender/action.py b/pype/hosts/blender/action.py similarity index 96% rename from pype/blender/action.py rename to pype/hosts/blender/action.py index 4bd7e303fc..78d00f56ad 100644 --- a/pype/blender/action.py +++ b/pype/hosts/blender/action.py @@ -2,7 +2,7 @@ import bpy import pyblish.api -from ..action import get_errored_instances_from_context +from ...action import get_errored_instances_from_context class SelectInvalidAction(pyblish.api.Action): diff --git a/pype/blender/plugin.py b/pype/hosts/blender/plugin.py similarity index 100% rename from pype/blender/plugin.py rename to pype/hosts/blender/plugin.py diff --git a/pype/fusion/__init__.py b/pype/hosts/fusion/__init__.py similarity index 94% rename from pype/fusion/__init__.py rename to pype/hosts/fusion/__init__.py index d6efaa54d3..7af75cebc8 100644 --- a/pype/fusion/__init__.py +++ b/pype/hosts/fusion/__init__.py @@ -2,11 +2,7 @@ import os from avalon import api as avalon from pyblish import api as pyblish - - -PARENT_DIR = os.path.dirname(__file__) -PACKAGE_DIR = os.path.dirname(PARENT_DIR) -PLUGINS_DIR = os.path.join(PACKAGE_DIR, "plugins") +from pype import PLUGINS_DIR PUBLISH_PATH = os.path.join(PLUGINS_DIR, "fusion", "publish") LOAD_PATH = os.path.join(PLUGINS_DIR, "fusion", "load") diff --git a/pype/fusion/lib.py b/pype/hosts/fusion/lib.py similarity index 100% rename from pype/fusion/lib.py rename to pype/hosts/fusion/lib.py diff --git a/pype/logging/gui/__init__.py b/pype/hosts/fusion/scripts/__init__.py similarity index 100% rename from pype/logging/gui/__init__.py rename to pype/hosts/fusion/scripts/__init__.py diff --git a/pype/fusion/scripts/fusion_switch_shot.py b/pype/hosts/fusion/scripts/fusion_switch_shot.py similarity index 99% rename from pype/fusion/scripts/fusion_switch_shot.py rename to pype/hosts/fusion/scripts/fusion_switch_shot.py index 9cc572164d..4cb20c3a61 100644 --- a/pype/fusion/scripts/fusion_switch_shot.py +++ b/pype/hosts/fusion/scripts/fusion_switch_shot.py @@ -8,8 +8,8 @@ from avalon import api, io, pipeline import avalon.fusion # Config imports -import pype.lib pype -import pype.fusion.lib as fusion_lib +import pype.lib as pype +import pype.hosts.fusion.lib as fusion_lib log = logging.getLogger("Update Slap Comp") diff --git a/pype/fusion/scripts/publish_filesequence.py b/pype/hosts/fusion/scripts/publish_filesequence.py similarity index 100% rename from pype/fusion/scripts/publish_filesequence.py rename to pype/hosts/fusion/scripts/publish_filesequence.py diff --git a/pype/hosts/harmony/__init__.py b/pype/hosts/harmony/__init__.py new file mode 100644 index 0000000000..b3edca7d15 --- /dev/null +++ b/pype/hosts/harmony/__init__.py @@ -0,0 +1,39 @@ +import os + +from avalon import api, harmony +import pyblish.api + + +def install(): + print("Installing Pype config...") + + plugins_directory = os.path.join( + os.path.dirname(os.path.dirname(__file__)), "plugins", "harmony" + ) + + pyblish.api.register_plugin_path( + os.path.join(plugins_directory, "publish") + ) + api.register_plugin_path( + api.Loader, os.path.join(plugins_directory, "load") + ) + api.register_plugin_path( + api.Creator, os.path.join(plugins_directory, "create") + ) + + pyblish.api.register_callback( + "instanceToggled", on_pyblish_instance_toggled + ) + + +def on_pyblish_instance_toggled(instance, old_value, new_value): + """Toggle node enabling on instance toggles.""" + func = """function func(args) + { + node.setEnable(args[0], args[1]) + } + func + """ + harmony.send( + {"function": func, "args": [instance[0], new_value]} + ) diff --git a/pype/houdini/__init__.py b/pype/hosts/houdini/__init__.py similarity index 92% rename from pype/houdini/__init__.py rename to pype/hosts/houdini/__init__.py index 08afd97e41..1da6a7774b 100644 --- a/pype/houdini/__init__.py +++ b/pype/hosts/houdini/__init__.py @@ -8,20 +8,16 @@ from pyblish import api as pyblish from avalon import api as avalon from avalon.houdini import pipeline as houdini -from pype.houdini import lib +from pype.hosts.houdini import lib from pype.lib import any_outdated - - -PARENT_DIR = os.path.dirname(__file__) -PACKAGE_DIR = os.path.dirname(PARENT_DIR) -PLUGINS_DIR = os.path.join(PACKAGE_DIR, "plugins") +from pype import PLUGINS_DIR PUBLISH_PATH = os.path.join(PLUGINS_DIR, "houdini", "publish") LOAD_PATH = os.path.join(PLUGINS_DIR, "houdini", "load") CREATE_PATH = os.path.join(PLUGINS_DIR, "houdini", "create") -log = logging.getLogger("pype.houdini") +log = logging.getLogger("pype.hosts.houdini") def install(): diff --git a/pype/houdini/lib.py b/pype/hosts/houdini/lib.py similarity index 99% rename from pype/houdini/lib.py rename to pype/hosts/houdini/lib.py index 10b5386a2e..5087fba934 100644 --- a/pype/houdini/lib.py +++ b/pype/hosts/houdini/lib.py @@ -210,7 +210,7 @@ def validate_fps(): if current_fps != fps: - from ..widgets import popup + from ...widgets import popup # Find main window parent = hou.ui.mainQtWindow() diff --git a/pype/maya/__init__.py b/pype/hosts/maya/__init__.py similarity index 90% rename from pype/maya/__init__.py rename to pype/hosts/maya/__init__.py index fdc061f069..afd2e399eb 100644 --- a/pype/maya/__init__.py +++ b/pype/hosts/maya/__init__.py @@ -9,17 +9,13 @@ from avalon.maya.pipeline import IS_HEADLESS from avalon.tools import workfiles from pyblish import api as pyblish -from ..lib import ( - any_outdated -) +from ...lib import any_outdated +from pype import PLUGINS_DIR + from . import menu from . import lib -log = logging.getLogger("pype.maya") - -PARENT_DIR = os.path.dirname(__file__) -PACKAGE_DIR = os.path.dirname(PARENT_DIR) -PLUGINS_DIR = os.path.join(PACKAGE_DIR, "plugins") +log = logging.getLogger("pype.hosts.maya") PUBLISH_PATH = os.path.join(PLUGINS_DIR, "maya", "publish") LOAD_PATH = os.path.join(PLUGINS_DIR, "maya", "load") @@ -30,7 +26,7 @@ def install(): pyblish.register_plugin_path(PUBLISH_PATH) avalon.register_plugin_path(avalon.Loader, LOAD_PATH) avalon.register_plugin_path(avalon.Creator, CREATE_PATH) - + log.info(PUBLISH_PATH) menu.install() log.info("Installing callbacks ... ") @@ -153,14 +149,14 @@ def on_open(_): """On scene open let's assume the containers have changed.""" from avalon.vendor.Qt import QtWidgets - from ..widgets import popup + from ...widgets import popup cmds.evalDeferred( - "from pype.maya import lib;lib.remove_render_layer_observer()") + "from pype.hosts.maya import lib;lib.remove_render_layer_observer()") cmds.evalDeferred( - "from pype.maya import lib;lib.add_render_layer_observer()") + "from pype.hosts.maya import lib;lib.add_render_layer_observer()") cmds.evalDeferred( - "from pype.maya import lib;lib.add_render_layer_change_observer()") + "from pype.hosts.maya import lib;lib.add_render_layer_change_observer()") # # Update current task for the current scene # update_task_from_path(cmds.file(query=True, sceneName=True)) @@ -200,11 +196,11 @@ def on_new(_): avalon.logger.info("Running callback on new..") with maya.suspended_refresh(): cmds.evalDeferred( - "from pype.maya import lib;lib.remove_render_layer_observer()") + "from pype.hosts.maya import lib;lib.remove_render_layer_observer()") cmds.evalDeferred( - "from pype.maya import lib;lib.add_render_layer_observer()") + "from pype.hosts.maya import lib;lib.add_render_layer_observer()") cmds.evalDeferred( - "from pype.maya import lib;lib.add_render_layer_change_observer()") + "from pype.hosts.maya import lib;lib.add_render_layer_change_observer()") lib.set_context_settings() diff --git a/pype/maya/action.py b/pype/hosts/maya/action.py similarity index 97% rename from pype/maya/action.py rename to pype/hosts/maya/action.py index 2dcdb82dc9..bb6815ed7d 100644 --- a/pype/maya/action.py +++ b/pype/hosts/maya/action.py @@ -4,7 +4,7 @@ from __future__ import absolute_import import pyblish.api -from ..action import get_errored_instances_from_context +from ...action import get_errored_instances_from_context class GenerateUUIDsOnInvalidAction(pyblish.api.Action): @@ -72,7 +72,7 @@ class GenerateUUIDsOnInvalidAction(pyblish.api.Action): nodes (list): all nodes to regenerate ids on """ - import pype.maya.lib as lib + from pype.hosts.maya import lib import avalon.io as io asset = instance.data['asset'] diff --git a/pype/maya/customize.py b/pype/hosts/maya/customize.py similarity index 100% rename from pype/maya/customize.py rename to pype/hosts/maya/customize.py diff --git a/pype/maya/lib.py b/pype/hosts/maya/lib.py similarity index 99% rename from pype/maya/lib.py rename to pype/hosts/maya/lib.py index a06810ea94..2dda198d45 100644 --- a/pype/maya/lib.py +++ b/pype/hosts/maya/lib.py @@ -1899,7 +1899,7 @@ def validate_fps(): if current_fps != fps: from avalon.vendor.Qt import QtWidgets - from ..widgets import popup + from ...widgets import popup # Find maya main window top_level_widgets = {w.objectName(): w for w in @@ -2622,7 +2622,7 @@ def update_content_on_context_change(): def show_message(title, msg): from avalon.vendor.Qt import QtWidgets - from ..widgets import message_window + from ...widgets import message_window # Find maya main window top_level_widgets = {w.objectName(): w for w in diff --git a/pype/maya/menu.json b/pype/hosts/maya/menu.json similarity index 100% rename from pype/maya/menu.json rename to pype/hosts/maya/menu.json diff --git a/pype/maya/menu.py b/pype/hosts/maya/menu.py similarity index 98% rename from pype/maya/menu.py rename to pype/hosts/maya/menu.py index 70df50b9e6..70ad8d31ca 100644 --- a/pype/maya/menu.py +++ b/pype/hosts/maya/menu.py @@ -4,7 +4,7 @@ import logging from avalon.vendor.Qt import QtWidgets, QtGui from avalon.maya import pipeline -from ..lib import BuildWorkfile +from ...lib import BuildWorkfile import maya.cmds as cmds self = sys.modules[__name__] diff --git a/pype/maya/menu_backup.json b/pype/hosts/maya/menu_backup.json similarity index 100% rename from pype/maya/menu_backup.json rename to pype/hosts/maya/menu_backup.json diff --git a/pype/maya/plugin.py b/pype/hosts/maya/plugin.py similarity index 100% rename from pype/maya/plugin.py rename to pype/hosts/maya/plugin.py diff --git a/pype/nuke/__init__.py b/pype/hosts/nuke/__init__.py similarity index 89% rename from pype/nuke/__init__.py rename to pype/hosts/nuke/__init__.py index 5ab996b78a..787f69f635 100644 --- a/pype/nuke/__init__.py +++ b/pype/hosts/nuke/__init__.py @@ -7,8 +7,9 @@ import nuke from avalon import api as avalon from avalon.tools import workfiles from pyblish import api as pyblish -from pype.nuke import menu -from pypeapp import Logger +from pype.hosts.nuke import menu +from pype.api import Logger +from pype import PLUGINS_DIR from . import lib @@ -18,10 +19,6 @@ log = Logger().get_logger(__name__, "nuke") AVALON_CONFIG = os.getenv("AVALON_CONFIG", "pype") -PARENT_DIR = os.path.dirname(__file__) -PACKAGE_DIR = os.path.dirname(PARENT_DIR) -PLUGINS_DIR = os.path.join(PACKAGE_DIR, "plugins") - PUBLISH_PATH = os.path.join(PLUGINS_DIR, "nuke", "publish") LOAD_PATH = os.path.join(PLUGINS_DIR, "nuke", "load") CREATE_PATH = os.path.join(PLUGINS_DIR, "nuke", "create") @@ -44,11 +41,11 @@ def reload_config(): for module in ( "{}.api".format(AVALON_CONFIG), - "{}.nuke.actions".format(AVALON_CONFIG), - "{}.nuke.presets".format(AVALON_CONFIG), - "{}.nuke.menu".format(AVALON_CONFIG), - "{}.nuke.plugin".format(AVALON_CONFIG), - "{}.nuke.lib".format(AVALON_CONFIG), + "{}.hosts.nuke.actions".format(AVALON_CONFIG), + "{}.hosts.nuke.presets".format(AVALON_CONFIG), + "{}.hosts.nuke.menu".format(AVALON_CONFIG), + "{}.hosts.nuke.plugin".format(AVALON_CONFIG), + "{}.hosts.nuke.lib".format(AVALON_CONFIG), ): log.info("Reloading module: {}...".format(module)) diff --git a/pype/nuke/actions.py b/pype/hosts/nuke/actions.py similarity index 96% rename from pype/nuke/actions.py rename to pype/hosts/nuke/actions.py index c0c95e9080..23242262c8 100644 --- a/pype/nuke/actions.py +++ b/pype/hosts/nuke/actions.py @@ -5,7 +5,7 @@ from avalon.nuke.lib import ( select_nodes ) -from ..action import get_errored_instances_from_context +from ...action import get_errored_instances_from_context class SelectInvalidAction(pyblish.api.Action): diff --git a/pype/nuke/lib.py b/pype/hosts/nuke/lib.py similarity index 99% rename from pype/nuke/lib.py rename to pype/hosts/nuke/lib.py index ade7e96691..72a8836a03 100644 --- a/pype/nuke/lib.py +++ b/pype/hosts/nuke/lib.py @@ -21,8 +21,7 @@ from .presets import ( from .utils import set_context_favorites -from pypeapp import Logger -log = Logger().get_logger(__name__, "nuke") +log = pype.Logger().get_logger(__name__, "nuke") self = sys.modules[__name__] self._project = None diff --git a/pype/nuke/menu.py b/pype/hosts/nuke/menu.py similarity index 97% rename from pype/nuke/menu.py rename to pype/hosts/nuke/menu.py index 43c775414a..7306add9fe 100644 --- a/pype/nuke/menu.py +++ b/pype/hosts/nuke/menu.py @@ -1,8 +1,8 @@ import nuke from avalon.api import Session -from pype.nuke import lib -from pypeapp import Logger +from pype.hosts.nuke import lib +from pype.api import Logger log = Logger().get_logger(__name__, "nuke") diff --git a/pype/nuke/plugin.py b/pype/hosts/nuke/plugin.py similarity index 86% rename from pype/nuke/plugin.py rename to pype/hosts/nuke/plugin.py index d4b5110d6e..652c0396a8 100644 --- a/pype/nuke/plugin.py +++ b/pype/hosts/nuke/plugin.py @@ -1,8 +1,7 @@ import re import avalon.api import avalon.nuke -from pype import api as pype -from pypeapp import config +from pype.api import config class PypeCreator(avalon.nuke.pipeline.Creator): """Pype Nuke Creator class wrapper diff --git a/pype/nuke/presets.py b/pype/hosts/nuke/presets.py similarity index 94% rename from pype/nuke/presets.py rename to pype/hosts/nuke/presets.py index a413ccc878..2a296afc88 100644 --- a/pype/nuke/presets.py +++ b/pype/hosts/nuke/presets.py @@ -1,8 +1,7 @@ -from pype import api as pype -from pypeapp import Anatomy, config +from pype.api import Anatomy, config, Logger import nuke -log = pype.Logger().get_logger(__name__, "nuke") +log = Logger().get_logger(__name__, "nuke") def get_anatomy(**kwarg): diff --git a/pype/nuke/utils.py b/pype/hosts/nuke/utils.py similarity index 100% rename from pype/nuke/utils.py rename to pype/hosts/nuke/utils.py diff --git a/pype/nukestudio/__init__.py b/pype/hosts/nukestudio/__init__.py similarity index 95% rename from pype/nukestudio/__init__.py rename to pype/hosts/nukestudio/__init__.py index 75825d188a..c84b288f4a 100644 --- a/pype/nukestudio/__init__.py +++ b/pype/hosts/nukestudio/__init__.py @@ -1,7 +1,8 @@ import os -from pypeapp import Logger +from pype.api import Logger from avalon import api as avalon from pyblish import api as pyblish +from pype import PLUGINS_DIR from .workio import ( open_file, @@ -37,10 +38,6 @@ log = Logger().get_logger(__name__, "nukestudio") AVALON_CONFIG = os.getenv("AVALON_CONFIG", "pype") # plugin root path -PARENT_DIR = os.path.dirname(__file__) -PACKAGE_DIR = os.path.dirname(PARENT_DIR) -PLUGINS_DIR = os.path.join(PACKAGE_DIR, "plugins") - 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") diff --git a/pype/nukestudio/events.py b/pype/hosts/nukestudio/events.py similarity index 99% rename from pype/nukestudio/events.py rename to pype/hosts/nukestudio/events.py index 822dc4db87..509319f717 100644 --- a/pype/nukestudio/events.py +++ b/pype/hosts/nukestudio/events.py @@ -1,6 +1,6 @@ import os import hiero.core.events -from pypeapp import Logger +from pype.api import Logger from .lib import sync_avalon_data_to_workfile, launch_workfiles_app from .tags import add_tags_from_presets diff --git a/pype/nukestudio/lib.py b/pype/hosts/nukestudio/lib.py similarity index 98% rename from pype/nukestudio/lib.py rename to pype/hosts/nukestudio/lib.py index 3a8e35f100..6f2d9ad357 100644 --- a/pype/nukestudio/lib.py +++ b/pype/hosts/nukestudio/lib.py @@ -6,7 +6,7 @@ import pyblish.api import avalon.api as avalon from avalon.vendor.Qt import (QtWidgets, QtGui) import pype.api as pype -from pypeapp import Logger, Anatomy +from pype.api import Logger, Anatomy log = Logger().get_logger(__name__, "nukestudio") @@ -109,9 +109,9 @@ def reload_config(): "pypeapp", "{}.api".format(AVALON_CONFIG), "{}.templates".format(AVALON_CONFIG), - "{}.nukestudio.lib".format(AVALON_CONFIG), - "{}.nukestudio.menu".format(AVALON_CONFIG), - "{}.nukestudio.tags".format(AVALON_CONFIG) + "{}.hosts.nukestudio.lib".format(AVALON_CONFIG), + "{}.hosts.nukestudio.menu".format(AVALON_CONFIG), + "{}.hosts.nukestudio.tags".format(AVALON_CONFIG) ): log.info("Reloading module: {}...".format(module)) try: @@ -332,7 +332,7 @@ def CreateNukeWorkfile(nodes=None, ''' import hiero.core from avalon.nuke import imprint - from pype.nuke import ( + from pype.hosts.nuke import ( lib as nklib ) @@ -361,7 +361,7 @@ def CreateNukeWorkfile(nodes=None, nuke_script.addNode(root_node) - # here to call pype.nuke.lib.BuildWorkfile + # here to call pype.hosts.nuke.lib.BuildWorkfile script_builder = nklib.BuildWorkfile( root_node=root_node, root_path=root_path, diff --git a/pype/nukestudio/menu.py b/pype/hosts/nukestudio/menu.py similarity index 99% rename from pype/nukestudio/menu.py rename to pype/hosts/nukestudio/menu.py index ee9af44e74..35adcfc16c 100644 --- a/pype/nukestudio/menu.py +++ b/pype/hosts/nukestudio/menu.py @@ -1,7 +1,7 @@ import os import sys import hiero.core -from pypeapp import Logger +from pype.api import Logger from avalon.api import Session from hiero.ui import findMenuAction diff --git a/pype/nukestudio/tags.py b/pype/hosts/nukestudio/tags.py similarity index 99% rename from pype/nukestudio/tags.py rename to pype/hosts/nukestudio/tags.py index 3a15f9f39e..c97f13d17c 100644 --- a/pype/nukestudio/tags.py +++ b/pype/hosts/nukestudio/tags.py @@ -2,7 +2,7 @@ import re import os import hiero -from pypeapp import ( +from pype.api import ( config, Logger ) diff --git a/pype/nukestudio/workio.py b/pype/hosts/nukestudio/workio.py similarity index 98% rename from pype/nukestudio/workio.py rename to pype/hosts/nukestudio/workio.py index 1c7c77dab9..eee6654a4c 100644 --- a/pype/nukestudio/workio.py +++ b/pype/hosts/nukestudio/workio.py @@ -1,7 +1,7 @@ import os import hiero from avalon import api -from pypeapp import Logger +from pype.api import Logger log = Logger().get_logger(__name__, "nukestudio") diff --git a/pype/premiere/README.markdown b/pype/hosts/premiere/README.markdown similarity index 100% rename from pype/premiere/README.markdown rename to pype/hosts/premiere/README.markdown diff --git a/pype/premiere/__init__.py b/pype/hosts/premiere/__init__.py similarity index 96% rename from pype/premiere/__init__.py rename to pype/hosts/premiere/__init__.py index 9dfe2ec384..ddf334c610 100644 --- a/pype/premiere/__init__.py +++ b/pype/hosts/premiere/__init__.py @@ -1,7 +1,7 @@ import os from avalon import api as avalon from pyblish import api as pyblish -from pypeapp import Logger +from pype.api import Logger from .lib import ( @@ -42,7 +42,7 @@ def install(): avalon.data["familiesStateDefault"] = False avalon.data["familiesStateToggled"] = family_states - log.info("pype.premiere installed") + log.info("pype.hosts.premiere installed") pyblish.register_host("premiere") pyblish.register_plugin_path(PUBLISH_PATH) diff --git a/pype/premiere/extensions/build_extension.bat b/pype/hosts/premiere/extensions/build_extension.bat similarity index 100% rename from pype/premiere/extensions/build_extension.bat rename to pype/hosts/premiere/extensions/build_extension.bat diff --git a/pype/premiere/extensions/com.pype.rename/.debug b/pype/hosts/premiere/extensions/com.pype.rename/.debug similarity index 100% rename from pype/premiere/extensions/com.pype.rename/.debug rename to pype/hosts/premiere/extensions/com.pype.rename/.debug diff --git a/pype/premiere/extensions/com.pype.rename/CSXS/manifest.xml b/pype/hosts/premiere/extensions/com.pype.rename/CSXS/manifest.xml similarity index 100% rename from pype/premiere/extensions/com.pype.rename/CSXS/manifest.xml rename to pype/hosts/premiere/extensions/com.pype.rename/CSXS/manifest.xml diff --git a/pype/premiere/extensions/com.pype.rename/ReadMe.md b/pype/hosts/premiere/extensions/com.pype.rename/ReadMe.md similarity index 100% rename from pype/premiere/extensions/com.pype.rename/ReadMe.md rename to pype/hosts/premiere/extensions/com.pype.rename/ReadMe.md diff --git a/pype/premiere/extensions/com.pype.rename/css/bootstrap.min.css b/pype/hosts/premiere/extensions/com.pype.rename/css/bootstrap.min.css similarity index 100% rename from pype/premiere/extensions/com.pype.rename/css/bootstrap.min.css rename to pype/hosts/premiere/extensions/com.pype.rename/css/bootstrap.min.css diff --git a/pype/premiere/extensions/com.pype.rename/css/bootstrap.min.css.map b/pype/hosts/premiere/extensions/com.pype.rename/css/bootstrap.min.css.map similarity index 100% rename from pype/premiere/extensions/com.pype.rename/css/bootstrap.min.css.map rename to pype/hosts/premiere/extensions/com.pype.rename/css/bootstrap.min.css.map diff --git a/pype/premiere/extensions/com.pype.rename/css/renamer.min.css b/pype/hosts/premiere/extensions/com.pype.rename/css/renamer.min.css similarity index 100% rename from pype/premiere/extensions/com.pype.rename/css/renamer.min.css rename to pype/hosts/premiere/extensions/com.pype.rename/css/renamer.min.css diff --git a/pype/premiere/extensions/com.pype.rename/css/renamer.min.css.map b/pype/hosts/premiere/extensions/com.pype.rename/css/renamer.min.css.map similarity index 100% rename from pype/premiere/extensions/com.pype.rename/css/renamer.min.css.map rename to pype/hosts/premiere/extensions/com.pype.rename/css/renamer.min.css.map diff --git a/pype/premiere/extensions/com.pype.rename/css/renamer.scss b/pype/hosts/premiere/extensions/com.pype.rename/css/renamer.scss similarity index 100% rename from pype/premiere/extensions/com.pype.rename/css/renamer.scss rename to pype/hosts/premiere/extensions/com.pype.rename/css/renamer.scss diff --git a/pype/premiere/extensions/com.pype.rename/index.html b/pype/hosts/premiere/extensions/com.pype.rename/index.html similarity index 100% rename from pype/premiere/extensions/com.pype.rename/index.html rename to pype/hosts/premiere/extensions/com.pype.rename/index.html diff --git a/pype/premiere/extensions/com.pype.rename/jsx/PPRO/Premiere.jsx b/pype/hosts/premiere/extensions/com.pype.rename/jsx/PPRO/Premiere.jsx similarity index 100% rename from pype/premiere/extensions/com.pype.rename/jsx/PPRO/Premiere.jsx rename to pype/hosts/premiere/extensions/com.pype.rename/jsx/PPRO/Premiere.jsx diff --git a/pype/premiere/extensions/com.pype.rename/jsx/PypeRename.jsx b/pype/hosts/premiere/extensions/com.pype.rename/jsx/PypeRename.jsx similarity index 100% rename from pype/premiere/extensions/com.pype.rename/jsx/PypeRename.jsx rename to pype/hosts/premiere/extensions/com.pype.rename/jsx/PypeRename.jsx diff --git a/pype/premiere/extensions/com.pype.rename/lib/CEPEngine_extensions.js b/pype/hosts/premiere/extensions/com.pype.rename/lib/CEPEngine_extensions.js similarity index 100% rename from pype/premiere/extensions/com.pype.rename/lib/CEPEngine_extensions.js rename to pype/hosts/premiere/extensions/com.pype.rename/lib/CEPEngine_extensions.js diff --git a/pype/premiere/extensions/com.pype.rename/lib/CSInterface.js b/pype/hosts/premiere/extensions/com.pype.rename/lib/CSInterface.js similarity index 100% rename from pype/premiere/extensions/com.pype.rename/lib/CSInterface.js rename to pype/hosts/premiere/extensions/com.pype.rename/lib/CSInterface.js diff --git a/pype/premiere/extensions/com.pype.rename/lib/Vulcan.js b/pype/hosts/premiere/extensions/com.pype.rename/lib/Vulcan.js similarity index 100% rename from pype/premiere/extensions/com.pype.rename/lib/Vulcan.js rename to pype/hosts/premiere/extensions/com.pype.rename/lib/Vulcan.js diff --git a/pype/premiere/extensions/com.pype.rename/lib/bootstrap.min.js b/pype/hosts/premiere/extensions/com.pype.rename/lib/bootstrap.min.js similarity index 100% rename from pype/premiere/extensions/com.pype.rename/lib/bootstrap.min.js rename to pype/hosts/premiere/extensions/com.pype.rename/lib/bootstrap.min.js diff --git a/pype/premiere/extensions/com.pype.rename/lib/bootstrap.min.js.map b/pype/hosts/premiere/extensions/com.pype.rename/lib/bootstrap.min.js.map similarity index 100% rename from pype/premiere/extensions/com.pype.rename/lib/bootstrap.min.js.map rename to pype/hosts/premiere/extensions/com.pype.rename/lib/bootstrap.min.js.map diff --git a/pype/premiere/extensions/com.pype.rename/lib/jquery-3.3.1.min.js b/pype/hosts/premiere/extensions/com.pype.rename/lib/jquery-3.3.1.min.js similarity index 100% rename from pype/premiere/extensions/com.pype.rename/lib/jquery-3.3.1.min.js rename to pype/hosts/premiere/extensions/com.pype.rename/lib/jquery-3.3.1.min.js diff --git a/pype/premiere/extensions/com.pype.rename/lib/popper.min.js b/pype/hosts/premiere/extensions/com.pype.rename/lib/popper.min.js similarity index 100% rename from pype/premiere/extensions/com.pype.rename/lib/popper.min.js rename to pype/hosts/premiere/extensions/com.pype.rename/lib/popper.min.js diff --git a/pype/premiere/extensions/com.pype.rename/lib/renamer.js b/pype/hosts/premiere/extensions/com.pype.rename/lib/renamer.js similarity index 100% rename from pype/premiere/extensions/com.pype.rename/lib/renamer.js rename to pype/hosts/premiere/extensions/com.pype.rename/lib/renamer.js diff --git a/pype/premiere/extensions/com.pype/.debug b/pype/hosts/premiere/extensions/com.pype/.debug similarity index 100% rename from pype/premiere/extensions/com.pype/.debug rename to pype/hosts/premiere/extensions/com.pype/.debug diff --git a/pype/premiere/extensions/com.pype/CSXS/manifest.xml b/pype/hosts/premiere/extensions/com.pype/CSXS/manifest.xml similarity index 100% rename from pype/premiere/extensions/com.pype/CSXS/manifest.xml rename to pype/hosts/premiere/extensions/com.pype/CSXS/manifest.xml diff --git a/pype/premiere/extensions/com.pype/encoding/44khz.epr b/pype/hosts/premiere/extensions/com.pype/encoding/44khz.epr similarity index 100% rename from pype/premiere/extensions/com.pype/encoding/44khz.epr rename to pype/hosts/premiere/extensions/com.pype/encoding/44khz.epr diff --git a/pype/premiere/extensions/com.pype/encoding/48khz.epr b/pype/hosts/premiere/extensions/com.pype/encoding/48khz.epr similarity index 100% rename from pype/premiere/extensions/com.pype/encoding/48khz.epr rename to pype/hosts/premiere/extensions/com.pype/encoding/48khz.epr diff --git a/pype/premiere/extensions/com.pype/encoding/h264.epr b/pype/hosts/premiere/extensions/com.pype/encoding/h264.epr similarity index 100% rename from pype/premiere/extensions/com.pype/encoding/h264.epr rename to pype/hosts/premiere/extensions/com.pype/encoding/h264.epr diff --git a/pype/premiere/extensions/com.pype/encoding/jpeg_thumb.epr b/pype/hosts/premiere/extensions/com.pype/encoding/jpeg_thumb.epr similarity index 100% rename from pype/premiere/extensions/com.pype/encoding/jpeg_thumb.epr rename to pype/hosts/premiere/extensions/com.pype/encoding/jpeg_thumb.epr diff --git a/pype/premiere/extensions/com.pype/encoding/prores422.epr b/pype/hosts/premiere/extensions/com.pype/encoding/prores422.epr similarity index 100% rename from pype/premiere/extensions/com.pype/encoding/prores422.epr rename to pype/hosts/premiere/extensions/com.pype/encoding/prores422.epr diff --git a/pype/premiere/extensions/com.pype/icons/iconDarkNormal.png b/pype/hosts/premiere/extensions/com.pype/icons/iconDarkNormal.png similarity index 100% rename from pype/premiere/extensions/com.pype/icons/iconDarkNormal.png rename to pype/hosts/premiere/extensions/com.pype/icons/iconDarkNormal.png diff --git a/pype/premiere/extensions/com.pype/icons/iconDarkRollover.png b/pype/hosts/premiere/extensions/com.pype/icons/iconDarkRollover.png similarity index 100% rename from pype/premiere/extensions/com.pype/icons/iconDarkRollover.png rename to pype/hosts/premiere/extensions/com.pype/icons/iconDarkRollover.png diff --git a/pype/premiere/extensions/com.pype/icons/iconDisabled.png b/pype/hosts/premiere/extensions/com.pype/icons/iconDisabled.png similarity index 100% rename from pype/premiere/extensions/com.pype/icons/iconDisabled.png rename to pype/hosts/premiere/extensions/com.pype/icons/iconDisabled.png diff --git a/pype/premiere/extensions/com.pype/icons/iconNormal.png b/pype/hosts/premiere/extensions/com.pype/icons/iconNormal.png similarity index 100% rename from pype/premiere/extensions/com.pype/icons/iconNormal.png rename to pype/hosts/premiere/extensions/com.pype/icons/iconNormal.png diff --git a/pype/premiere/extensions/com.pype/icons/iconRollover.png b/pype/hosts/premiere/extensions/com.pype/icons/iconRollover.png similarity index 100% rename from pype/premiere/extensions/com.pype/icons/iconRollover.png rename to pype/hosts/premiere/extensions/com.pype/icons/iconRollover.png diff --git a/pype/premiere/extensions/com.pype/index_remote.html b/pype/hosts/premiere/extensions/com.pype/index_remote.html similarity index 100% rename from pype/premiere/extensions/com.pype/index_remote.html rename to pype/hosts/premiere/extensions/com.pype/index_remote.html diff --git a/pype/premiere/extensions/com.pype/jsx/JavaScript.d.ts b/pype/hosts/premiere/extensions/com.pype/jsx/JavaScript.d.ts similarity index 100% rename from pype/premiere/extensions/com.pype/jsx/JavaScript.d.ts rename to pype/hosts/premiere/extensions/com.pype/jsx/JavaScript.d.ts diff --git a/pype/premiere/extensions/com.pype/jsx/PPRO/Premiere.jsx b/pype/hosts/premiere/extensions/com.pype/jsx/PPRO/Premiere.jsx similarity index 100% rename from pype/premiere/extensions/com.pype/jsx/PPRO/Premiere.jsx rename to pype/hosts/premiere/extensions/com.pype/jsx/PPRO/Premiere.jsx diff --git a/pype/premiere/extensions/com.pype/jsx/PlugPlugExternalObject.d.ts b/pype/hosts/premiere/extensions/com.pype/jsx/PlugPlugExternalObject.d.ts similarity index 100% rename from pype/premiere/extensions/com.pype/jsx/PlugPlugExternalObject.d.ts rename to pype/hosts/premiere/extensions/com.pype/jsx/PlugPlugExternalObject.d.ts diff --git a/pype/premiere/extensions/com.pype/jsx/PremierePro.14.0.d.ts b/pype/hosts/premiere/extensions/com.pype/jsx/PremierePro.14.0.d.ts similarity index 100% rename from pype/premiere/extensions/com.pype/jsx/PremierePro.14.0.d.ts rename to pype/hosts/premiere/extensions/com.pype/jsx/PremierePro.14.0.d.ts diff --git a/pype/premiere/extensions/com.pype/jsx/PypeRename.jsx b/pype/hosts/premiere/extensions/com.pype/jsx/PypeRename.jsx similarity index 100% rename from pype/premiere/extensions/com.pype/jsx/PypeRename.jsx rename to pype/hosts/premiere/extensions/com.pype/jsx/PypeRename.jsx diff --git a/pype/premiere/extensions/com.pype/jsx/XMPScript.d.ts b/pype/hosts/premiere/extensions/com.pype/jsx/XMPScript.d.ts similarity index 100% rename from pype/premiere/extensions/com.pype/jsx/XMPScript.d.ts rename to pype/hosts/premiere/extensions/com.pype/jsx/XMPScript.d.ts diff --git a/pype/premiere/extensions/com.pype/jsx/batchRenamer.jsx b/pype/hosts/premiere/extensions/com.pype/jsx/batchRenamer.jsx similarity index 100% rename from pype/premiere/extensions/com.pype/jsx/batchRenamer.jsx rename to pype/hosts/premiere/extensions/com.pype/jsx/batchRenamer.jsx diff --git a/pype/premiere/extensions/com.pype/jsx/extendscript.d.ts b/pype/hosts/premiere/extensions/com.pype/jsx/extendscript.d.ts similarity index 100% rename from pype/premiere/extensions/com.pype/jsx/extendscript.d.ts rename to pype/hosts/premiere/extensions/com.pype/jsx/extendscript.d.ts diff --git a/pype/premiere/extensions/com.pype/jsx/global.d.ts b/pype/hosts/premiere/extensions/com.pype/jsx/global.d.ts similarity index 100% rename from pype/premiere/extensions/com.pype/jsx/global.d.ts rename to pype/hosts/premiere/extensions/com.pype/jsx/global.d.ts diff --git a/pype/premiere/extensions/com.pype/jsx/jsconfig.json b/pype/hosts/premiere/extensions/com.pype/jsx/jsconfig.json similarity index 100% rename from pype/premiere/extensions/com.pype/jsx/jsconfig.json rename to pype/hosts/premiere/extensions/com.pype/jsx/jsconfig.json diff --git a/pype/premiere/extensions/com.pype/jsx/pype.jsx b/pype/hosts/premiere/extensions/com.pype/jsx/pype.jsx similarity index 100% rename from pype/premiere/extensions/com.pype/jsx/pype.jsx rename to pype/hosts/premiere/extensions/com.pype/jsx/pype.jsx diff --git a/pype/premiere/extensions/com.pype/jsx/testingCode._jsx b/pype/hosts/premiere/extensions/com.pype/jsx/testingCode._jsx similarity index 100% rename from pype/premiere/extensions/com.pype/jsx/testingCode._jsx rename to pype/hosts/premiere/extensions/com.pype/jsx/testingCode._jsx diff --git a/pype/premiere/extensions/com.pype/lib/CEPEngine_extensions.js b/pype/hosts/premiere/extensions/com.pype/lib/CEPEngine_extensions.js similarity index 100% rename from pype/premiere/extensions/com.pype/lib/CEPEngine_extensions.js rename to pype/hosts/premiere/extensions/com.pype/lib/CEPEngine_extensions.js diff --git a/pype/premiere/extensions/com.pype/lib/CSInterface.js b/pype/hosts/premiere/extensions/com.pype/lib/CSInterface.js similarity index 100% rename from pype/premiere/extensions/com.pype/lib/CSInterface.js rename to pype/hosts/premiere/extensions/com.pype/lib/CSInterface.js diff --git a/pype/premiere/extensions/com.pype/lib/Vulcan.js b/pype/hosts/premiere/extensions/com.pype/lib/Vulcan.js similarity index 100% rename from pype/premiere/extensions/com.pype/lib/Vulcan.js rename to pype/hosts/premiere/extensions/com.pype/lib/Vulcan.js diff --git a/pype/premiere/extensions/com.pype/lib/app.js b/pype/hosts/premiere/extensions/com.pype/lib/app.js similarity index 100% rename from pype/premiere/extensions/com.pype/lib/app.js rename to pype/hosts/premiere/extensions/com.pype/lib/app.js diff --git a/pype/premiere/extensions/com.pype/lib/jquery-1.9.1.js b/pype/hosts/premiere/extensions/com.pype/lib/jquery-1.9.1.js similarity index 100% rename from pype/premiere/extensions/com.pype/lib/jquery-1.9.1.js rename to pype/hosts/premiere/extensions/com.pype/lib/jquery-1.9.1.js diff --git a/pype/premiere/extensions/com.pype/lib/json2.js b/pype/hosts/premiere/extensions/com.pype/lib/json2.js similarity index 100% rename from pype/premiere/extensions/com.pype/lib/json2.js rename to pype/hosts/premiere/extensions/com.pype/lib/json2.js diff --git a/pype/premiere/extensions/com.pype/package.json b/pype/hosts/premiere/extensions/com.pype/package.json similarity index 100% rename from pype/premiere/extensions/com.pype/package.json rename to pype/hosts/premiere/extensions/com.pype/package.json diff --git a/pype/premiere/extensions/com.pype/pypeApp.jsx b/pype/hosts/premiere/extensions/com.pype/pypeApp.jsx similarity index 100% rename from pype/premiere/extensions/com.pype/pypeApp.jsx rename to pype/hosts/premiere/extensions/com.pype/pypeApp.jsx diff --git a/pype/premiere/lib.py b/pype/hosts/premiere/lib.py similarity index 96% rename from pype/premiere/lib.py rename to pype/hosts/premiere/lib.py index f03c98fb78..d76d27270a 100644 --- a/pype/premiere/lib.py +++ b/pype/hosts/premiere/lib.py @@ -7,8 +7,8 @@ import requests from avalon import api from pype.widgets.message_window import message -from pypeapp import Logger - +from pype import PLUGINS_DIR +from pype.api import Logger log = Logger().get_logger(__name__, "premiere") @@ -19,8 +19,6 @@ self._registered_gui = None AVALON_CONFIG = os.environ["AVALON_CONFIG"] PARENT_DIR = os.path.dirname(__file__) -PACKAGE_DIR = os.path.dirname(PARENT_DIR) -PLUGINS_DIR = os.path.join(PACKAGE_DIR, "plugins") self.EXTENSIONS_PATH_REMOTE = os.path.join(PARENT_DIR, "extensions") self.EXTENSIONS_PATH_LOCAL = None @@ -58,7 +56,7 @@ def reload_pipeline(): """ import importlib - import pype.premiere + import pype.hosts.premiere api.uninstall() @@ -79,7 +77,7 @@ def reload_pipeline(): except Exception as e: log.warning("Cannot reload module: {}".format(e)) - api.install(pype.premiere) + api.install(pype.hosts.premiere) def setup(env=None): @@ -121,7 +119,7 @@ def extensions_sync(): # https://helpx.adobe.com/extension-manager/using/command-line.html process_pairs = list() - # get extensions dir in pype.premiere.extensions + # get extensions dir in pype.hosts.premiere.extensions # build dir path to premiere cep extensions for name in os.listdir(self.EXTENSIONS_PATH_REMOTE): diff --git a/pype/premiere/ppro/css/avalon.min.css b/pype/hosts/premiere/ppro/css/avalon.min.css similarity index 100% rename from pype/premiere/ppro/css/avalon.min.css rename to pype/hosts/premiere/ppro/css/avalon.min.css diff --git a/pype/premiere/ppro/css/avalon.min.css.map b/pype/hosts/premiere/ppro/css/avalon.min.css.map similarity index 100% rename from pype/premiere/ppro/css/avalon.min.css.map rename to pype/hosts/premiere/ppro/css/avalon.min.css.map diff --git a/pype/premiere/ppro/css/avalon.scss b/pype/hosts/premiere/ppro/css/avalon.scss similarity index 100% rename from pype/premiere/ppro/css/avalon.scss rename to pype/hosts/premiere/ppro/css/avalon.scss diff --git a/pype/premiere/ppro/css/bootstrap.min.css b/pype/hosts/premiere/ppro/css/bootstrap.min.css similarity index 100% rename from pype/premiere/ppro/css/bootstrap.min.css rename to pype/hosts/premiere/ppro/css/bootstrap.min.css diff --git a/pype/premiere/ppro/css/bootstrap.min.css.map b/pype/hosts/premiere/ppro/css/bootstrap.min.css.map similarity index 100% rename from pype/premiere/ppro/css/bootstrap.min.css.map rename to pype/hosts/premiere/ppro/css/bootstrap.min.css.map diff --git a/pype/premiere/ppro/debug.log b/pype/hosts/premiere/ppro/debug.log similarity index 100% rename from pype/premiere/ppro/debug.log rename to pype/hosts/premiere/ppro/debug.log diff --git a/pype/premiere/ppro/img/blender.png b/pype/hosts/premiere/ppro/img/blender.png similarity index 100% rename from pype/premiere/ppro/img/blender.png rename to pype/hosts/premiere/ppro/img/blender.png diff --git a/pype/premiere/ppro/index.html b/pype/hosts/premiere/ppro/index.html similarity index 100% rename from pype/premiere/ppro/index.html rename to pype/hosts/premiere/ppro/index.html diff --git a/pype/premiere/ppro/js/.eslintrc.json b/pype/hosts/premiere/ppro/js/.eslintrc.json similarity index 100% rename from pype/premiere/ppro/js/.eslintrc.json rename to pype/hosts/premiere/ppro/js/.eslintrc.json diff --git a/pype/premiere/ppro/js/build.js b/pype/hosts/premiere/ppro/js/build.js similarity index 100% rename from pype/premiere/ppro/js/build.js rename to pype/hosts/premiere/ppro/js/build.js diff --git a/pype/premiere/ppro/js/pype.js b/pype/hosts/premiere/ppro/js/pype.js similarity index 100% rename from pype/premiere/ppro/js/pype.js rename to pype/hosts/premiere/ppro/js/pype.js diff --git a/pype/premiere/ppro/js/pype_restapi_client.js b/pype/hosts/premiere/ppro/js/pype_restapi_client.js similarity index 100% rename from pype/premiere/ppro/js/pype_restapi_client.js rename to pype/hosts/premiere/ppro/js/pype_restapi_client.js diff --git a/pype/premiere/ppro/js/vendor/CSInterface-8.js b/pype/hosts/premiere/ppro/js/vendor/CSInterface-8.js similarity index 100% rename from pype/premiere/ppro/js/vendor/CSInterface-8.js rename to pype/hosts/premiere/ppro/js/vendor/CSInterface-8.js diff --git a/pype/premiere/ppro/js/vendor/bootstrap.min.js b/pype/hosts/premiere/ppro/js/vendor/bootstrap.min.js similarity index 100% rename from pype/premiere/ppro/js/vendor/bootstrap.min.js rename to pype/hosts/premiere/ppro/js/vendor/bootstrap.min.js diff --git a/pype/premiere/ppro/js/vendor/bootstrap.min.js.map b/pype/hosts/premiere/ppro/js/vendor/bootstrap.min.js.map similarity index 100% rename from pype/premiere/ppro/js/vendor/bootstrap.min.js.map rename to pype/hosts/premiere/ppro/js/vendor/bootstrap.min.js.map diff --git a/pype/premiere/ppro/js/vendor/jquery-3.3.1.min.js b/pype/hosts/premiere/ppro/js/vendor/jquery-3.3.1.min.js similarity index 100% rename from pype/premiere/ppro/js/vendor/jquery-3.3.1.min.js rename to pype/hosts/premiere/ppro/js/vendor/jquery-3.3.1.min.js diff --git a/pype/premiere/ppro/js/vendor/json2.js b/pype/hosts/premiere/ppro/js/vendor/json2.js similarity index 100% rename from pype/premiere/ppro/js/vendor/json2.js rename to pype/hosts/premiere/ppro/js/vendor/json2.js diff --git a/pype/premiere/ppro/js/vendor/popper.min.js b/pype/hosts/premiere/ppro/js/vendor/popper.min.js similarity index 100% rename from pype/premiere/ppro/js/vendor/popper.min.js rename to pype/hosts/premiere/ppro/js/vendor/popper.min.js diff --git a/pype/unreal/__init__.py b/pype/hosts/unreal/__init__.py similarity index 86% rename from pype/unreal/__init__.py rename to pype/hosts/unreal/__init__.py index bb8a765a43..939be48d1e 100644 --- a/pype/unreal/__init__.py +++ b/pype/hosts/unreal/__init__.py @@ -3,12 +3,9 @@ import logging from avalon import api as avalon from pyblish import api as pyblish +from pype import PLUGINS_DIR -logger = logging.getLogger("pype.unreal") - -PARENT_DIR = os.path.dirname(__file__) -PACKAGE_DIR = os.path.dirname(PARENT_DIR) -PLUGINS_DIR = os.path.join(PACKAGE_DIR, "plugins") +logger = logging.getLogger("pype.hosts.unreal") PUBLISH_PATH = os.path.join(PLUGINS_DIR, "unreal", "publish") LOAD_PATH = os.path.join(PLUGINS_DIR, "unreal", "load") diff --git a/pype/unreal/lib.py b/pype/hosts/unreal/lib.py similarity index 99% rename from pype/unreal/lib.py rename to pype/hosts/unreal/lib.py index 0b049c8b1d..5534c0cbc8 100644 --- a/pype/unreal/lib.py +++ b/pype/hosts/unreal/lib.py @@ -4,7 +4,7 @@ import platform import json from distutils import dir_util import subprocess -from pypeapp import config +from pype.api import config def get_engine_versions(): diff --git a/pype/unreal/plugin.py b/pype/hosts/unreal/plugin.py similarity index 100% rename from pype/unreal/plugin.py rename to pype/hosts/unreal/plugin.py diff --git a/pype/lib.py b/pype/lib.py index ca9d573b36..d76d02ea5a 100644 --- a/pype/lib.py +++ b/pype/lib.py @@ -15,7 +15,7 @@ from abc import ABCMeta, abstractmethod from avalon import io, pipeline import six import avalon.api -from pypeapp import config +from .api import config log = logging.getLogger(__name__) @@ -458,7 +458,7 @@ def get_version_from_path(file): v: version number in string ('001') """ - pattern = re.compile(r"[\._]v([0-9]+)") + pattern = re.compile(r"[\._]v([0-9]+)", re.IGNORECASE) try: return pattern.findall(file)[0] except IndexError: diff --git a/pype/services/__init__.py b/pype/modules/__init__.py similarity index 100% rename from pype/services/__init__.py rename to pype/modules/__init__.py diff --git a/pype/services/adobe_communicator/__init__.py b/pype/modules/adobe_communicator/__init__.py similarity index 100% rename from pype/services/adobe_communicator/__init__.py rename to pype/modules/adobe_communicator/__init__.py diff --git a/pype/services/adobe_communicator/adobe_comunicator.py b/pype/modules/adobe_communicator/adobe_comunicator.py similarity index 98% rename from pype/services/adobe_communicator/adobe_comunicator.py rename to pype/modules/adobe_communicator/adobe_comunicator.py index d842955781..ef7e05ff57 100644 --- a/pype/services/adobe_communicator/adobe_comunicator.py +++ b/pype/modules/adobe_communicator/adobe_comunicator.py @@ -1,6 +1,6 @@ import os import pype -from pypeapp import Logger +from pype.api import Logger from .lib import AdobeRestApi, PUBLISH_PATHS log = Logger().get_logger("AdobeCommunicator") diff --git a/pype/services/adobe_communicator/lib/__init__.py b/pype/modules/adobe_communicator/lib/__init__.py similarity index 100% rename from pype/services/adobe_communicator/lib/__init__.py rename to pype/modules/adobe_communicator/lib/__init__.py diff --git a/pype/ftrack/lib/io_nonsingleton.py b/pype/modules/adobe_communicator/lib/io_nonsingleton.py similarity index 100% rename from pype/ftrack/lib/io_nonsingleton.py rename to pype/modules/adobe_communicator/lib/io_nonsingleton.py diff --git a/pype/services/adobe_communicator/lib/publish.py b/pype/modules/adobe_communicator/lib/publish.py similarity index 98% rename from pype/services/adobe_communicator/lib/publish.py rename to pype/modules/adobe_communicator/lib/publish.py index a6fe991025..6a9faf0403 100644 --- a/pype/services/adobe_communicator/lib/publish.py +++ b/pype/modules/adobe_communicator/lib/publish.py @@ -6,7 +6,7 @@ import pyblish.api import pyblish.util import avalon.api from avalon.tools import publish -from pypeapp import Logger +from pype.api import Logger log = Logger().get_logger(__name__) diff --git a/pype/services/adobe_communicator/lib/rest_api.py b/pype/modules/adobe_communicator/lib/rest_api.py similarity index 96% rename from pype/services/adobe_communicator/lib/rest_api.py rename to pype/modules/adobe_communicator/lib/rest_api.py index 2372c4ed20..86739e4d80 100644 --- a/pype/services/adobe_communicator/lib/rest_api.py +++ b/pype/modules/adobe_communicator/lib/rest_api.py @@ -1,9 +1,9 @@ import os import sys import copy -from pype.services.rest_api import RestApi, route, abort, CallbackResult +from pype.modules.rest_api import RestApi, route, abort, CallbackResult from .io_nonsingleton import DbConnector -from pypeapp import config, execute, Logger +from pype.api import config, execute, Logger log = Logger().get_logger("AdobeCommunicator") diff --git a/pype/avalon_apps/__init__.py b/pype/modules/avalon_apps/__init__.py similarity index 100% rename from pype/avalon_apps/__init__.py rename to pype/modules/avalon_apps/__init__.py diff --git a/pype/avalon_apps/avalon_app.py b/pype/modules/avalon_apps/avalon_app.py similarity index 98% rename from pype/avalon_apps/avalon_app.py rename to pype/modules/avalon_apps/avalon_app.py index d3190a9d53..d103a84d90 100644 --- a/pype/avalon_apps/avalon_app.py +++ b/pype/modules/avalon_apps/avalon_app.py @@ -2,7 +2,7 @@ import os import argparse from Qt import QtGui, QtWidgets from avalon.tools import libraryloader -from pypeapp import Logger +from pype.api import Logger from avalon import io from launcher import launcher_widget, lib as launcher_lib diff --git a/pype/avalon_apps/rest_api.py b/pype/modules/avalon_apps/rest_api.py similarity index 95% rename from pype/avalon_apps/rest_api.py rename to pype/modules/avalon_apps/rest_api.py index a552d70907..a5dc326a8e 100644 --- a/pype/avalon_apps/rest_api.py +++ b/pype/modules/avalon_apps/rest_api.py @@ -3,8 +3,8 @@ import re import json import bson import bson.json_util -from pype.services.rest_api import RestApi, abort, CallbackResult -from pype.ftrack.lib.custom_db_connector import DbConnector +from pype.modules.rest_api import RestApi, abort, CallbackResult +from pype.modules.ftrack.lib.custom_db_connector import DbConnector class AvalonRestApi(RestApi): diff --git a/pype/clockify/__init__.py b/pype/modules/clockify/__init__.py similarity index 100% rename from pype/clockify/__init__.py rename to pype/modules/clockify/__init__.py diff --git a/pype/clockify/clockify.py b/pype/modules/clockify/clockify.py similarity index 99% rename from pype/clockify/clockify.py rename to pype/modules/clockify/clockify.py index 5e6cfec778..6d5dc9213c 100644 --- a/pype/clockify/clockify.py +++ b/pype/modules/clockify/clockify.py @@ -1,6 +1,7 @@ import os import threading -from pypeapp import style, Logger +from pype.api import Logger +from pypeapp import style from Qt import QtWidgets from . import ClockifySettings, ClockifyAPI, MessageWidget diff --git a/pype/clockify/clockify_api.py b/pype/modules/clockify/clockify_api.py similarity index 100% rename from pype/clockify/clockify_api.py rename to pype/modules/clockify/clockify_api.py diff --git a/pype/clockify/ftrack_actions/action_clockify_sync.py b/pype/modules/clockify/ftrack_actions/action_clockify_sync.py similarity index 97% rename from pype/clockify/ftrack_actions/action_clockify_sync.py rename to pype/modules/clockify/ftrack_actions/action_clockify_sync.py index 59444bc3ac..a041e6ada6 100644 --- a/pype/clockify/ftrack_actions/action_clockify_sync.py +++ b/pype/modules/clockify/ftrack_actions/action_clockify_sync.py @@ -4,8 +4,8 @@ import argparse import logging import json import ftrack_api -from pype.ftrack import BaseAction, MissingPermision -from pype.clockify import ClockifyAPI +from pype.modules.ftrack import BaseAction, MissingPermision +from pype.modules.clockify import ClockifyAPI class SyncClocify(BaseAction): diff --git a/pype/clockify/launcher_actions/ClockifyStart.py b/pype/modules/clockify/launcher_actions/ClockifyStart.py similarity index 96% rename from pype/clockify/launcher_actions/ClockifyStart.py rename to pype/modules/clockify/launcher_actions/ClockifyStart.py index 6a9ceaec73..d5e9164977 100644 --- a/pype/clockify/launcher_actions/ClockifyStart.py +++ b/pype/modules/clockify/launcher_actions/ClockifyStart.py @@ -1,6 +1,6 @@ from avalon import api, io from pype.api import Logger -from pype.clockify import ClockifyAPI +from pype.modules.clockify import ClockifyAPI log = Logger().get_logger(__name__, "clockify_start") diff --git a/pype/clockify/launcher_actions/ClockifySync.py b/pype/modules/clockify/launcher_actions/ClockifySync.py similarity index 97% rename from pype/clockify/launcher_actions/ClockifySync.py rename to pype/modules/clockify/launcher_actions/ClockifySync.py index 3bf389796f..0f20d1dce1 100644 --- a/pype/clockify/launcher_actions/ClockifySync.py +++ b/pype/modules/clockify/launcher_actions/ClockifySync.py @@ -1,5 +1,5 @@ from avalon import api, io -from pype.clockify import ClockifyAPI +from pype.modules.clockify import ClockifyAPI from pype.api import Logger log = Logger().get_logger(__name__, "clockify_sync") diff --git a/pype/clockify/widget_message.py b/pype/modules/clockify/widget_message.py similarity index 100% rename from pype/clockify/widget_message.py rename to pype/modules/clockify/widget_message.py diff --git a/pype/clockify/widget_settings.py b/pype/modules/clockify/widget_settings.py similarity index 100% rename from pype/clockify/widget_settings.py rename to pype/modules/clockify/widget_settings.py diff --git a/pype/ftrack/__init__.py b/pype/modules/ftrack/__init__.py similarity index 100% rename from pype/ftrack/__init__.py rename to pype/modules/ftrack/__init__.py diff --git a/pype/ftrack/actions/action_application_loader.py b/pype/modules/ftrack/actions/action_application_loader.py similarity index 96% rename from pype/ftrack/actions/action_application_loader.py rename to pype/modules/ftrack/actions/action_application_loader.py index 813eee358a..11aac28615 100644 --- a/pype/ftrack/actions/action_application_loader.py +++ b/pype/modules/ftrack/actions/action_application_loader.py @@ -1,9 +1,9 @@ import os import toml import time -from pype.ftrack import AppAction +from pype.modules.ftrack import AppAction from avalon import lib -from pypeapp import Logger +from pype.api import Logger from pype.lib import get_all_avalon_projects log = Logger().get_logger(__name__) diff --git a/pype/ftrack/actions/action_attributes_remapper.py b/pype/modules/ftrack/actions/action_attributes_remapper.py similarity index 98% rename from pype/ftrack/actions/action_attributes_remapper.py rename to pype/modules/ftrack/actions/action_attributes_remapper.py index 2059edb8c8..b5fad7dc45 100644 --- a/pype/ftrack/actions/action_attributes_remapper.py +++ b/pype/modules/ftrack/actions/action_attributes_remapper.py @@ -1,8 +1,8 @@ import os import ftrack_api -from pype.ftrack import BaseAction -from pype.ftrack.lib.io_nonsingleton import DbConnector +from pype.modules.ftrack import BaseAction +from pype.modules.ftrack.lib.io_nonsingleton import DbConnector class AttributesRemapper(BaseAction): diff --git a/pype/ftrack/actions/action_clean_hierarchical_attributes.py b/pype/modules/ftrack/actions/action_clean_hierarchical_attributes.py similarity index 97% rename from pype/ftrack/actions/action_clean_hierarchical_attributes.py rename to pype/modules/ftrack/actions/action_clean_hierarchical_attributes.py index 8b4c2682f6..0319528319 100644 --- a/pype/ftrack/actions/action_clean_hierarchical_attributes.py +++ b/pype/modules/ftrack/actions/action_clean_hierarchical_attributes.py @@ -1,8 +1,8 @@ import os import collections import ftrack_api -from pype.ftrack import BaseAction -from pype.ftrack.lib.avalon_sync import get_avalon_attr +from pype.modules.ftrack import BaseAction +from pype.modules.ftrack.lib.avalon_sync import get_avalon_attr class CleanHierarchicalAttrsAction(BaseAction): diff --git a/pype/ftrack/actions/action_client_review_sort.py b/pype/modules/ftrack/actions/action_client_review_sort.py similarity index 98% rename from pype/ftrack/actions/action_client_review_sort.py rename to pype/modules/ftrack/actions/action_client_review_sort.py index b98cf34756..1909c31759 100644 --- a/pype/ftrack/actions/action_client_review_sort.py +++ b/pype/modules/ftrack/actions/action_client_review_sort.py @@ -1,4 +1,4 @@ -from pype.ftrack import BaseAction +from pype.modules.ftrack import BaseAction try: from functools import cmp_to_key except Exception: diff --git a/pype/ftrack/actions/action_component_open.py b/pype/modules/ftrack/actions/action_component_open.py similarity index 98% rename from pype/ftrack/actions/action_component_open.py rename to pype/modules/ftrack/actions/action_component_open.py index d721731ab0..aebd543769 100644 --- a/pype/ftrack/actions/action_component_open.py +++ b/pype/modules/ftrack/actions/action_component_open.py @@ -4,7 +4,7 @@ import argparse import logging import subprocess import ftrack_api -from pype.ftrack import BaseAction +from pype.modules.ftrack import BaseAction class ComponentOpen(BaseAction): diff --git a/pype/ftrack/actions/action_create_cust_attrs.py b/pype/modules/ftrack/actions/action_create_cust_attrs.py similarity index 99% rename from pype/ftrack/actions/action_create_cust_attrs.py rename to pype/modules/ftrack/actions/action_create_cust_attrs.py index 37b11256d2..6e9827a231 100644 --- a/pype/ftrack/actions/action_create_cust_attrs.py +++ b/pype/modules/ftrack/actions/action_create_cust_attrs.py @@ -3,9 +3,9 @@ import collections import json import arrow import ftrack_api -from pype.ftrack import BaseAction -from pype.ftrack.lib.avalon_sync import CustAttrIdKey -from pypeapp import config +from pype.modules.ftrack import BaseAction +from pype.modules.ftrack.lib.avalon_sync import CustAttrIdKey +from pype.api import config """ This action creates/updates custom attributes. diff --git a/pype/ftrack/actions/action_create_folders.py b/pype/modules/ftrack/actions/action_create_folders.py similarity index 99% rename from pype/ftrack/actions/action_create_folders.py rename to pype/modules/ftrack/actions/action_create_folders.py index 8f3358cf9c..9146c54fad 100644 --- a/pype/ftrack/actions/action_create_folders.py +++ b/pype/modules/ftrack/actions/action_create_folders.py @@ -1,7 +1,7 @@ import os -from pype.ftrack import BaseAction +from pype.modules.ftrack import BaseAction from avalon import lib as avalonlib -from pypeapp import config, Anatomy +from pype.api import config, Anatomy class CreateFolders(BaseAction): diff --git a/pype/ftrack/actions/action_create_project_structure.py b/pype/modules/ftrack/actions/action_create_project_structure.py similarity index 99% rename from pype/ftrack/actions/action_create_project_structure.py rename to pype/modules/ftrack/actions/action_create_project_structure.py index e1c5b6b837..526cf172bf 100644 --- a/pype/ftrack/actions/action_create_project_structure.py +++ b/pype/modules/ftrack/actions/action_create_project_structure.py @@ -1,8 +1,8 @@ import os import re -from pype.ftrack import BaseAction -from pypeapp import config, Anatomy +from pype.modules.ftrack import BaseAction +from pype.api import config, Anatomy class CreateProjectFolders(BaseAction): diff --git a/pype/ftrack/actions/action_cust_attr_doctor.py b/pype/modules/ftrack/actions/action_cust_attr_doctor.py similarity index 99% rename from pype/ftrack/actions/action_cust_attr_doctor.py rename to pype/modules/ftrack/actions/action_cust_attr_doctor.py index a14db4687a..e67ce4e5bf 100644 --- a/pype/ftrack/actions/action_cust_attr_doctor.py +++ b/pype/modules/ftrack/actions/action_cust_attr_doctor.py @@ -5,7 +5,7 @@ import argparse import logging import ftrack_api -from pype.ftrack import BaseAction +from pype.modules.ftrack import BaseAction class CustomAttributeDoctor(BaseAction): diff --git a/pype/ftrack/actions/action_delete_asset.py b/pype/modules/ftrack/actions/action_delete_asset.py similarity index 99% rename from pype/ftrack/actions/action_delete_asset.py rename to pype/modules/ftrack/actions/action_delete_asset.py index 6a3b724379..d4f6eb6594 100644 --- a/pype/ftrack/actions/action_delete_asset.py +++ b/pype/modules/ftrack/actions/action_delete_asset.py @@ -5,8 +5,8 @@ from datetime import datetime from queue import Queue from bson.objectid import ObjectId -from pype.ftrack import BaseAction -from pype.ftrack.lib.io_nonsingleton import DbConnector +from pype.modules.ftrack import BaseAction +from pype.modules.ftrack.lib.io_nonsingleton import DbConnector class DeleteAssetSubset(BaseAction): diff --git a/pype/ftrack/actions/action_delete_old_versions.py b/pype/modules/ftrack/actions/action_delete_old_versions.py similarity index 99% rename from pype/ftrack/actions/action_delete_old_versions.py rename to pype/modules/ftrack/actions/action_delete_old_versions.py index 30f786e93f..00432d5c3f 100644 --- a/pype/ftrack/actions/action_delete_old_versions.py +++ b/pype/modules/ftrack/actions/action_delete_old_versions.py @@ -5,9 +5,9 @@ import uuid import clique from pymongo import UpdateOne -from pype.ftrack import BaseAction -from pype.ftrack.lib.io_nonsingleton import DbConnector -from pypeapp import Anatomy +from pype.modules.ftrack import BaseAction +from pype.modules.ftrack.lib.io_nonsingleton import DbConnector +from pype.api import Anatomy import avalon.pipeline diff --git a/pype/ftrack/actions/action_delivery.py b/pype/modules/ftrack/actions/action_delivery.py similarity index 99% rename from pype/ftrack/actions/action_delivery.py rename to pype/modules/ftrack/actions/action_delivery.py index 23da81d383..1dfd3dd5d5 100644 --- a/pype/ftrack/actions/action_delivery.py +++ b/pype/modules/ftrack/actions/action_delivery.py @@ -10,9 +10,9 @@ from avalon import pipeline from avalon.vendor import filelink from avalon.tools.libraryloader.io_nonsingleton import DbConnector -from pypeapp import Anatomy -from pype.ftrack import BaseAction -from pype.ftrack.lib.avalon_sync import CustAttrIdKey +from pype.api import Anatomy +from pype.modules.ftrack import BaseAction +from pype.modules.ftrack.lib.avalon_sync import CustAttrIdKey class Delivery(BaseAction): diff --git a/pype/ftrack/actions/action_djvview.py b/pype/modules/ftrack/actions/action_djvview.py similarity index 99% rename from pype/ftrack/actions/action_djvview.py rename to pype/modules/ftrack/actions/action_djvview.py index ad00e33360..32c5824e0f 100644 --- a/pype/ftrack/actions/action_djvview.py +++ b/pype/modules/ftrack/actions/action_djvview.py @@ -5,8 +5,8 @@ import logging import subprocess from operator import itemgetter import ftrack_api -from pype.ftrack import BaseAction -from pypeapp import Logger, config +from pype.modules.ftrack import BaseAction +from pype.api import Logger, config log = Logger().get_logger(__name__) diff --git a/pype/ftrack/actions/action_job_killer.py b/pype/modules/ftrack/actions/action_job_killer.py similarity index 99% rename from pype/ftrack/actions/action_job_killer.py rename to pype/modules/ftrack/actions/action_job_killer.py index f01cebd0a8..064d7ed209 100644 --- a/pype/ftrack/actions/action_job_killer.py +++ b/pype/modules/ftrack/actions/action_job_killer.py @@ -5,7 +5,7 @@ import logging import json import ftrack_api -from pype.ftrack import BaseAction +from pype.modules.ftrack import BaseAction class JobKiller(BaseAction): diff --git a/pype/ftrack/actions/action_multiple_notes.py b/pype/modules/ftrack/actions/action_multiple_notes.py similarity index 99% rename from pype/ftrack/actions/action_multiple_notes.py rename to pype/modules/ftrack/actions/action_multiple_notes.py index 20637c001d..dcdb4c5dc9 100644 --- a/pype/ftrack/actions/action_multiple_notes.py +++ b/pype/modules/ftrack/actions/action_multiple_notes.py @@ -4,7 +4,7 @@ import argparse import logging import ftrack_api -from pype.ftrack import BaseAction +from pype.modules.ftrack import BaseAction class MultipleNotes(BaseAction): diff --git a/pype/ftrack/actions/action_prepare_project.py b/pype/modules/ftrack/actions/action_prepare_project.py similarity index 98% rename from pype/ftrack/actions/action_prepare_project.py rename to pype/modules/ftrack/actions/action_prepare_project.py index 2693a5750b..31cc802109 100644 --- a/pype/ftrack/actions/action_prepare_project.py +++ b/pype/modules/ftrack/actions/action_prepare_project.py @@ -1,9 +1,9 @@ import os import json -from pype.ftrack import BaseAction -from pypeapp import config, Anatomy, project_overrides_dir_path -from pype.ftrack.lib.avalon_sync import get_avalon_attr +from pype.modules.ftrack import BaseAction +from pype.api import config, Anatomy, project_overrides_dir_path +from pype.modules.ftrack.lib.avalon_sync import get_avalon_attr class PrepareProject(BaseAction): diff --git a/pype/ftrack/actions/action_rv.py b/pype/modules/ftrack/actions/action_rv.py similarity index 99% rename from pype/ftrack/actions/action_rv.py rename to pype/modules/ftrack/actions/action_rv.py index 0e2cd59981..ce2371b5b8 100644 --- a/pype/ftrack/actions/action_rv.py +++ b/pype/modules/ftrack/actions/action_rv.py @@ -5,8 +5,8 @@ import logging import traceback import json -from pypeapp import Logger, config -from pype.ftrack import BaseAction +from pype.api import Logger, config +from pype.modules.ftrack import BaseAction import ftrack_api from avalon import io, api diff --git a/pype/ftrack/actions/action_seed.py b/pype/modules/ftrack/actions/action_seed.py similarity index 99% rename from pype/ftrack/actions/action_seed.py rename to pype/modules/ftrack/actions/action_seed.py index 537aeab65b..72625c13e4 100644 --- a/pype/ftrack/actions/action_seed.py +++ b/pype/modules/ftrack/actions/action_seed.py @@ -1,6 +1,6 @@ import os from operator import itemgetter -from pype.ftrack import BaseAction +from pype.modules.ftrack import BaseAction class SeedDebugProject(BaseAction): diff --git a/pype/ftrack/actions/action_start_timer.py b/pype/modules/ftrack/actions/action_start_timer.py similarity index 95% rename from pype/ftrack/actions/action_start_timer.py rename to pype/modules/ftrack/actions/action_start_timer.py index bd77276b6d..3e5cf0d4c1 100644 --- a/pype/ftrack/actions/action_start_timer.py +++ b/pype/modules/ftrack/actions/action_start_timer.py @@ -1,5 +1,5 @@ import ftrack_api -from pype.ftrack import BaseAction +from pype.modules.ftrack import BaseAction class StartTimer(BaseAction): diff --git a/pype/ftrack/actions/action_store_thumbnails_to_avalon.py b/pype/modules/ftrack/actions/action_store_thumbnails_to_avalon.py similarity index 98% rename from pype/ftrack/actions/action_store_thumbnails_to_avalon.py rename to pype/modules/ftrack/actions/action_store_thumbnails_to_avalon.py index c95010c5ce..180d6ae03c 100644 --- a/pype/ftrack/actions/action_store_thumbnails_to_avalon.py +++ b/pype/modules/ftrack/actions/action_store_thumbnails_to_avalon.py @@ -4,11 +4,11 @@ import errno import json from bson.objectid import ObjectId -from pype.ftrack import BaseAction -from pypeapp import Anatomy -from pype.ftrack.lib.io_nonsingleton import DbConnector +from pype.modules.ftrack import BaseAction +from pype.api import Anatomy +from pype.modules.ftrack.lib.io_nonsingleton import DbConnector -from pype.ftrack.lib.avalon_sync import CustAttrIdKey +from pype.modules.ftrack.lib.avalon_sync import CustAttrIdKey class StoreThumbnailsToAvalon(BaseAction): diff --git a/pype/ftrack/actions/action_sync_to_avalon.py b/pype/modules/ftrack/actions/action_sync_to_avalon.py similarity index 98% rename from pype/ftrack/actions/action_sync_to_avalon.py rename to pype/modules/ftrack/actions/action_sync_to_avalon.py index d2fcfb372f..8c6519e4dc 100644 --- a/pype/ftrack/actions/action_sync_to_avalon.py +++ b/pype/modules/ftrack/actions/action_sync_to_avalon.py @@ -2,8 +2,8 @@ import os import time import traceback -from pype.ftrack import BaseAction -from pype.ftrack.lib.avalon_sync import SyncEntitiesFactory +from pype.modules.ftrack import BaseAction +from pype.modules.ftrack.lib.avalon_sync import SyncEntitiesFactory class SyncToAvalonLocal(BaseAction): diff --git a/pype/ftrack/actions/action_test.py b/pype/modules/ftrack/actions/action_test.py similarity index 97% rename from pype/ftrack/actions/action_test.py rename to pype/modules/ftrack/actions/action_test.py index 502373e626..784bf80944 100644 --- a/pype/ftrack/actions/action_test.py +++ b/pype/modules/ftrack/actions/action_test.py @@ -7,8 +7,8 @@ import json import re import ftrack_api -from pype.ftrack import BaseAction from avalon import io, inventory, schema +from pype.modules.ftrack import BaseAction class TestAction(BaseAction): diff --git a/pype/ftrack/actions/action_thumbnail_to_childern.py b/pype/modules/ftrack/actions/action_thumbnail_to_childern.py similarity index 98% rename from pype/ftrack/actions/action_thumbnail_to_childern.py rename to pype/modules/ftrack/actions/action_thumbnail_to_childern.py index 7d8c02d6c7..e194134694 100644 --- a/pype/ftrack/actions/action_thumbnail_to_childern.py +++ b/pype/modules/ftrack/actions/action_thumbnail_to_childern.py @@ -5,7 +5,7 @@ import logging import json import ftrack_api -from pype.ftrack import BaseAction +from pype.modules.ftrack import BaseAction class ThumbToChildren(BaseAction): diff --git a/pype/ftrack/actions/action_thumbnail_to_parent.py b/pype/modules/ftrack/actions/action_thumbnail_to_parent.py similarity index 98% rename from pype/ftrack/actions/action_thumbnail_to_parent.py rename to pype/modules/ftrack/actions/action_thumbnail_to_parent.py index afc214a37e..86ada64e5a 100644 --- a/pype/ftrack/actions/action_thumbnail_to_parent.py +++ b/pype/modules/ftrack/actions/action_thumbnail_to_parent.py @@ -4,7 +4,7 @@ import argparse import logging import json import ftrack_api -from pype.ftrack import BaseAction +from pype.modules.ftrack import BaseAction class ThumbToParent(BaseAction): diff --git a/pype/ftrack/actions/action_update_from_v2-2-0.py b/pype/modules/ftrack/actions/action_update_from_v2-2-0.py similarity index 98% rename from pype/ftrack/actions/action_update_from_v2-2-0.py rename to pype/modules/ftrack/actions/action_update_from_v2-2-0.py index dd0f1e6ea2..805072ce5d 100644 --- a/pype/ftrack/actions/action_update_from_v2-2-0.py +++ b/pype/modules/ftrack/actions/action_update_from_v2-2-0.py @@ -1,7 +1,7 @@ import os -from pype.ftrack import BaseAction -from pype.ftrack.lib.io_nonsingleton import DbConnector +from pype.modules.ftrack import BaseAction +from pype.modules.ftrack.lib.io_nonsingleton import DbConnector class PypeUpdateFromV2_2_0(BaseAction): diff --git a/pype/ftrack/actions/action_where_run_ask.py b/pype/modules/ftrack/actions/action_where_run_ask.py similarity index 96% rename from pype/ftrack/actions/action_where_run_ask.py rename to pype/modules/ftrack/actions/action_where_run_ask.py index a28f32f407..d7bc8b11f9 100644 --- a/pype/ftrack/actions/action_where_run_ask.py +++ b/pype/modules/ftrack/actions/action_where_run_ask.py @@ -1,5 +1,5 @@ import os -from pype.ftrack import BaseAction +from pype.modules.ftrack import BaseAction class ActionAskWhereIRun(BaseAction): diff --git a/pype/ftrack/actions/action_where_run_show.py b/pype/modules/ftrack/actions/action_where_run_show.py similarity index 98% rename from pype/ftrack/actions/action_where_run_show.py rename to pype/modules/ftrack/actions/action_where_run_show.py index 3f37ef8378..c7abccb8c9 100644 --- a/pype/ftrack/actions/action_where_run_show.py +++ b/pype/modules/ftrack/actions/action_where_run_show.py @@ -2,7 +2,7 @@ import platform import socket import getpass import ftrack_api -from pype.ftrack import BaseAction +from pype.modules.ftrack import BaseAction class ActionShowWhereIRun(BaseAction): diff --git a/pype/ftrack/events/action_sync_to_avalon.py b/pype/modules/ftrack/events/action_sync_to_avalon.py similarity index 98% rename from pype/ftrack/events/action_sync_to_avalon.py rename to pype/modules/ftrack/events/action_sync_to_avalon.py index 79ab1b5f7a..a06b825d6a 100644 --- a/pype/ftrack/events/action_sync_to_avalon.py +++ b/pype/modules/ftrack/events/action_sync_to_avalon.py @@ -2,9 +2,9 @@ import os import time import traceback -from pype.ftrack import BaseAction -from pype.ftrack.lib.avalon_sync import SyncEntitiesFactory -from pypeapp import config +from pype.modules.ftrack import BaseAction +from pype.modules.ftrack.lib.avalon_sync import SyncEntitiesFactory +from pype.api import config class SyncToAvalonServer(BaseAction): diff --git a/pype/ftrack/events/event_del_avalon_id_from_new.py b/pype/modules/ftrack/events/event_del_avalon_id_from_new.py similarity index 90% rename from pype/ftrack/events/event_del_avalon_id_from_new.py rename to pype/modules/ftrack/events/event_del_avalon_id_from_new.py index d820e40467..89bad52f29 100644 --- a/pype/ftrack/events/event_del_avalon_id_from_new.py +++ b/pype/modules/ftrack/events/event_del_avalon_id_from_new.py @@ -1,6 +1,6 @@ -from pype.ftrack.lib import BaseEvent -from pype.ftrack.lib.avalon_sync import CustAttrIdKey -from pype.ftrack.events.event_sync_to_avalon import SyncToAvalonEvent +from pype.modules.ftrack.lib import BaseEvent +from pype.modules.ftrack.lib.avalon_sync import CustAttrIdKey +from pype.modules.ftrack.events.event_sync_to_avalon import SyncToAvalonEvent class DelAvalonIdFromNew(BaseEvent): diff --git a/pype/ftrack/events/event_first_version_status.py b/pype/modules/ftrack/events/event_first_version_status.py similarity index 99% rename from pype/ftrack/events/event_first_version_status.py rename to pype/modules/ftrack/events/event_first_version_status.py index 2e2b98ad5f..511907a048 100644 --- a/pype/ftrack/events/event_first_version_status.py +++ b/pype/modules/ftrack/events/event_first_version_status.py @@ -1,4 +1,4 @@ -from pype.ftrack import BaseEvent +from pype.modules.ftrack import BaseEvent class FirstVersionStatus(BaseEvent): diff --git a/pype/ftrack/events/event_next_task_update.py b/pype/modules/ftrack/events/event_next_task_update.py similarity index 98% rename from pype/ftrack/events/event_next_task_update.py rename to pype/modules/ftrack/events/event_next_task_update.py index c709fed5e5..dc1ab0a0d7 100644 --- a/pype/ftrack/events/event_next_task_update.py +++ b/pype/modules/ftrack/events/event_next_task_update.py @@ -1,5 +1,5 @@ import ftrack_api -from pype.ftrack import BaseEvent +from pype.modules.ftrack import BaseEvent import operator diff --git a/pype/ftrack/events/event_radio_buttons.py b/pype/modules/ftrack/events/event_radio_buttons.py similarity index 96% rename from pype/ftrack/events/event_radio_buttons.py rename to pype/modules/ftrack/events/event_radio_buttons.py index 5b633d8976..b2ab4e75ec 100644 --- a/pype/ftrack/events/event_radio_buttons.py +++ b/pype/modules/ftrack/events/event_radio_buttons.py @@ -1,5 +1,5 @@ import ftrack_api -from pype.ftrack.lib import BaseEvent +from pype.modules.ftrack.lib import BaseEvent class RadioButtons(BaseEvent): diff --git a/pype/ftrack/events/event_sync_to_avalon.py b/pype/modules/ftrack/events/event_sync_to_avalon.py similarity index 99% rename from pype/ftrack/events/event_sync_to_avalon.py rename to pype/modules/ftrack/events/event_sync_to_avalon.py index 19bd6c8273..e79fcac4cd 100644 --- a/pype/ftrack/events/event_sync_to_avalon.py +++ b/pype/modules/ftrack/events/event_sync_to_avalon.py @@ -12,14 +12,14 @@ from pymongo import UpdateOne from avalon import schema -from pype.ftrack.lib import avalon_sync -from pype.ftrack.lib.avalon_sync import ( +from pype.modules.ftrack.lib import avalon_sync +from pype.modules.ftrack.lib.avalon_sync import ( CustAttrIdKey, CustAttrAutoSync, EntitySchemas ) import ftrack_api -from pype.ftrack import BaseEvent +from pype.modules.ftrack import BaseEvent -from pype.ftrack.lib.io_nonsingleton import DbConnector +from pype.modules.ftrack.lib.io_nonsingleton import DbConnector class SyncToAvalonEvent(BaseEvent): diff --git a/pype/ftrack/events/event_test.py b/pype/modules/ftrack/events/event_test.py similarity index 90% rename from pype/ftrack/events/event_test.py rename to pype/modules/ftrack/events/event_test.py index 1dfd8ee8b1..0a86bd1754 100644 --- a/pype/ftrack/events/event_test.py +++ b/pype/modules/ftrack/events/event_test.py @@ -2,7 +2,7 @@ import os import sys import re import ftrack_api -from pype.ftrack import BaseEvent +from pype.modules.ftrack import BaseEvent class TestEvent(BaseEvent): diff --git a/pype/ftrack/events/event_thumbnail_updates.py b/pype/modules/ftrack/events/event_thumbnail_updates.py similarity index 97% rename from pype/ftrack/events/event_thumbnail_updates.py rename to pype/modules/ftrack/events/event_thumbnail_updates.py index c62be9718a..c33ee08c2d 100644 --- a/pype/ftrack/events/event_thumbnail_updates.py +++ b/pype/modules/ftrack/events/event_thumbnail_updates.py @@ -1,4 +1,4 @@ -from pype.ftrack import BaseEvent +from pype.modules.ftrack import BaseEvent class ThumbnailEvents(BaseEvent): diff --git a/pype/ftrack/events/event_user_assigment.py b/pype/modules/ftrack/events/event_user_assigment.py similarity index 96% rename from pype/ftrack/events/event_user_assigment.py rename to pype/modules/ftrack/events/event_user_assigment.py index bf3bec93be..e198ced618 100644 --- a/pype/ftrack/events/event_user_assigment.py +++ b/pype/modules/ftrack/events/event_user_assigment.py @@ -2,14 +2,13 @@ import os import re import subprocess -from pype.ftrack import BaseEvent -from pype.ftrack.lib.avalon_sync import CustAttrIdKey -from pype.ftrack.lib.io_nonsingleton import DbConnector +from pype.modules.ftrack import BaseEvent +from pype.modules.ftrack.lib.avalon_sync import CustAttrIdKey +from pype.modules.ftrack.lib.io_nonsingleton import DbConnector from bson.objectid import ObjectId -from pypeapp import config -from pypeapp import Anatomy +from pype.api import config, Anatomy class UserAssigmentEvent(BaseEvent): @@ -149,7 +148,7 @@ class UserAssigmentEvent(BaseEvent): """ Get data to fill template from task - .. seealso:: :mod:`pypeapp.Anatomy` + .. seealso:: :mod:`pype.api.Anatomy` :param task: Task entity :type task: dict diff --git a/pype/ftrack/events/event_version_to_task_statuses.py b/pype/modules/ftrack/events/event_version_to_task_statuses.py similarity index 98% rename from pype/ftrack/events/event_version_to_task_statuses.py rename to pype/modules/ftrack/events/event_version_to_task_statuses.py index 0d2a3130c0..3ff986f9c6 100644 --- a/pype/ftrack/events/event_version_to_task_statuses.py +++ b/pype/modules/ftrack/events/event_version_to_task_statuses.py @@ -1,5 +1,5 @@ -from pype.ftrack import BaseEvent -from pypeapp import config +from pype.modules.ftrack import BaseEvent +from pype.api import config class VersionToTaskStatus(BaseEvent): diff --git a/pype/ftrack/ftrack_server/__init__.py b/pype/modules/ftrack/ftrack_server/__init__.py similarity index 100% rename from pype/ftrack/ftrack_server/__init__.py rename to pype/modules/ftrack/ftrack_server/__init__.py diff --git a/pype/ftrack/ftrack_server/event_server_cli.py b/pype/modules/ftrack/ftrack_server/event_server_cli.py similarity index 99% rename from pype/ftrack/ftrack_server/event_server_cli.py rename to pype/modules/ftrack/ftrack_server/event_server_cli.py index 4c1d1667c3..5709a88297 100644 --- a/pype/ftrack/ftrack_server/event_server_cli.py +++ b/pype/modules/ftrack/ftrack_server/event_server_cli.py @@ -13,8 +13,8 @@ import time import uuid import ftrack_api -from pype.ftrack.lib import credentials -from pype.ftrack.ftrack_server.lib import ( +from pype.modules.ftrack.lib import credentials +from pype.modules.ftrack.ftrack_server.lib import ( ftrack_events_mongo_settings, check_ftrack_url ) import socket_thread diff --git a/pype/ftrack/ftrack_server/ftrack_server.py b/pype/modules/ftrack/ftrack_server/ftrack_server.py similarity index 99% rename from pype/ftrack/ftrack_server/ftrack_server.py rename to pype/modules/ftrack/ftrack_server/ftrack_server.py index 8464203c1d..92f3c0b3a0 100644 --- a/pype/ftrack/ftrack_server/ftrack_server.py +++ b/pype/modules/ftrack/ftrack_server/ftrack_server.py @@ -6,7 +6,7 @@ import ftrack_api import time import logging import inspect -from pypeapp import Logger, config +from pype.api import Logger, config log = Logger().get_logger(__name__) diff --git a/pype/ftrack/ftrack_server/lib.py b/pype/modules/ftrack/ftrack_server/lib.py similarity index 99% rename from pype/ftrack/ftrack_server/lib.py rename to pype/modules/ftrack/ftrack_server/lib.py index e623cab8fb..129cd7173a 100644 --- a/pype/ftrack/ftrack_server/lib.py +++ b/pype/modules/ftrack/ftrack_server/lib.py @@ -23,9 +23,9 @@ try: except ImportError: from urlparse import urlparse, parse_qs -from pypeapp import Logger +from pype.api import Logger -from pype.ftrack.lib.custom_db_connector import DbConnector +from pype.modules.ftrack.lib.custom_db_connector import DbConnector TOPIC_STATUS_SERVER = "pype.event.server.status" diff --git a/pype/ftrack/ftrack_server/socket_thread.py b/pype/modules/ftrack/ftrack_server/socket_thread.py similarity index 99% rename from pype/ftrack/ftrack_server/socket_thread.py rename to pype/modules/ftrack/ftrack_server/socket_thread.py index 942965f9e2..dda4c7db35 100644 --- a/pype/ftrack/ftrack_server/socket_thread.py +++ b/pype/modules/ftrack/ftrack_server/socket_thread.py @@ -5,7 +5,7 @@ import socket import threading import traceback import subprocess -from pypeapp import Logger +from pype.api import Logger class SocketThread(threading.Thread): diff --git a/pype/ftrack/ftrack_server/sub_event_processor.py b/pype/modules/ftrack/ftrack_server/sub_event_processor.py similarity index 96% rename from pype/ftrack/ftrack_server/sub_event_processor.py rename to pype/modules/ftrack/ftrack_server/sub_event_processor.py index 2a3ad3e76d..d7bb7a53b3 100644 --- a/pype/ftrack/ftrack_server/sub_event_processor.py +++ b/pype/modules/ftrack/ftrack_server/sub_event_processor.py @@ -5,11 +5,11 @@ import socket import datetime from ftrack_server import FtrackServer -from pype.ftrack.ftrack_server.lib import ( +from pype.modules.ftrack.ftrack_server.lib import ( SocketSession, ProcessEventHub, TOPIC_STATUS_SERVER ) import ftrack_api -from pypeapp import Logger +from pype.api import Logger log = Logger().get_logger("Event processor") diff --git a/pype/ftrack/ftrack_server/sub_event_status.py b/pype/modules/ftrack/ftrack_server/sub_event_status.py similarity index 99% rename from pype/ftrack/ftrack_server/sub_event_status.py rename to pype/modules/ftrack/ftrack_server/sub_event_status.py index d3e6a3d647..c2e7b7477f 100644 --- a/pype/ftrack/ftrack_server/sub_event_status.py +++ b/pype/modules/ftrack/ftrack_server/sub_event_status.py @@ -8,11 +8,11 @@ import datetime import ftrack_api from ftrack_server import FtrackServer -from pype.ftrack.ftrack_server.lib import ( +from pype.modules.ftrack.ftrack_server.lib import ( SocketSession, StatusEventHub, TOPIC_STATUS_SERVER, TOPIC_STATUS_SERVER_RESULT ) -from pypeapp import Logger, config +from pype.api import Logger, config log = Logger().get_logger("Event storer") action_identifier = ( diff --git a/pype/ftrack/ftrack_server/sub_event_storer.py b/pype/modules/ftrack/ftrack_server/sub_event_storer.py similarity index 97% rename from pype/ftrack/ftrack_server/sub_event_storer.py rename to pype/modules/ftrack/ftrack_server/sub_event_storer.py index b4b9b8a7ab..c4d199407d 100644 --- a/pype/ftrack/ftrack_server/sub_event_storer.py +++ b/pype/modules/ftrack/ftrack_server/sub_event_storer.py @@ -7,13 +7,13 @@ import pymongo import ftrack_api from ftrack_server import FtrackServer -from pype.ftrack.ftrack_server.lib import ( +from pype.modules.ftrack.ftrack_server.lib import ( SocketSession, StorerEventHub, get_ftrack_event_mongo_info, TOPIC_STATUS_SERVER, TOPIC_STATUS_SERVER_RESULT ) -from pype.ftrack.lib.custom_db_connector import DbConnector -from pypeapp import Logger +from pype.modules.ftrack.lib.custom_db_connector import DbConnector +from pype.api import Logger log = Logger().get_logger("Event storer") subprocess_started = datetime.datetime.now() diff --git a/pype/ftrack/ftrack_server/sub_legacy_server.py b/pype/modules/ftrack/ftrack_server/sub_legacy_server.py similarity index 98% rename from pype/ftrack/ftrack_server/sub_legacy_server.py rename to pype/modules/ftrack/ftrack_server/sub_legacy_server.py index 8b7bab5e2e..c37727a784 100644 --- a/pype/ftrack/ftrack_server/sub_legacy_server.py +++ b/pype/modules/ftrack/ftrack_server/sub_legacy_server.py @@ -6,7 +6,7 @@ import threading from ftrack_server import FtrackServer import ftrack_api -from pypeapp import Logger +from pype.api import Logger log = Logger().get_logger("Event Server Legacy") diff --git a/pype/ftrack/ftrack_server/sub_user_server.py b/pype/modules/ftrack/ftrack_server/sub_user_server.py similarity index 91% rename from pype/ftrack/ftrack_server/sub_user_server.py rename to pype/modules/ftrack/ftrack_server/sub_user_server.py index 8c1497a562..f4b81922eb 100644 --- a/pype/ftrack/ftrack_server/sub_user_server.py +++ b/pype/modules/ftrack/ftrack_server/sub_user_server.py @@ -5,9 +5,12 @@ import socket import traceback from ftrack_server import FtrackServer -from pype.ftrack.ftrack_server.lib import SocketSession, SocketBaseEventHub +from pype.modules.ftrack.ftrack_server.lib import ( + SocketSession, + SocketBaseEventHub +) -from pypeapp import Logger +from pype.api import Logger log = Logger().get_logger("FtrackUserServer") diff --git a/pype/ftrack/lib/__init__.py b/pype/modules/ftrack/lib/__init__.py similarity index 100% rename from pype/ftrack/lib/__init__.py rename to pype/modules/ftrack/lib/__init__.py diff --git a/pype/ftrack/lib/avalon_sync.py b/pype/modules/ftrack/lib/avalon_sync.py similarity index 99% rename from pype/ftrack/lib/avalon_sync.py rename to pype/modules/ftrack/lib/avalon_sync.py index 6bf0cd9754..c5c9eb9054 100644 --- a/pype/ftrack/lib/avalon_sync.py +++ b/pype/modules/ftrack/lib/avalon_sync.py @@ -4,12 +4,12 @@ import queue import collections import copy -from pype.ftrack.lib.io_nonsingleton import DbConnector +from pype.modules.ftrack.lib.io_nonsingleton import DbConnector import avalon import avalon.api from avalon.vendor import toml -from pypeapp import Logger, Anatomy +from pype.api import Logger, Anatomy from bson.objectid import ObjectId from bson.errors import InvalidId diff --git a/pype/ftrack/lib/credentials.py b/pype/modules/ftrack/lib/credentials.py similarity index 100% rename from pype/ftrack/lib/credentials.py rename to pype/modules/ftrack/lib/credentials.py diff --git a/pype/ftrack/lib/custom_db_connector.py b/pype/modules/ftrack/lib/custom_db_connector.py similarity index 100% rename from pype/ftrack/lib/custom_db_connector.py rename to pype/modules/ftrack/lib/custom_db_connector.py diff --git a/pype/ftrack/lib/ftrack_action_handler.py b/pype/modules/ftrack/lib/ftrack_action_handler.py similarity index 100% rename from pype/ftrack/lib/ftrack_action_handler.py rename to pype/modules/ftrack/lib/ftrack_action_handler.py diff --git a/pype/ftrack/lib/ftrack_app_handler.py b/pype/modules/ftrack/lib/ftrack_app_handler.py similarity index 99% rename from pype/ftrack/lib/ftrack_app_handler.py rename to pype/modules/ftrack/lib/ftrack_app_handler.py index f91695edf0..00bd13fd73 100644 --- a/pype/ftrack/lib/ftrack_app_handler.py +++ b/pype/modules/ftrack/lib/ftrack_app_handler.py @@ -5,11 +5,9 @@ import platform import avalon.lib import acre from pype import lib as pypelib -from pypeapp import config +from pype.api import config, Anatomy from .ftrack_action_handler import BaseAction -from pypeapp import Anatomy - class AppAction(BaseAction): """Application Action class. diff --git a/pype/ftrack/lib/ftrack_base_handler.py b/pype/modules/ftrack/lib/ftrack_base_handler.py similarity index 99% rename from pype/ftrack/lib/ftrack_base_handler.py rename to pype/modules/ftrack/lib/ftrack_base_handler.py index 09d4cfe621..c7144bb2f7 100644 --- a/pype/ftrack/lib/ftrack_base_handler.py +++ b/pype/modules/ftrack/lib/ftrack_base_handler.py @@ -1,8 +1,8 @@ import functools import time -from pypeapp import Logger +from pype.api import Logger import ftrack_api -from pype.ftrack.ftrack_server.lib import SocketSession +from pype.modules.ftrack.ftrack_server.lib import SocketSession class MissingPermision(Exception): diff --git a/pype/ftrack/lib/ftrack_event_handler.py b/pype/modules/ftrack/lib/ftrack_event_handler.py similarity index 100% rename from pype/ftrack/lib/ftrack_event_handler.py rename to pype/modules/ftrack/lib/ftrack_event_handler.py diff --git a/pype/services/adobe_communicator/lib/io_nonsingleton.py b/pype/modules/ftrack/lib/io_nonsingleton.py similarity index 100% rename from pype/services/adobe_communicator/lib/io_nonsingleton.py rename to pype/modules/ftrack/lib/io_nonsingleton.py diff --git a/pype/ftrack/tray/__init__.py b/pype/modules/ftrack/tray/__init__.py similarity index 100% rename from pype/ftrack/tray/__init__.py rename to pype/modules/ftrack/tray/__init__.py diff --git a/pype/ftrack/tray/ftrack_module.py b/pype/modules/ftrack/tray/ftrack_module.py similarity index 99% rename from pype/ftrack/tray/ftrack_module.py rename to pype/modules/ftrack/tray/ftrack_module.py index 5811209a02..674e8cbd4f 100644 --- a/pype/ftrack/tray/ftrack_module.py +++ b/pype/modules/ftrack/tray/ftrack_module.py @@ -10,7 +10,7 @@ from ..ftrack_server import socket_thread from ..lib import credentials from . import login_dialog -from pypeapp import Logger +from pype.api import Logger log = Logger().get_logger("FtrackModule", "ftrack") diff --git a/pype/ftrack/tray/login_dialog.py b/pype/modules/ftrack/tray/login_dialog.py similarity index 99% rename from pype/ftrack/tray/login_dialog.py rename to pype/modules/ftrack/tray/login_dialog.py index 88c4e90374..0bfa1cc481 100644 --- a/pype/ftrack/tray/login_dialog.py +++ b/pype/modules/ftrack/tray/login_dialog.py @@ -1,7 +1,7 @@ import os import requests from pypeapp import style -from pype.ftrack import credentials +from pype.modules.ftrack import credentials from . import login_tools from Qt import QtCore, QtGui, QtWidgets diff --git a/pype/ftrack/tray/login_tools.py b/pype/modules/ftrack/tray/login_tools.py similarity index 100% rename from pype/ftrack/tray/login_tools.py rename to pype/modules/ftrack/tray/login_tools.py diff --git a/pype/services/idle_manager/__init__.py b/pype/modules/idle_manager/__init__.py similarity index 100% rename from pype/services/idle_manager/__init__.py rename to pype/modules/idle_manager/__init__.py diff --git a/pype/services/idle_manager/idle_manager.py b/pype/modules/idle_manager/idle_manager.py similarity index 99% rename from pype/services/idle_manager/idle_manager.py rename to pype/modules/idle_manager/idle_manager.py index 0897245049..cfcdfef78f 100644 --- a/pype/services/idle_manager/idle_manager.py +++ b/pype/modules/idle_manager/idle_manager.py @@ -2,7 +2,7 @@ import time import collections from Qt import QtCore from pynput import mouse, keyboard -from pypeapp import Logger +from pype.api import Logger class IdleManager(QtCore.QThread): diff --git a/pype/modules/logging/gui/__init__.py b/pype/modules/logging/gui/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/pype/logging/gui/app.py b/pype/modules/logging/gui/app.py similarity index 100% rename from pype/logging/gui/app.py rename to pype/modules/logging/gui/app.py diff --git a/pype/logging/gui/lib.py b/pype/modules/logging/gui/lib.py similarity index 100% rename from pype/logging/gui/lib.py rename to pype/modules/logging/gui/lib.py diff --git a/pype/logging/gui/models.py b/pype/modules/logging/gui/models.py similarity index 99% rename from pype/logging/gui/models.py rename to pype/modules/logging/gui/models.py index 6722ed0fe0..2ef79554fe 100644 --- a/pype/logging/gui/models.py +++ b/pype/modules/logging/gui/models.py @@ -1,6 +1,6 @@ import os from Qt import QtCore -from pypeapp import Logger +from pype.api import Logger from pypeapp.lib.log import _bootstrap_mongo_log log = Logger().get_logger("LogModel", "LoggingModule") diff --git a/pype/logging/gui/widgets.py b/pype/modules/logging/gui/widgets.py similarity index 100% rename from pype/logging/gui/widgets.py rename to pype/modules/logging/gui/widgets.py diff --git a/pype/logging/tray/__init__.py b/pype/modules/logging/tray/__init__.py similarity index 100% rename from pype/logging/tray/__init__.py rename to pype/modules/logging/tray/__init__.py diff --git a/pype/logging/tray/logging_module.py b/pype/modules/logging/tray/logging_module.py similarity index 96% rename from pype/logging/tray/logging_module.py rename to pype/modules/logging/tray/logging_module.py index 30f55cd680..15bec1aad5 100644 --- a/pype/logging/tray/logging_module.py +++ b/pype/modules/logging/tray/logging_module.py @@ -1,7 +1,7 @@ import os from Qt import QtWidgets -from pypeapp import Logger +from pype.api import Logger from ..gui.app import LogsWindow diff --git a/pype/muster/__init__.py b/pype/modules/muster/__init__.py similarity index 100% rename from pype/muster/__init__.py rename to pype/modules/muster/__init__.py diff --git a/pype/muster/muster.py b/pype/modules/muster/muster.py similarity index 100% rename from pype/muster/muster.py rename to pype/modules/muster/muster.py diff --git a/pype/muster/widget_login.py b/pype/modules/muster/widget_login.py similarity index 100% rename from pype/muster/widget_login.py rename to pype/modules/muster/widget_login.py diff --git a/pype/services/rest_api/__init__.py b/pype/modules/rest_api/__init__.py similarity index 100% rename from pype/services/rest_api/__init__.py rename to pype/modules/rest_api/__init__.py diff --git a/pype/services/rest_api/base_class.py b/pype/modules/rest_api/base_class.py similarity index 100% rename from pype/services/rest_api/base_class.py rename to pype/modules/rest_api/base_class.py diff --git a/pype/services/rest_api/lib/__init__.py b/pype/modules/rest_api/lib/__init__.py similarity index 100% rename from pype/services/rest_api/lib/__init__.py rename to pype/modules/rest_api/lib/__init__.py diff --git a/pype/services/rest_api/lib/exceptions.py b/pype/modules/rest_api/lib/exceptions.py similarity index 100% rename from pype/services/rest_api/lib/exceptions.py rename to pype/modules/rest_api/lib/exceptions.py diff --git a/pype/services/rest_api/lib/factory.py b/pype/modules/rest_api/lib/factory.py similarity index 99% rename from pype/services/rest_api/lib/factory.py rename to pype/modules/rest_api/lib/factory.py index 39ea8474fa..ad884eea1c 100644 --- a/pype/services/rest_api/lib/factory.py +++ b/pype/modules/rest_api/lib/factory.py @@ -5,7 +5,7 @@ import collections from .lib import RestMethods from queue import Queue -from pypeapp import Logger +from pype.api import Logger log = Logger().get_logger("RestApiFactory") diff --git a/pype/services/rest_api/lib/handler.py b/pype/modules/rest_api/lib/handler.py similarity index 99% rename from pype/services/rest_api/lib/handler.py rename to pype/modules/rest_api/lib/handler.py index fc4410a0bc..93e583882b 100644 --- a/pype/services/rest_api/lib/handler.py +++ b/pype/modules/rest_api/lib/handler.py @@ -11,7 +11,7 @@ from .lib import RestMethods, CallbackResult, RequestInfo from .exceptions import AbortException from . import RestApiFactory, Splitter -from pypeapp import Logger +from pype.api import Logger log = Logger().get_logger("RestApiHandler") diff --git a/pype/services/rest_api/lib/lib.py b/pype/modules/rest_api/lib/lib.py similarity index 100% rename from pype/services/rest_api/lib/lib.py rename to pype/modules/rest_api/lib/lib.py diff --git a/pype/services/rest_api/rest_api.py b/pype/modules/rest_api/rest_api.py similarity index 99% rename from pype/services/rest_api/rest_api.py rename to pype/modules/rest_api/rest_api.py index d600a3a8a8..5f0969a5a2 100644 --- a/pype/services/rest_api/rest_api.py +++ b/pype/modules/rest_api/rest_api.py @@ -6,7 +6,7 @@ from socketserver import ThreadingMixIn from http.server import HTTPServer from .lib import RestApiFactory, Handler from .base_class import route, register_statics -from pypeapp import config, Logger +from pype.api import config, Logger log = Logger().get_logger("RestApiServer") diff --git a/pype/standalonepublish/__init__.py b/pype/modules/standalonepublish/__init__.py similarity index 100% rename from pype/standalonepublish/__init__.py rename to pype/modules/standalonepublish/__init__.py diff --git a/pype/standalonepublish/__main__.py b/pype/modules/standalonepublish/__main__.py similarity index 100% rename from pype/standalonepublish/__main__.py rename to pype/modules/standalonepublish/__main__.py diff --git a/pype/standalonepublish/app.py b/pype/modules/standalonepublish/app.py similarity index 100% rename from pype/standalonepublish/app.py rename to pype/modules/standalonepublish/app.py diff --git a/pype/standalonepublish/publish.py b/pype/modules/standalonepublish/publish.py similarity index 99% rename from pype/standalonepublish/publish.py rename to pype/modules/standalonepublish/publish.py index 045b3d590e..43d3b029dc 100644 --- a/pype/standalonepublish/publish.py +++ b/pype/modules/standalonepublish/publish.py @@ -9,7 +9,7 @@ from avalon import io, api from avalon.tools import publish as av_publish import pype -from pypeapp import execute +from pype.api import execute import pyblish.api from . import PUBLISH_PATHS diff --git a/pype/standalonepublish/resources/__init__.py b/pype/modules/standalonepublish/resources/__init__.py similarity index 100% rename from pype/standalonepublish/resources/__init__.py rename to pype/modules/standalonepublish/resources/__init__.py diff --git a/pype/standalonepublish/resources/edit.svg b/pype/modules/standalonepublish/resources/edit.svg similarity index 100% rename from pype/standalonepublish/resources/edit.svg rename to pype/modules/standalonepublish/resources/edit.svg diff --git a/pype/standalonepublish/resources/file.png b/pype/modules/standalonepublish/resources/file.png similarity index 100% rename from pype/standalonepublish/resources/file.png rename to pype/modules/standalonepublish/resources/file.png diff --git a/pype/standalonepublish/resources/files.png b/pype/modules/standalonepublish/resources/files.png similarity index 100% rename from pype/standalonepublish/resources/files.png rename to pype/modules/standalonepublish/resources/files.png diff --git a/pype/standalonepublish/resources/houdini.png b/pype/modules/standalonepublish/resources/houdini.png similarity index 100% rename from pype/standalonepublish/resources/houdini.png rename to pype/modules/standalonepublish/resources/houdini.png diff --git a/pype/standalonepublish/resources/image_file.png b/pype/modules/standalonepublish/resources/image_file.png similarity index 100% rename from pype/standalonepublish/resources/image_file.png rename to pype/modules/standalonepublish/resources/image_file.png diff --git a/pype/standalonepublish/resources/image_files.png b/pype/modules/standalonepublish/resources/image_files.png similarity index 100% rename from pype/standalonepublish/resources/image_files.png rename to pype/modules/standalonepublish/resources/image_files.png diff --git a/pype/standalonepublish/resources/information.svg b/pype/modules/standalonepublish/resources/information.svg similarity index 100% rename from pype/standalonepublish/resources/information.svg rename to pype/modules/standalonepublish/resources/information.svg diff --git a/pype/standalonepublish/resources/maya.png b/pype/modules/standalonepublish/resources/maya.png similarity index 100% rename from pype/standalonepublish/resources/maya.png rename to pype/modules/standalonepublish/resources/maya.png diff --git a/pype/standalonepublish/resources/menu.png b/pype/modules/standalonepublish/resources/menu.png similarity index 100% rename from pype/standalonepublish/resources/menu.png rename to pype/modules/standalonepublish/resources/menu.png diff --git a/pype/standalonepublish/resources/menu_disabled.png b/pype/modules/standalonepublish/resources/menu_disabled.png similarity index 100% rename from pype/standalonepublish/resources/menu_disabled.png rename to pype/modules/standalonepublish/resources/menu_disabled.png diff --git a/pype/standalonepublish/resources/menu_hover.png b/pype/modules/standalonepublish/resources/menu_hover.png similarity index 100% rename from pype/standalonepublish/resources/menu_hover.png rename to pype/modules/standalonepublish/resources/menu_hover.png diff --git a/pype/standalonepublish/resources/menu_pressed.png b/pype/modules/standalonepublish/resources/menu_pressed.png similarity index 100% rename from pype/standalonepublish/resources/menu_pressed.png rename to pype/modules/standalonepublish/resources/menu_pressed.png diff --git a/pype/standalonepublish/resources/menu_pressed_hover.png b/pype/modules/standalonepublish/resources/menu_pressed_hover.png similarity index 100% rename from pype/standalonepublish/resources/menu_pressed_hover.png rename to pype/modules/standalonepublish/resources/menu_pressed_hover.png diff --git a/pype/standalonepublish/resources/nuke.png b/pype/modules/standalonepublish/resources/nuke.png similarity index 100% rename from pype/standalonepublish/resources/nuke.png rename to pype/modules/standalonepublish/resources/nuke.png diff --git a/pype/standalonepublish/resources/premiere.png b/pype/modules/standalonepublish/resources/premiere.png similarity index 100% rename from pype/standalonepublish/resources/premiere.png rename to pype/modules/standalonepublish/resources/premiere.png diff --git a/pype/standalonepublish/resources/trash.png b/pype/modules/standalonepublish/resources/trash.png similarity index 100% rename from pype/standalonepublish/resources/trash.png rename to pype/modules/standalonepublish/resources/trash.png diff --git a/pype/standalonepublish/resources/trash_disabled.png b/pype/modules/standalonepublish/resources/trash_disabled.png similarity index 100% rename from pype/standalonepublish/resources/trash_disabled.png rename to pype/modules/standalonepublish/resources/trash_disabled.png diff --git a/pype/standalonepublish/resources/trash_hover.png b/pype/modules/standalonepublish/resources/trash_hover.png similarity index 100% rename from pype/standalonepublish/resources/trash_hover.png rename to pype/modules/standalonepublish/resources/trash_hover.png diff --git a/pype/standalonepublish/resources/trash_pressed.png b/pype/modules/standalonepublish/resources/trash_pressed.png similarity index 100% rename from pype/standalonepublish/resources/trash_pressed.png rename to pype/modules/standalonepublish/resources/trash_pressed.png diff --git a/pype/standalonepublish/resources/trash_pressed_hover.png b/pype/modules/standalonepublish/resources/trash_pressed_hover.png similarity index 100% rename from pype/standalonepublish/resources/trash_pressed_hover.png rename to pype/modules/standalonepublish/resources/trash_pressed_hover.png diff --git a/pype/standalonepublish/resources/video_file.png b/pype/modules/standalonepublish/resources/video_file.png similarity index 100% rename from pype/standalonepublish/resources/video_file.png rename to pype/modules/standalonepublish/resources/video_file.png diff --git a/pype/standalonepublish/standalonepublish_module.py b/pype/modules/standalonepublish/standalonepublish_module.py similarity index 100% rename from pype/standalonepublish/standalonepublish_module.py rename to pype/modules/standalonepublish/standalonepublish_module.py diff --git a/pype/standalonepublish/widgets/__init__.py b/pype/modules/standalonepublish/widgets/__init__.py similarity index 100% rename from pype/standalonepublish/widgets/__init__.py rename to pype/modules/standalonepublish/widgets/__init__.py diff --git a/pype/standalonepublish/widgets/button_from_svgs.py b/pype/modules/standalonepublish/widgets/button_from_svgs.py similarity index 100% rename from pype/standalonepublish/widgets/button_from_svgs.py rename to pype/modules/standalonepublish/widgets/button_from_svgs.py diff --git a/pype/standalonepublish/widgets/model_asset.py b/pype/modules/standalonepublish/widgets/model_asset.py similarity index 100% rename from pype/standalonepublish/widgets/model_asset.py rename to pype/modules/standalonepublish/widgets/model_asset.py diff --git a/pype/standalonepublish/widgets/model_filter_proxy_exact_match.py b/pype/modules/standalonepublish/widgets/model_filter_proxy_exact_match.py similarity index 100% rename from pype/standalonepublish/widgets/model_filter_proxy_exact_match.py rename to pype/modules/standalonepublish/widgets/model_filter_proxy_exact_match.py diff --git a/pype/standalonepublish/widgets/model_filter_proxy_recursive_sort.py b/pype/modules/standalonepublish/widgets/model_filter_proxy_recursive_sort.py similarity index 100% rename from pype/standalonepublish/widgets/model_filter_proxy_recursive_sort.py rename to pype/modules/standalonepublish/widgets/model_filter_proxy_recursive_sort.py diff --git a/pype/standalonepublish/widgets/model_node.py b/pype/modules/standalonepublish/widgets/model_node.py similarity index 100% rename from pype/standalonepublish/widgets/model_node.py rename to pype/modules/standalonepublish/widgets/model_node.py diff --git a/pype/standalonepublish/widgets/model_tasks_template.py b/pype/modules/standalonepublish/widgets/model_tasks_template.py similarity index 100% rename from pype/standalonepublish/widgets/model_tasks_template.py rename to pype/modules/standalonepublish/widgets/model_tasks_template.py diff --git a/pype/standalonepublish/widgets/model_tree.py b/pype/modules/standalonepublish/widgets/model_tree.py similarity index 100% rename from pype/standalonepublish/widgets/model_tree.py rename to pype/modules/standalonepublish/widgets/model_tree.py diff --git a/pype/standalonepublish/widgets/model_tree_view_deselectable.py b/pype/modules/standalonepublish/widgets/model_tree_view_deselectable.py similarity index 100% rename from pype/standalonepublish/widgets/model_tree_view_deselectable.py rename to pype/modules/standalonepublish/widgets/model_tree_view_deselectable.py diff --git a/pype/standalonepublish/widgets/widget_asset.py b/pype/modules/standalonepublish/widgets/widget_asset.py similarity index 100% rename from pype/standalonepublish/widgets/widget_asset.py rename to pype/modules/standalonepublish/widgets/widget_asset.py diff --git a/pype/standalonepublish/widgets/widget_component_item.py b/pype/modules/standalonepublish/widgets/widget_component_item.py similarity index 100% rename from pype/standalonepublish/widgets/widget_component_item.py rename to pype/modules/standalonepublish/widgets/widget_component_item.py diff --git a/pype/standalonepublish/widgets/widget_components.py b/pype/modules/standalonepublish/widgets/widget_components.py similarity index 100% rename from pype/standalonepublish/widgets/widget_components.py rename to pype/modules/standalonepublish/widgets/widget_components.py diff --git a/pype/standalonepublish/widgets/widget_components_list.py b/pype/modules/standalonepublish/widgets/widget_components_list.py similarity index 100% rename from pype/standalonepublish/widgets/widget_components_list.py rename to pype/modules/standalonepublish/widgets/widget_components_list.py diff --git a/pype/standalonepublish/widgets/widget_drop_empty.py b/pype/modules/standalonepublish/widgets/widget_drop_empty.py similarity index 100% rename from pype/standalonepublish/widgets/widget_drop_empty.py rename to pype/modules/standalonepublish/widgets/widget_drop_empty.py diff --git a/pype/standalonepublish/widgets/widget_drop_frame.py b/pype/modules/standalonepublish/widgets/widget_drop_frame.py similarity index 99% rename from pype/standalonepublish/widgets/widget_drop_frame.py rename to pype/modules/standalonepublish/widgets/widget_drop_frame.py index c85105a333..80e67aa69a 100644 --- a/pype/standalonepublish/widgets/widget_drop_frame.py +++ b/pype/modules/standalonepublish/widgets/widget_drop_frame.py @@ -3,7 +3,7 @@ import re import json import clique import subprocess -from pypeapp import config +from pype.api import config import pype.lib from . import QtWidgets, QtCore from . import DropEmpty, ComponentsList, ComponentItem diff --git a/pype/standalonepublish/widgets/widget_family.py b/pype/modules/standalonepublish/widgets/widget_family.py similarity index 99% rename from pype/standalonepublish/widgets/widget_family.py rename to pype/modules/standalonepublish/widgets/widget_family.py index 19041a588b..29a0812a91 100644 --- a/pype/standalonepublish/widgets/widget_family.py +++ b/pype/modules/standalonepublish/widgets/widget_family.py @@ -8,7 +8,7 @@ from . import QtWidgets, QtCore from . import HelpRole, FamilyRole, ExistsRole, PluginRole, PluginKeyRole from . import FamilyDescriptionWidget -from pypeapp import config +from pype.api import config class FamilyWidget(QtWidgets.QWidget): diff --git a/pype/standalonepublish/widgets/widget_family_desc.py b/pype/modules/standalonepublish/widgets/widget_family_desc.py similarity index 100% rename from pype/standalonepublish/widgets/widget_family_desc.py rename to pype/modules/standalonepublish/widgets/widget_family_desc.py diff --git a/pype/standalonepublish/widgets/widget_shadow.py b/pype/modules/standalonepublish/widgets/widget_shadow.py similarity index 100% rename from pype/standalonepublish/widgets/widget_shadow.py rename to pype/modules/standalonepublish/widgets/widget_shadow.py diff --git a/pype/services/timers_manager/__init__.py b/pype/modules/timers_manager/__init__.py similarity index 100% rename from pype/services/timers_manager/__init__.py rename to pype/modules/timers_manager/__init__.py diff --git a/pype/services/timers_manager/timers_manager.py b/pype/modules/timers_manager/timers_manager.py similarity index 96% rename from pype/services/timers_manager/timers_manager.py rename to pype/modules/timers_manager/timers_manager.py index 2259dfc34d..cec730d007 100644 --- a/pype/services/timers_manager/timers_manager.py +++ b/pype/modules/timers_manager/timers_manager.py @@ -1,7 +1,6 @@ from Qt import QtCore from .widget_user_idle import WidgetUserIdle -from pypeapp.lib.config import get_presets -from pypeapp import Logger +from pype.api import Logger, config class Singleton(type): @@ -36,7 +35,12 @@ class TimersManager(metaclass=Singleton): def set_signal_times(self): try: - timer_info = get_presets()['services']['timers_manager']['timer'] + timer_info = ( + config.get_presets() + .get('services') + .get('timers_manager') + .get('timer') + ) full_time = int(float(timer_info['full_time'])*60) message_time = int(float(timer_info['message_time'])*60) self.time_show_message = full_time - message_time diff --git a/pype/services/timers_manager/widget_user_idle.py b/pype/modules/timers_manager/widget_user_idle.py similarity index 98% rename from pype/services/timers_manager/widget_user_idle.py rename to pype/modules/timers_manager/widget_user_idle.py index b65ffd40ba..f5efcec9bb 100644 --- a/pype/services/timers_manager/widget_user_idle.py +++ b/pype/modules/timers_manager/widget_user_idle.py @@ -1,4 +1,5 @@ -from pypeapp import style, Logger +from pype.api import Logger +from pypeapp import style from Qt import QtCore, QtGui, QtWidgets diff --git a/pype/user/__init__.py b/pype/modules/user/__init__.py similarity index 100% rename from pype/user/__init__.py rename to pype/modules/user/__init__.py diff --git a/pype/user/user_module.py b/pype/modules/user/user_module.py similarity index 98% rename from pype/user/user_module.py rename to pype/modules/user/user_module.py index 46ceb0031f..f2de9dc2fb 100644 --- a/pype/user/user_module.py +++ b/pype/modules/user/user_module.py @@ -6,7 +6,7 @@ import appdirs from Qt import QtWidgets from .widget_user import UserWidget -from pype import api as pype +from pype.api import Logger class UserModule: @@ -16,7 +16,7 @@ class UserModule: cred_filename = 'user_info.json' env_name = "PYPE_USERNAME" - log = pype.Logger().get_logger("UserModule", "user") + log = Logger().get_logger("UserModule", "user") def __init__(self, main_parent=None, parent=None): self._callbacks_on_user_change = [] diff --git a/pype/user/widget_user.py b/pype/modules/user/widget_user.py similarity index 100% rename from pype/user/widget_user.py rename to pype/modules/user/widget_user.py diff --git a/pype/plugin.py b/pype/plugin.py index cbe8ba47d7..a169e82beb 100644 --- a/pype/plugin.py +++ b/pype/plugin.py @@ -2,7 +2,7 @@ import tempfile import os import pyblish.api -from pypeapp import config +from pype.api import config import inspect ValidatePipelineOrder = pyblish.api.ValidatorOrder + 0.05 diff --git a/pype/plugins/adobecommunicator/publish/extract_post_json.py b/pype/plugins/adobecommunicator/publish/extract_post_json.py index c545e47475..8ea64531a9 100644 --- a/pype/plugins/adobecommunicator/publish/extract_post_json.py +++ b/pype/plugins/adobecommunicator/publish/extract_post_json.py @@ -2,7 +2,7 @@ import json import clique import pyblish.api -from pypeapp import Anatomy +from pype.api import Anatomy class ExtractJSON(pyblish.api.ContextPlugin): """ Extract all instances to a serialized json file. """ diff --git a/pype/plugins/blender/create/create_action.py b/pype/plugins/blender/create/create_action.py index 68e2a50b61..f5273863c4 100644 --- a/pype/plugins/blender/create/create_action.py +++ b/pype/plugins/blender/create/create_action.py @@ -4,7 +4,7 @@ import bpy from avalon import api from avalon.blender import Creator, lib -import pype.blender.plugin +import pype.hosts.blender.plugin class CreateAction(Creator): @@ -19,7 +19,7 @@ class CreateAction(Creator): asset = self.data["asset"] subset = self.data["subset"] - name = pype.blender.plugin.asset_name(asset, subset) + name = pype.hosts.blender.plugin.asset_name(asset, subset) collection = bpy.data.collections.new(name=name) bpy.context.scene.collection.children.link(collection) self.data['task'] = api.Session.get('AVALON_TASK') diff --git a/pype/plugins/blender/create/create_animation.py b/pype/plugins/blender/create/create_animation.py index 3a5985d7a2..de74f9a358 100644 --- a/pype/plugins/blender/create/create_animation.py +++ b/pype/plugins/blender/create/create_animation.py @@ -4,7 +4,7 @@ import bpy from avalon import api from avalon.blender import Creator, lib -import pype.blender.plugin +import pype.hosts.blender.plugin class CreateAnimation(Creator): @@ -19,7 +19,7 @@ class CreateAnimation(Creator): asset = self.data["asset"] subset = self.data["subset"] - name = pype.blender.plugin.asset_name(asset, subset) + name = pype.hosts.blender.plugin.asset_name(asset, subset) collection = bpy.data.collections.new(name=name) bpy.context.scene.collection.children.link(collection) self.data['task'] = api.Session.get('AVALON_TASK') diff --git a/pype/plugins/blender/create/create_model.py b/pype/plugins/blender/create/create_model.py index 303a7a63a1..59905edc41 100644 --- a/pype/plugins/blender/create/create_model.py +++ b/pype/plugins/blender/create/create_model.py @@ -4,7 +4,7 @@ import bpy from avalon import api from avalon.blender import Creator, lib -import pype.blender.plugin +import pype.hosts.blender.plugin class CreateModel(Creator): @@ -19,7 +19,7 @@ class CreateModel(Creator): asset = self.data["asset"] subset = self.data["subset"] - name = pype.blender.plugin.asset_name(asset, subset) + name = pype.hosts.blender.plugin.asset_name(asset, subset) collection = bpy.data.collections.new(name=name) bpy.context.scene.collection.children.link(collection) self.data['task'] = api.Session.get('AVALON_TASK') diff --git a/pype/plugins/blender/create/create_rig.py b/pype/plugins/blender/create/create_rig.py index dc97d8b4ce..855c2ab461 100644 --- a/pype/plugins/blender/create/create_rig.py +++ b/pype/plugins/blender/create/create_rig.py @@ -4,7 +4,7 @@ import bpy from avalon import api from avalon.blender import Creator, lib -import pype.blender.plugin +import pype.hosts.blender.plugin class CreateRig(Creator): @@ -19,7 +19,7 @@ class CreateRig(Creator): asset = self.data["asset"] subset = self.data["subset"] - name = pype.blender.plugin.asset_name(asset, subset) + name = pype.hosts.blender.plugin.asset_name(asset, subset) collection = bpy.data.collections.new(name=name) bpy.context.scene.collection.children.link(collection) self.data['task'] = api.Session.get('AVALON_TASK') diff --git a/pype/plugins/blender/load/load_action.py b/pype/plugins/blender/load/load_action.py index a1b1ad3cea..d94bd9aac6 100644 --- a/pype/plugins/blender/load/load_action.py +++ b/pype/plugins/blender/load/load_action.py @@ -7,12 +7,12 @@ from typing import Dict, List, Optional from avalon import api, blender import bpy -import pype.blender.plugin +import pype.hosts.blender.plugin logger = logging.getLogger("pype").getChild("blender").getChild("load_action") -class BlendActionLoader(pype.blender.plugin.AssetLoader): +class BlendActionLoader(pype.hosts.blender.plugin.AssetLoader): """Load action from a .blend file. Warning: @@ -42,8 +42,8 @@ class BlendActionLoader(pype.blender.plugin.AssetLoader): libpath = self.fname asset = context["asset"]["name"] subset = context["subset"]["name"] - lib_container = pype.blender.plugin.asset_name(asset, subset) - container_name = pype.blender.plugin.asset_name( + lib_container = pype.hosts.blender.plugin.asset_name(asset, subset) + container_name = pype.hosts.blender.plugin.asset_name( asset, subset, namespace ) @@ -149,7 +149,7 @@ class BlendActionLoader(pype.blender.plugin.AssetLoader): assert libpath.is_file(), ( f"The file doesn't exist: {libpath}" ) - assert extension in pype.blender.plugin.VALID_EXTENSIONS, ( + assert extension in pype.hosts.blender.plugin.VALID_EXTENSIONS, ( f"Unsupported file: {libpath}" ) diff --git a/pype/plugins/blender/load/load_animation.py b/pype/plugins/blender/load/load_animation.py index 395684a3ba..a26f402d47 100644 --- a/pype/plugins/blender/load/load_animation.py +++ b/pype/plugins/blender/load/load_animation.py @@ -7,14 +7,14 @@ from typing import Dict, List, Optional from avalon import api, blender import bpy -import pype.blender.plugin +import pype.hosts.blender.plugin logger = logging.getLogger("pype").getChild( "blender").getChild("load_animation") -class BlendAnimationLoader(pype.blender.plugin.AssetLoader): +class BlendAnimationLoader(pype.hosts.blender.plugin.AssetLoader): """Load animations from a .blend file. Warning: @@ -109,8 +109,8 @@ class BlendAnimationLoader(pype.blender.plugin.AssetLoader): libpath = self.fname asset = context["asset"]["name"] subset = context["subset"]["name"] - lib_container = pype.blender.plugin.asset_name(asset, subset) - container_name = pype.blender.plugin.asset_name( + lib_container = pype.hosts.blender.plugin.asset_name(asset, subset) + container_name = pype.hosts.blender.plugin.asset_name( asset, subset, namespace ) @@ -179,7 +179,7 @@ class BlendAnimationLoader(pype.blender.plugin.AssetLoader): assert libpath.is_file(), ( f"The file doesn't exist: {libpath}" ) - assert extension in pype.blender.plugin.VALID_EXTENSIONS, ( + assert extension in pype.hosts.blender.plugin.VALID_EXTENSIONS, ( f"Unsupported file: {libpath}" ) diff --git a/pype/plugins/blender/load/load_model.py b/pype/plugins/blender/load/load_model.py index ff7c6c49c2..2abc4175c6 100644 --- a/pype/plugins/blender/load/load_model.py +++ b/pype/plugins/blender/load/load_model.py @@ -7,12 +7,12 @@ from typing import Dict, List, Optional from avalon import api, blender import bpy -import pype.blender.plugin +import pype.hosts.blender.plugin logger = logging.getLogger("pype").getChild("blender").getChild("load_model") -class BlendModelLoader(pype.blender.plugin.AssetLoader): +class BlendModelLoader(pype.hosts.blender.plugin.AssetLoader): """Load models from a .blend file. Because they come from a .blend file we can simply link the collection that @@ -96,8 +96,8 @@ class BlendModelLoader(pype.blender.plugin.AssetLoader): libpath = self.fname asset = context["asset"]["name"] subset = context["subset"]["name"] - lib_container = pype.blender.plugin.asset_name(asset, subset) - container_name = pype.blender.plugin.asset_name( + lib_container = pype.hosts.blender.plugin.asset_name(asset, subset) + container_name = pype.hosts.blender.plugin.asset_name( asset, subset, namespace ) @@ -164,7 +164,7 @@ class BlendModelLoader(pype.blender.plugin.AssetLoader): assert libpath.is_file(), ( f"The file doesn't exist: {libpath}" ) - assert extension in pype.blender.plugin.VALID_EXTENSIONS, ( + assert extension in pype.hosts.blender.plugin.VALID_EXTENSIONS, ( f"Unsupported file: {libpath}" ) @@ -233,7 +233,7 @@ class BlendModelLoader(pype.blender.plugin.AssetLoader): return True -class CacheModelLoader(pype.blender.plugin.AssetLoader): +class CacheModelLoader(pype.hosts.blender.plugin.AssetLoader): """Load cache models. Stores the imported asset in a collection named after the asset. @@ -269,7 +269,7 @@ class CacheModelLoader(pype.blender.plugin.AssetLoader): subset = context["subset"]["name"] # TODO (jasper): evaluate use of namespace which is 'alien' to Blender. lib_container = container_name = ( - pype.blender.plugin.asset_name(asset, subset, namespace) + pype.hosts.blender.plugin.asset_name(asset, subset, namespace) ) relative = bpy.context.preferences.filepaths.use_relative_paths diff --git a/pype/plugins/blender/load/load_rig.py b/pype/plugins/blender/load/load_rig.py index d14a868722..634a627a4a 100644 --- a/pype/plugins/blender/load/load_rig.py +++ b/pype/plugins/blender/load/load_rig.py @@ -7,12 +7,12 @@ from typing import Dict, List, Optional from avalon import api, blender import bpy -import pype.blender.plugin +import pype.hosts.blender.plugin logger = logging.getLogger("pype").getChild("blender").getChild("load_model") -class BlendRigLoader(pype.blender.plugin.AssetLoader): +class BlendRigLoader(pype.hosts.blender.plugin.AssetLoader): """Load rigs from a .blend file. Because they come from a .blend file we can simply link the collection that @@ -108,8 +108,8 @@ class BlendRigLoader(pype.blender.plugin.AssetLoader): libpath = self.fname asset = context["asset"]["name"] subset = context["subset"]["name"] - lib_container = pype.blender.plugin.asset_name(asset, subset) - container_name = pype.blender.plugin.asset_name( + lib_container = pype.hosts.blender.plugin.asset_name(asset, subset) + container_name = pype.hosts.blender.plugin.asset_name( asset, subset, namespace ) @@ -178,7 +178,7 @@ class BlendRigLoader(pype.blender.plugin.AssetLoader): assert libpath.is_file(), ( f"The file doesn't exist: {libpath}" ) - assert extension in pype.blender.plugin.VALID_EXTENSIONS, ( + assert extension in pype.hosts.blender.plugin.VALID_EXTENSIONS, ( f"Unsupported file: {libpath}" ) diff --git a/pype/plugins/blender/publish/extract_abc.py b/pype/plugins/blender/publish/extract_abc.py index d2c0c769ae..41c9c268f7 100644 --- a/pype/plugins/blender/publish/extract_abc.py +++ b/pype/plugins/blender/publish/extract_abc.py @@ -1,7 +1,7 @@ import os import pype.api -import pype.blender.plugin +import pype.hosts.blender.plugin import bpy @@ -61,7 +61,7 @@ class ExtractABC(pype.api.Extractor): except: continue - new_context = pype.blender.plugin.create_blender_context(active=selected[0], selected=selected) + new_context = pype.hosts.blender.plugin.create_blender_context(active=selected[0], selected=selected) # We set the scale of the scene for the export scene.unit_settings.scale_length = 0.01 diff --git a/pype/plugins/blender/publish/validate_mesh_has_uv.py b/pype/plugins/blender/publish/validate_mesh_has_uv.py index d0cd33645b..ea5e12918a 100644 --- a/pype/plugins/blender/publish/validate_mesh_has_uv.py +++ b/pype/plugins/blender/publish/validate_mesh_has_uv.py @@ -3,7 +3,7 @@ from typing import List import bpy import pyblish.api -import pype.blender.action +import pype.hosts.blender.action class ValidateMeshHasUvs(pyblish.api.InstancePlugin): @@ -14,7 +14,7 @@ class ValidateMeshHasUvs(pyblish.api.InstancePlugin): families = ["model"] category = "geometry" label = "Mesh Has UV's" - actions = [pype.blender.action.SelectInvalidAction] + actions = [pype.hosts.blender.action.SelectInvalidAction] optional = True @staticmethod diff --git a/pype/plugins/blender/publish/validate_mesh_no_negative_scale.py b/pype/plugins/blender/publish/validate_mesh_no_negative_scale.py index 7e3b38dd19..77057c0e68 100644 --- a/pype/plugins/blender/publish/validate_mesh_no_negative_scale.py +++ b/pype/plugins/blender/publish/validate_mesh_no_negative_scale.py @@ -3,7 +3,7 @@ from typing import List import bpy import pyblish.api -import pype.blender.action +import pype.hosts.blender.action class ValidateMeshNoNegativeScale(pyblish.api.Validator): @@ -13,7 +13,7 @@ class ValidateMeshNoNegativeScale(pyblish.api.Validator): hosts = ["blender"] families = ["model"] label = "Mesh No Negative Scale" - actions = [pype.blender.action.SelectInvalidAction] + actions = [pype.hosts.blender.action.SelectInvalidAction] @staticmethod def get_invalid(instance) -> List: diff --git a/pype/plugins/fusion/load/actions.py b/pype/plugins/fusion/load/actions.py index 481c95387f..0c86fdaad2 100644 --- a/pype/plugins/fusion/load/actions.py +++ b/pype/plugins/fusion/load/actions.py @@ -22,7 +22,7 @@ class FusionSetFrameRangeLoader(api.Loader): def load(self, context, name, namespace, data): - from pype.fusion import lib + from pype.hosts.fusion import lib version = context['version'] version_data = version.get("data", {}) @@ -55,7 +55,7 @@ class FusionSetFrameRangeWithHandlesLoader(api.Loader): def load(self, context, name, namespace, data): - from pype.fusion import lib + from pype.hosts.fusion import lib version = context['version'] version_data = version.get("data", {}) diff --git a/pype/plugins/global/load/open_djv.py b/pype/plugins/global/load/open_djv.py index 754f583a56..650936a4dc 100644 --- a/pype/plugins/global/load/open_djv.py +++ b/pype/plugins/global/load/open_djv.py @@ -1,7 +1,7 @@ import os import subprocess import json -from pypeapp import config +from pype.api import config from avalon import api diff --git a/pype/plugins/global/publish/cleanup.py b/pype/plugins/global/publish/cleanup.py index 6f761ca83c..3ab41f90ca 100644 --- a/pype/plugins/global/publish/cleanup.py +++ b/pype/plugins/global/publish/cleanup.py @@ -46,8 +46,14 @@ class CleanUp(pyblish.api.InstancePlugin): if (result["error"] is not None and result["instance"] is not None and result["instance"] not in failed): failed.append(result["instance"]) - assert instance not in failed, ("Result of '{}' instance " - "were not success".format(instance.data["name"])) + assert instance not in failed, ( + "Result of '{}' instance were not success".format( + instance.data["name"] + ) + ) + + self.log.info("Cleaning renders ...") + clean_renders(instance) if [ef for ef in self.exclude_families if instance.data["family"] in ef]: @@ -65,7 +71,5 @@ class CleanUp(pyblish.api.InstancePlugin): "temp folder: %s" % staging_dir) return - self.log.info("Removing temporary folder ...") + self.log.info("Removing staging directory ...") shutil.rmtree(staging_dir) - self.log.info("Cleaning renders ...") - clean_renders(instance) diff --git a/pype/plugins/global/publish/collect_anatomy_object.py b/pype/plugins/global/publish/collect_anatomy_object.py index 8c01ea5c44..17f6e16962 100644 --- a/pype/plugins/global/publish/collect_anatomy_object.py +++ b/pype/plugins/global/publish/collect_anatomy_object.py @@ -4,10 +4,10 @@ Requires: os.environ -> AVALON_PROJECT Provides: - context -> anatomy (pypeapp.Anatomy) + context -> anatomy (pype.api.Anatomy) """ import os -from pypeapp import Anatomy +from pype.api import Anatomy import pyblish.api diff --git a/pype/plugins/global/publish/collect_datetime_data.py b/pype/plugins/global/publish/collect_datetime_data.py index f04f924e18..1ad1f22a02 100644 --- a/pype/plugins/global/publish/collect_datetime_data.py +++ b/pype/plugins/global/publish/collect_datetime_data.py @@ -5,7 +5,7 @@ Provides: """ import pyblish.api -from pypeapp import config +from pype.api import config class CollectDateTimeData(pyblish.api.ContextPlugin): diff --git a/pype/plugins/global/publish/collect_output_repre_config.py b/pype/plugins/global/publish/collect_output_repre_config.py index 73ab050bcf..063af9ba26 100644 --- a/pype/plugins/global/publish/collect_output_repre_config.py +++ b/pype/plugins/global/publish/collect_output_repre_config.py @@ -7,7 +7,7 @@ Provides: """ import pyblish.api -from pypeapp import config +from pype.api import config class CollectOutputRepreConfig(pyblish.api.ContextPlugin): diff --git a/pype/plugins/global/publish/collect_presets.py b/pype/plugins/global/publish/collect_presets.py index 5e79c555e2..4ffb2fc0b3 100644 --- a/pype/plugins/global/publish/collect_presets.py +++ b/pype/plugins/global/publish/collect_presets.py @@ -8,7 +8,7 @@ Provides: """ from pyblish import api -from pypeapp import config +from pype.api import config class CollectPresets(api.ContextPlugin): diff --git a/pype/plugins/global/publish/extract_burnin.py b/pype/plugins/global/publish/extract_burnin.py index 2eac38bac8..83ad4af1c2 100644 --- a/pype/plugins/global/publish/extract_burnin.py +++ b/pype/plugins/global/publish/extract_burnin.py @@ -58,7 +58,7 @@ class ExtractBurnin(pype.api.Extractor): if "representations" not in instance.data: raise RuntimeError("Burnin needs already created mov to work on.") - if self.profiles is None: + if self.use_legacy_code(instance): return self.legacy_process(instance) self.main_process(instance) @@ -71,6 +71,12 @@ class ExtractBurnin(pype.api.Extractor): self.log.debug(instance.data["representations"]) + def use_legacy_code(self, instance): + presets = instance.context.data.get("presets") + if presets is None and self.profiles is None: + return True + return "burnins" in (presets.get("tools") or {}) + def main_process(self, instance): # TODO get these data from context host_name = os.environ["AVALON_APP"] @@ -830,7 +836,7 @@ class ExtractBurnin(pype.api.Extractor): for i, repre in enumerate(instance.data["representations"]): self.log.debug("__ i: `{}`, repre: `{}`".format(i, repre)) - if "multipartExr" in repre.get("tags", []): + if instance.data.get("multipartExr") is True: # ffmpeg doesn't support multipart exrs continue diff --git a/pype/plugins/global/publish/extract_jpeg.py b/pype/plugins/global/publish/extract_jpeg.py index 40e086db99..2931bb5835 100644 --- a/pype/plugins/global/publish/extract_jpeg.py +++ b/pype/plugins/global/publish/extract_jpeg.py @@ -36,7 +36,7 @@ class ExtractJpegEXR(pyblish.api.InstancePlugin): if not isinstance(repre['files'], list): continue - if "multipartExr" in tags: + if instance.data.get("multipartExr") is True: # ffmpeg doesn't support multipart exrs continue diff --git a/pype/plugins/global/publish/extract_review.py b/pype/plugins/global/publish/extract_review.py index 228b4cd6f4..0690d5cf80 100644 --- a/pype/plugins/global/publish/extract_review.py +++ b/pype/plugins/global/publish/extract_review.py @@ -22,7 +22,7 @@ class ExtractReview(pyblish.api.InstancePlugin): label = "Extract Review" order = pyblish.api.ExtractorOrder + 0.02 families = ["review"] - hosts = ["nuke", "maya", "shell", "nukestudio", "premiere"] + hosts = ["nuke", "maya", "shell", "nukestudio", "premiere", "harmony"] # Supported extensions image_exts = ["exr", "jpg", "jpeg", "png", "dpx"] @@ -1131,7 +1131,7 @@ class ExtractReview(pyblish.api.InstancePlugin): tags = repre.get("tags", []) - if instance.data.get("multipartExr") is True: + if inst_data.get("multipartExr") is True: # ffmpeg doesn't support multipart exrs continue diff --git a/pype/plugins/global/publish/integrate_new.py b/pype/plugins/global/publish/integrate_new.py index bd908901cc..adff8aa3fa 100644 --- a/pype/plugins/global/publish/integrate_new.py +++ b/pype/plugins/global/publish/integrate_new.py @@ -9,7 +9,7 @@ import six from pymongo import DeleteOne, InsertOne import pyblish.api -from avalon import api, io +from avalon import io from avalon.vendor import filelink # this is needed until speedcopy for linux is fixed @@ -44,6 +44,7 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin): "frameStart" "frameEnd" 'fps' + "data": additional metadata for each representation. """ label = "Integrate Asset New" @@ -81,7 +82,8 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin): "assembly", "fbx", "textures", - "action" + "action", + "harmony.template" ] exclude_families = ["clip"] db_representation_context_keys = [ @@ -375,9 +377,10 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin): index_frame_start += 1 dst = "{0}{1}{2}".format( - dst_head, - dst_padding, - dst_tail).replace("..", ".") + dst_head, + dst_padding, + dst_tail + ).replace("..", ".") self.log.debug("destination: `{}`".format(dst)) src = os.path.join(stagingdir, src_file_name) @@ -450,13 +453,15 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin): if repre_id is None: repre_id = io.ObjectId() + data = repre.get("data") or {} + data.update({'path': dst, 'template': template}) representation = { "_id": repre_id, "schema": "pype:representation-2.0", "type": "representation", "parent": version_id, "name": repre['name'], - "data": {'path': dst, 'template': template}, + "data": data, "dependencies": instance.data.get("dependencies", "").split(), # Imprint shortcut to context diff --git a/pype/plugins/global/publish/validate_version.py b/pype/plugins/global/publish/validate_version.py index 4585e5a008..9c7ce72307 100644 --- a/pype/plugins/global/publish/validate_version.py +++ b/pype/plugins/global/publish/validate_version.py @@ -17,9 +17,9 @@ class ValidateVersion(pyblish.api.InstancePlugin): latest_version = instance.data.get("latestVersion") if latest_version is not None: - msg = ("Version `{0}` that you are" - " trying to publish, already" - " exists in the" - " database.").format( - version, latest_version) + msg = ( + "Version `{0}` that you are trying to publish, already exists" + " in the database. Version in database: `{1}`. Please version " + "up your workfile to a higher version number than: `{1}`." + ).format(version, latest_version) assert (int(version) > int(latest_version)), msg diff --git a/pype/plugins/harmony/create/create_render.py b/pype/plugins/harmony/create/create_render.py new file mode 100644 index 0000000000..493c585a09 --- /dev/null +++ b/pype/plugins/harmony/create/create_render.py @@ -0,0 +1,25 @@ +from avalon import harmony + + +class CreateRender(harmony.Creator): + """Composite node for publishing renders.""" + + name = "renderDefault" + label = "Render" + family = "render" + node_type = "WRITE" + + def __init__(self, *args, **kwargs): + super(CreateRender, self).__init__(*args, **kwargs) + + def setup_node(self, node): + func = """function func(args) + { + node.setTextAttr(args[0], "DRAWING_TYPE", 1, "PNG4"); + node.setTextAttr(args[0], "DRAWING_NAME", 1, args[1]); + node.setTextAttr(args[0], "MOVIE_PATH", 1, args[1]); + } + func + """ + path = "{0}/{0}".format(node.split("/")[-1]) + harmony.send({"function": func, "args": [node, path]}) diff --git a/pype/plugins/harmony/create/create_template.py b/pype/plugins/harmony/create/create_template.py new file mode 100644 index 0000000000..babc3fe8d7 --- /dev/null +++ b/pype/plugins/harmony/create/create_template.py @@ -0,0 +1,12 @@ +from avalon import harmony + + +class CreateTemplate(harmony.Creator): + """Composite node for publishing to templates.""" + + name = "templateDefault" + label = "Template" + family = "harmony.template" + + def __init__(self, *args, **kwargs): + super(CreateTemplate, self).__init__(*args, **kwargs) diff --git a/pype/plugins/harmony/load/load_template.py b/pype/plugins/harmony/load/load_template.py new file mode 100644 index 0000000000..53e0ff1f07 --- /dev/null +++ b/pype/plugins/harmony/load/load_template.py @@ -0,0 +1,61 @@ +import tempfile +import zipfile +import os +import shutil + +from avalon import api, harmony + + +class ImportTemplateLoader(api.Loader): + """Import templates.""" + + families = ["harmony.template"] + representations = ["*"] + label = "Import Template" + + def load(self, context, name=None, namespace=None, data=None): + # Make backdrops from metadata. + backdrops = context["representation"]["data"].get("backdrops", []) + + func = """function func(args) + { + Backdrop.addBackdrop("Top", args[0]); + } + func + """ + for backdrop in backdrops: + harmony.send({"function": func, "args": [backdrop]}) + + # Import template. + temp_dir = tempfile.mkdtemp() + zip_file = api.get_representation_path(context["representation"]) + template_path = os.path.join(temp_dir, "temp.tpl") + with zipfile.ZipFile(zip_file, "r") as zip_ref: + zip_ref.extractall(template_path) + + func = """function func(args) + { + var template_path = args[0]; + var drag_object = copyPaste.copyFromTemplate( + template_path, 0, 0, copyPaste.getCurrentCreateOptions() + ); + copyPaste.pasteNewNodes( + drag_object, "", copyPaste.getCurrentPasteOptions() + ); + } + func + """ + + func = """function func(args) + { + var template_path = args[0]; + var drag_object = copyPaste.pasteTemplateIntoGroup( + template_path, "Top", 1 + ); + } + func + """ + + harmony.send({"function": func, "args": [template_path]}) + + shutil.rmtree(temp_dir) diff --git a/pype/plugins/harmony/publish/collect_current_file.py b/pype/plugins/harmony/publish/collect_current_file.py new file mode 100644 index 0000000000..aab66c2b62 --- /dev/null +++ b/pype/plugins/harmony/publish/collect_current_file.py @@ -0,0 +1,27 @@ +import os + +import pyblish.api +from avalon import harmony + + +class CollectCurrentFile(pyblish.api.ContextPlugin): + """Inject the current working file into context""" + + order = pyblish.api.CollectorOrder - 0.5 + label = "Current File" + hosts = ["harmony"] + + def process(self, context): + """Inject the current working file""" + func = """function func() + { + return ( + scene.currentProjectPath() + "/" + + scene.currentVersionName() + ".xstage" + ); + } + func + """ + + current_file = harmony.send({"function": func})["result"] + context.data["currentFile"] = os.path.normpath(current_file) diff --git a/pype/plugins/harmony/publish/collect_instances.py b/pype/plugins/harmony/publish/collect_instances.py new file mode 100644 index 0000000000..8769ac80cc --- /dev/null +++ b/pype/plugins/harmony/publish/collect_instances.py @@ -0,0 +1,55 @@ +import json + +import pyblish.api +from avalon import harmony + + +class CollectInstances(pyblish.api.ContextPlugin): + """Gather instances by nodes metadata. + + This collector takes into account assets that are associated with + a composite node and marked with a unique identifier; + + Identifier: + id (str): "pyblish.avalon.instance" + """ + + label = "Instances" + order = pyblish.api.CollectorOrder + hosts = ["harmony"] + families_mapping = { + "render": ["imagesequence", "review", "ftrack"], + "harmony.template": [] + } + + def process(self, context): + nodes = harmony.send( + {"function": "node.subNodes", "args": ["Top"]} + )["result"] + + for node in nodes: + data = harmony.read(node) + + # Skip non-tagged nodes. + if not data: + continue + + # Skip containers. + if "container" in data["id"]: + continue + + instance = context.create_instance(node.split("/")[-1]) + instance.append(node) + instance.data.update(data) + instance.data["publish"] = harmony.send( + {"function": "node.getEnable", "args": [node]} + )["result"] + instance.data["families"] = self.families_mapping[data["family"]] + + # Produce diagnostic message for any graphical + # user interface interested in visualising it. + self.log.info( + "Found: \"{0}\": \n{1}".format( + instance.data["name"], json.dumps(instance.data, indent=4) + ) + ) diff --git a/pype/plugins/harmony/publish/extract_render.py b/pype/plugins/harmony/publish/extract_render.py new file mode 100644 index 0000000000..de6e8b9008 --- /dev/null +++ b/pype/plugins/harmony/publish/extract_render.py @@ -0,0 +1,100 @@ +import os +import tempfile + +import pyblish.api +from avalon import harmony +import pype.lib + +import clique + + +class ExtractRender(pyblish.api.InstancePlugin): + """Produce a flattened image file from instance. + This plug-in only takes into account the nodes connected to the composite. + """ + + label = "Extract Render" + order = pyblish.api.ExtractorOrder + hosts = ["harmony"] + families = ["render"] + + def process(self, instance): + # Collect scene data. + func = """function func(write_node) + { + return [ + about.getApplicationPath(), + scene.currentProjectPath(), + scene.currentScene(), + scene.getFrameRate(), + scene.getStartFrame(), + scene.getStopFrame() + ] + } + func + """ + result = harmony.send( + {"function": func, "args": [instance[0]]} + )["result"] + application_path = result[0] + project_path = result[1] + scene_path = os.path.join(result[1], result[2] + ".xstage") + frame_rate = result[3] + frame_start = result[4] + frame_end = result[5] + + # Set output path to temp folder. + path = tempfile.mkdtemp() + func = """function func(args) + { + node.setTextAttr(args[0], "DRAWING_NAME", 1, args[1]); + } + func + """ + result = harmony.send( + { + "function": func, + "args": [instance[0], path + "/" + instance.data["name"]] + } + ) + harmony.save_scene() + + # Execute rendering. + output = pype.lib._subprocess([application_path, "-batch", scene_path]) + self.log.info(output) + + # Collect rendered files. + files = os.listdir(path) + collections, remainder = clique.assemble(files, minimum_items=1) + assert not remainder, ( + "There should not be a remainder for {0}: {1}".format( + instance[0], remainder + ) + ) + assert len(collections) == 1, ( + "There should only be one image sequence in {}. Found: {}".format( + path, len(collections) + ) + ) + + extension = os.path.splitext(list(collections[0])[0])[-1][1:] + representation = { + "name": extension, + "ext": extension, + "files": list(collections[0]), + "stagingDir": path, + "frameStart": frame_start, + "frameEnd": frame_end, + "fps": frame_rate, + "preview": True, + "tags": ["review"] + } + instance.data["representations"] = [representation] + self.log.info(frame_rate) + + # Required for extract_review plugin (L222 onwards). + instance.data["frameStart"] = frame_start + instance.data["frameEnd"] = frame_end + instance.data["fps"] = frame_rate + + self.log.info("Extracted {instance} to {path}".format(**locals())) diff --git a/pype/plugins/harmony/publish/extract_template.py b/pype/plugins/harmony/publish/extract_template.py new file mode 100644 index 0000000000..f7a5e34e67 --- /dev/null +++ b/pype/plugins/harmony/publish/extract_template.py @@ -0,0 +1,166 @@ +import os +import shutil + +import pype.api +from avalon import harmony + + +class ExtractTemplate(pype.api.Extractor): + """Extract the connected nodes to the composite instance.""" + + label = "Extract Template" + hosts = ["harmony"] + families = ["harmony.template"] + + def process(self, instance): + staging_dir = self.staging_dir(instance) + + self.log.info("Outputting template to {}".format(staging_dir)) + + dependencies = [] + self.get_dependencies(instance[0], dependencies) + + # Get backdrops. + backdrops = {} + for dependency in dependencies: + for backdrop in self.get_backdrops(dependency): + backdrops[backdrop["title"]["text"]] = backdrop + unique_backdrops = [backdrops[x] for x in set(backdrops.keys())] + + # Get non-connected nodes within backdrops. + all_nodes = harmony.send( + {"function": "node.subNodes", "args": ["Top"]} + )["result"] + for node in [x for x in all_nodes if x not in dependencies]: + within_unique_backdrops = bool( + [x for x in self.get_backdrops(node) if x in unique_backdrops] + ) + if within_unique_backdrops: + dependencies.append(node) + + # Make sure we dont export the instance node. + if instance[0] in dependencies: + dependencies.remove(instance[0]) + + # Export template. + func = """function func(args) + { + // Add an extra node just so a new group can be created. + var temp_node = node.add("Top", "temp_note", "NOTE", 0, 0, 0); + var template_group = node.createGroup(temp_node, "temp_group"); + node.deleteNode( template_group + "/temp_note" ); + + // This will make Node View to focus on the new group. + selection.clearSelection(); + selection.addNodeToSelection(template_group); + Action.perform("onActionEnterGroup()", "Node View"); + + // Recreate backdrops in group. + for (var i = 0 ; i < args[0].length; i++) + { + Backdrop.addBackdrop(template_group, args[0][i]); + }; + + // Copy-paste the selected nodes into the new group. + var drag_object = copyPaste.copy(args[1], 1, frame.numberOf, ""); + copyPaste.pasteNewNodes(drag_object, template_group, ""); + + // Select all nodes within group and export as template. + Action.perform( "selectAll()", "Node View" ); + copyPaste.createTemplateFromSelection(args[2], args[3]); + + // Unfocus the group in Node view, delete all nodes and backdrops + // created during the process. + Action.perform("onActionUpToParent()", "Node View"); + node.deleteNode(template_group, true, true); + } + func + """ + harmony.send({ + "function": func, + "args": [ + unique_backdrops, + dependencies, + "{}.tpl".format(instance.name), + staging_dir + ] + }) + + # Prep representation. + os.chdir(staging_dir) + shutil.make_archive( + "{}".format(instance.name), + "zip", + os.path.join(staging_dir, "{}.tpl".format(instance.name)) + ) + + representation = { + "name": "tpl", + "ext": "zip", + "files": "{}.zip".format(instance.name), + "stagingDir": staging_dir + } + instance.data["representations"] = [representation] + + def get_backdrops(self, node): + func = """function func(probe_node) + { + var backdrops = Backdrop.backdrops("Top"); + var valid_backdrops = []; + for(var i=0; i', re.IGNORECASE) diff --git a/pype/plugins/maya/publish/validate_renderlayer_aovs.py b/pype/plugins/maya/publish/validate_renderlayer_aovs.py index 686a11e906..aba8fdaa96 100644 --- a/pype/plugins/maya/publish/validate_renderlayer_aovs.py +++ b/pype/plugins/maya/publish/validate_renderlayer_aovs.py @@ -1,6 +1,6 @@ import pyblish.api -import pype.maya.action +import pype.hosts.maya.action from avalon import io import pype.api @@ -25,7 +25,7 @@ class ValidateRenderLayerAOVs(pyblish.api.InstancePlugin): label = "Render Passes / AOVs Are Registered" hosts = ["maya"] families = ["renderlayer"] - actions = [pype.maya.action.SelectInvalidAction] + actions = [pype.hosts.maya.action.SelectInvalidAction] def process(self, instance): invalid = self.get_invalid(instance) diff --git a/pype/plugins/maya/publish/validate_rendersettings.py b/pype/plugins/maya/publish/validate_rendersettings.py index 67239d4790..16484affad 100644 --- a/pype/plugins/maya/publish/validate_rendersettings.py +++ b/pype/plugins/maya/publish/validate_rendersettings.py @@ -6,7 +6,7 @@ import pymel.core as pm import pyblish.api import pype.api -import pype.maya.lib as lib +from pype.hosts.maya import lib class ValidateRenderSettings(pyblish.api.InstancePlugin): diff --git a/pype/plugins/maya/publish/validate_rig_controllers.py b/pype/plugins/maya/publish/validate_rig_controllers.py index a9072e9d31..a127728155 100644 --- a/pype/plugins/maya/publish/validate_rig_controllers.py +++ b/pype/plugins/maya/publish/validate_rig_controllers.py @@ -3,8 +3,8 @@ from maya import cmds import pyblish.api import pype.api -import pype.maya.action -from pype.maya.lib import undo_chunk +import pype.hosts.maya.action +from pype.hosts.maya.lib import undo_chunk class ValidateRigControllers(pyblish.api.InstancePlugin): @@ -30,7 +30,7 @@ class ValidateRigControllers(pyblish.api.InstancePlugin): hosts = ["maya"] families = ["rig"] actions = [pype.api.RepairAction, - pype.maya.action.SelectInvalidAction] + pype.hosts.maya.action.SelectInvalidAction] # Default controller values CONTROLLER_DEFAULTS = { diff --git a/pype/plugins/maya/publish/validate_rig_controllers_arnold_attributes.py b/pype/plugins/maya/publish/validate_rig_controllers_arnold_attributes.py index 525a15a4e5..8c1f8e4c7b 100644 --- a/pype/plugins/maya/publish/validate_rig_controllers_arnold_attributes.py +++ b/pype/plugins/maya/publish/validate_rig_controllers_arnold_attributes.py @@ -3,8 +3,8 @@ from maya import cmds import pyblish.api import pype.api -import pype.maya.lib as lib -import pype.maya.action +from pype.hosts.maya import lib +import pype.hosts.maya.action class ValidateRigControllersArnoldAttributes(pyblish.api.InstancePlugin): @@ -31,7 +31,7 @@ class ValidateRigControllersArnoldAttributes(pyblish.api.InstancePlugin): hosts = ["maya"] families = ["rig"] actions = [pype.api.RepairAction, - pype.maya.action.SelectInvalidAction] + pype.hosts.maya.action.SelectInvalidAction] attributes = [ "rcurve", diff --git a/pype/plugins/maya/publish/validate_rig_out_set_node_ids.py b/pype/plugins/maya/publish/validate_rig_out_set_node_ids.py index 3dde6bc83d..97dca803ee 100644 --- a/pype/plugins/maya/publish/validate_rig_out_set_node_ids.py +++ b/pype/plugins/maya/publish/validate_rig_out_set_node_ids.py @@ -2,8 +2,8 @@ import maya.cmds as cmds import pyblish.api import pype.api -import pype.maya.action -import pype.maya.lib as lib +import pype.hosts.maya.action +from pype.hosts.maya import lib class ValidateRigOutSetNodeIds(pyblish.api.InstancePlugin): @@ -20,7 +20,7 @@ class ValidateRigOutSetNodeIds(pyblish.api.InstancePlugin): families = ["rig"] hosts = ['maya'] label = 'Rig Out Set Node Ids' - actions = [pype.maya.action.SelectInvalidAction, pype.api.RepairAction] + actions = [pype.hosts.maya.action.SelectInvalidAction, pype.api.RepairAction] def process(self, instance): """Process all meshes""" diff --git a/pype/plugins/maya/publish/validate_rig_output_ids.py b/pype/plugins/maya/publish/validate_rig_output_ids.py index 89cd37fe64..fe9662d9d9 100644 --- a/pype/plugins/maya/publish/validate_rig_output_ids.py +++ b/pype/plugins/maya/publish/validate_rig_output_ids.py @@ -3,8 +3,8 @@ import pymel.core as pc import pyblish.api import pype.api -import pype.maya.action -from pype.maya.lib import undo_chunk +import pype.hosts.maya.action +from pype.hosts.maya.lib import undo_chunk class ValidateRigOutputIds(pyblish.api.InstancePlugin): @@ -19,7 +19,7 @@ class ValidateRigOutputIds(pyblish.api.InstancePlugin): hosts = ["maya"] families = ["rig"] actions = [pype.api.RepairAction, - pype.maya.action.SelectInvalidAction] + pype.hosts.maya.action.SelectInvalidAction] def process(self, instance): invalid = self.get_invalid(instance, compute=True) diff --git a/pype/plugins/maya/publish/validate_shader_name.py b/pype/plugins/maya/publish/validate_shader_name.py index c6f72a2940..094ac0afe9 100644 --- a/pype/plugins/maya/publish/validate_shader_name.py +++ b/pype/plugins/maya/publish/validate_shader_name.py @@ -2,7 +2,7 @@ from maya import cmds import pyblish.api import pype.api -import pype.maya.action +import pype.hosts.maya.action import re @@ -18,7 +18,7 @@ class ValidateShaderName(pyblish.api.InstancePlugin): families = ["look"] hosts = ['maya'] label = 'Validate Shaders Name' - actions = [pype.maya.action.SelectInvalidAction] + actions = [pype.hosts.maya.action.SelectInvalidAction] regex = r'(?P.*)_(.*)_SHD' # The default connections to check diff --git a/pype/plugins/maya/publish/validate_shape_default_names.py b/pype/plugins/maya/publish/validate_shape_default_names.py index 9beb77872a..c0638863da 100644 --- a/pype/plugins/maya/publish/validate_shape_default_names.py +++ b/pype/plugins/maya/publish/validate_shape_default_names.py @@ -4,7 +4,7 @@ from maya import cmds import pyblish.api import pype.api -import pype.maya.action +import pype.hosts.maya.action def short_name(node): @@ -38,7 +38,7 @@ class ValidateShapeDefaultNames(pyblish.api.InstancePlugin): optional = True version = (0, 1, 0) label = "Shape Default Naming" - actions = [pype.maya.action.SelectInvalidAction, + actions = [pype.hosts.maya.action.SelectInvalidAction, pype.api.RepairAction] @staticmethod diff --git a/pype/plugins/maya/publish/validate_shape_render_stats.py b/pype/plugins/maya/publish/validate_shape_render_stats.py index b803cd366b..af48d664ec 100644 --- a/pype/plugins/maya/publish/validate_shape_render_stats.py +++ b/pype/plugins/maya/publish/validate_shape_render_stats.py @@ -3,7 +3,7 @@ import pype.api from maya import cmds -import pype.maya.action +import pype.hosts.maya.action class ValidateShapeRenderStats(pyblish.api.Validator): @@ -13,7 +13,7 @@ class ValidateShapeRenderStats(pyblish.api.Validator): hosts = ['maya'] families = ['model'] label = 'Shape Default Render Stats' - actions = [pype.maya.action.SelectInvalidAction, + actions = [pype.hosts.maya.action.SelectInvalidAction, pype.api.RepairAction] defaults = {'castsShadows': 1, diff --git a/pype/plugins/maya/publish/validate_skinCluster_deformer_set.py b/pype/plugins/maya/publish/validate_skinCluster_deformer_set.py index 71f7eea31b..39870658ad 100644 --- a/pype/plugins/maya/publish/validate_skinCluster_deformer_set.py +++ b/pype/plugins/maya/publish/validate_skinCluster_deformer_set.py @@ -2,7 +2,7 @@ from maya import cmds import pyblish.api import pype.api -import pype.maya.action +import pype.hosts.maya.action class ValidateSkinclusterDeformerSet(pyblish.api.InstancePlugin): @@ -18,7 +18,7 @@ class ValidateSkinclusterDeformerSet(pyblish.api.InstancePlugin): hosts = ['maya'] families = ['fbx'] label = "Skincluster Deformer Relationships" - actions = [pype.maya.action.SelectInvalidAction] + actions = [pype.hosts.maya.action.SelectInvalidAction] def process(self, instance): """Process all the transform nodes in the instance""" diff --git a/pype/plugins/maya/publish/validate_step_size.py b/pype/plugins/maya/publish/validate_step_size.py index 20207a050f..5e46e7df0b 100644 --- a/pype/plugins/maya/publish/validate_step_size.py +++ b/pype/plugins/maya/publish/validate_step_size.py @@ -1,6 +1,6 @@ import pyblish.api import pype.api -import pype.maya.action +import pype.hosts.maya.action class ValidateStepSize(pyblish.api.InstancePlugin): @@ -15,7 +15,7 @@ class ValidateStepSize(pyblish.api.InstancePlugin): families = ['camera', 'pointcache', 'animation'] - actions = [pype.maya.action.SelectInvalidAction] + actions = [pype.hosts.maya.action.SelectInvalidAction] MIN = 0.01 MAX = 1.0 diff --git a/pype/plugins/maya/publish/validate_transform_naming_suffix.py b/pype/plugins/maya/publish/validate_transform_naming_suffix.py index e9ddd120b5..bd7db437fa 100644 --- a/pype/plugins/maya/publish/validate_transform_naming_suffix.py +++ b/pype/plugins/maya/publish/validate_transform_naming_suffix.py @@ -2,7 +2,7 @@ from maya import cmds import pyblish.api import pype.api -import pype.maya.action +import pype.hosts.maya.action class ValidateTransformNamingSuffix(pyblish.api.InstancePlugin): @@ -32,7 +32,7 @@ class ValidateTransformNamingSuffix(pyblish.api.InstancePlugin): optional = True version = (0, 1, 0) label = 'Suffix Naming Conventions' - actions = [pype.maya.action.SelectInvalidAction] + actions = [pype.hosts.maya.action.SelectInvalidAction] SUFFIX_NAMING_TABLE = {'mesh': ["_GEO", "_GES", "_GEP", "_OSD"], 'nurbsCurve': ["_CRV"], 'nurbsSurface': ["_NRB"], diff --git a/pype/plugins/maya/publish/validate_transform_zero.py b/pype/plugins/maya/publish/validate_transform_zero.py index 9b74316476..ac5517061f 100644 --- a/pype/plugins/maya/publish/validate_transform_zero.py +++ b/pype/plugins/maya/publish/validate_transform_zero.py @@ -2,7 +2,7 @@ from maya import cmds import pyblish.api import pype.api -import pype.maya.action +import pype.hosts.maya.action class ValidateTransformZero(pyblish.api.Validator): @@ -20,7 +20,7 @@ class ValidateTransformZero(pyblish.api.Validator): category = "geometry" version = (0, 1, 0) label = "Transform Zero (Freeze)" - actions = [pype.maya.action.SelectInvalidAction] + actions = [pype.hosts.maya.action.SelectInvalidAction] _identity = [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, diff --git a/pype/plugins/maya/publish/validate_unicode_strings.py b/pype/plugins/maya/publish/validate_unicode_strings.py index 9f229db062..bf44d971af 100644 --- a/pype/plugins/maya/publish/validate_unicode_strings.py +++ b/pype/plugins/maya/publish/validate_unicode_strings.py @@ -3,7 +3,7 @@ from maya import cmds import pyblish.api import pype.api -import pype.maya.action +import pype.hosts.maya.action class ValidateUnicodeStrings(pyblish.api.Validator): diff --git a/pype/plugins/maya/publish/validate_unreal_mesh_triangulated.py b/pype/plugins/maya/publish/validate_unreal_mesh_triangulated.py index 77f7144c4e..2cefe27019 100644 --- a/pype/plugins/maya/publish/validate_unreal_mesh_triangulated.py +++ b/pype/plugins/maya/publish/validate_unreal_mesh_triangulated.py @@ -13,7 +13,7 @@ class ValidateUnrealMeshTriangulated(pyblish.api.InstancePlugin): families = ["unrealStaticMesh"] category = "geometry" label = "Mesh is Triangulated" - actions = [pype.maya.action.SelectInvalidAction] + actions = [pype.hosts.maya.action.SelectInvalidAction] @classmethod def get_invalid(cls, instance): diff --git a/pype/plugins/maya/publish/validate_unreal_staticmesh_naming.py b/pype/plugins/maya/publish/validate_unreal_staticmesh_naming.py index b62a855da9..4116c5f534 100644 --- a/pype/plugins/maya/publish/validate_unreal_staticmesh_naming.py +++ b/pype/plugins/maya/publish/validate_unreal_staticmesh_naming.py @@ -3,7 +3,7 @@ from maya import cmds import pyblish.api import pype.api -import pype.maya.action +import pype.hosts.maya.action import re @@ -51,7 +51,7 @@ class ValidateUnrealStaticmeshName(pyblish.api.InstancePlugin): hosts = ["maya"] families = ["unrealStaticMesh"] label = "Unreal StaticMesh Name" - actions = [pype.maya.action.SelectInvalidAction] + actions = [pype.hosts.maya.action.SelectInvalidAction] regex_mesh = r"SM_(?P.*)_(\d{2})" regex_collision = r"((UBX)|(UCP)|(USP)|(UCX))_(?P.*)_(\d{2})" diff --git a/pype/plugins/maya/publish/validate_vray_distributed_rendering.py b/pype/plugins/maya/publish/validate_vray_distributed_rendering.py index cccf966ffd..6bec0c88dd 100644 --- a/pype/plugins/maya/publish/validate_vray_distributed_rendering.py +++ b/pype/plugins/maya/publish/validate_vray_distributed_rendering.py @@ -1,6 +1,6 @@ import pyblish.api import pype.api -import pype.maya.lib as lib +from pype.hosts.maya import lib from maya import cmds diff --git a/pype/plugins/maya/publish/validate_vrayproxy_members.py b/pype/plugins/maya/publish/validate_vrayproxy_members.py index 6631af43d9..75946a6787 100644 --- a/pype/plugins/maya/publish/validate_vrayproxy_members.py +++ b/pype/plugins/maya/publish/validate_vrayproxy_members.py @@ -3,7 +3,7 @@ import pype.api from maya import cmds -import pype.maya.action +import pype.hosts.maya.action class ValidateVrayProxyMembers(pyblish.api.InstancePlugin): @@ -13,7 +13,7 @@ class ValidateVrayProxyMembers(pyblish.api.InstancePlugin): label = 'VRay Proxy Members' hosts = ['maya'] families = ['vrayproxy'] - actions = [pype.maya.action.SelectInvalidAction] + actions = [pype.hosts.maya.action.SelectInvalidAction] def process(self, instance): diff --git a/pype/plugins/maya/publish/validate_yeti_rig_cache_state.py b/pype/plugins/maya/publish/validate_yeti_rig_cache_state.py index 250c1c7b2e..1ed145fecd 100644 --- a/pype/plugins/maya/publish/validate_yeti_rig_cache_state.py +++ b/pype/plugins/maya/publish/validate_yeti_rig_cache_state.py @@ -1,7 +1,7 @@ import pyblish.api import pype.action import maya.cmds as cmds -import pype.maya.action +import pype.hosts.maya.action class ValidateYetiRigCacheState(pyblish.api.InstancePlugin): @@ -18,7 +18,7 @@ class ValidateYetiRigCacheState(pyblish.api.InstancePlugin): hosts = ["maya"] families = ["yetiRig"] actions = [pype.action.RepairAction, - pype.maya.action.SelectInvalidAction] + pype.hosts.maya.action.SelectInvalidAction] def process(self, instance): invalid = self.get_invalid(instance) diff --git a/pype/plugins/maya/publish/validate_yeti_rig_input_in_instance.py b/pype/plugins/maya/publish/validate_yeti_rig_input_in_instance.py index 51872d04e1..647a66cb57 100644 --- a/pype/plugins/maya/publish/validate_yeti_rig_input_in_instance.py +++ b/pype/plugins/maya/publish/validate_yeti_rig_input_in_instance.py @@ -2,7 +2,7 @@ from maya import cmds import pyblish.api import pype.api -import pype.maya.action +import pype.hosts.maya.action class ValidateYetiRigInputShapesInInstance(pyblish.api.Validator): @@ -12,7 +12,7 @@ class ValidateYetiRigInputShapesInInstance(pyblish.api.Validator): hosts = ["maya"] families = ["yetiRig"] label = "Yeti Rig Input Shapes In Instance" - actions = [pype.maya.action.SelectInvalidAction] + actions = [pype.hosts.maya.action.SelectInvalidAction] def process(self, instance): diff --git a/pype/plugins/nuke/create/create_backdrop.py b/pype/plugins/nuke/create/create_backdrop.py index 8609117a0d..0d2b621e21 100644 --- a/pype/plugins/nuke/create/create_backdrop.py +++ b/pype/plugins/nuke/create/create_backdrop.py @@ -1,9 +1,9 @@ -from avalon.nuke.pipeline import Creator +import avalon.nuke from avalon.nuke import lib as anlib import nuke -class CreateBackdrop(Creator): +class CreateBackdrop(avalon.nuke.Creator): """Add Publishable Backdrop""" name = "nukenodes" diff --git a/pype/plugins/nuke/create/create_gizmo.py b/pype/plugins/nuke/create/create_gizmo.py index ca199b8800..eb5b1a3fb0 100644 --- a/pype/plugins/nuke/create/create_gizmo.py +++ b/pype/plugins/nuke/create/create_gizmo.py @@ -1,9 +1,9 @@ -from avalon.nuke.pipeline import Creator +import avalon.nuke from avalon.nuke import lib as anlib import nuke -import nukescripts -class CreateGizmo(Creator): + +class CreateGizmo(avalon.nuke.Creator): """Add Publishable "gizmo" group The name is symbolically gizmo as presumably diff --git a/pype/plugins/nuke/create/create_write_prerender.py b/pype/plugins/nuke/create/create_write_prerender.py index b0bc36477f..2243ba8b5c 100644 --- a/pype/plugins/nuke/create/create_write_prerender.py +++ b/pype/plugins/nuke/create/create_write_prerender.py @@ -1,5 +1,5 @@ from collections import OrderedDict -from pype.nuke import ( +from pype.hosts.nuke import ( plugin, lib as pnlib) import nuke diff --git a/pype/plugins/nuke/create/create_write_render.py b/pype/plugins/nuke/create/create_write_render.py index 17eab02aea..5a6bf57197 100644 --- a/pype/plugins/nuke/create/create_write_render.py +++ b/pype/plugins/nuke/create/create_write_render.py @@ -1,5 +1,5 @@ from collections import OrderedDict -from pype.nuke import ( +from pype.hosts.nuke import ( plugin, lib as pnlib) import nuke diff --git a/pype/plugins/nuke/load/actions.py b/pype/plugins/nuke/load/actions.py index a435633fd6..96f5f3b8c4 100644 --- a/pype/plugins/nuke/load/actions.py +++ b/pype/plugins/nuke/load/actions.py @@ -25,7 +25,7 @@ class SetFrameRangeLoader(api.Loader): def load(self, context, name, namespace, data): - from pype.nuke import lib + from pype.hosts.nuke import lib version = context['version'] version_data = version.get("data", {}) @@ -59,7 +59,7 @@ class SetFrameRangeWithHandlesLoader(api.Loader): def load(self, context, name, namespace, data): - from pype.nuke import lib + from pype.hosts.nuke import lib version = context['version'] version_data = version.get("data", {}) diff --git a/pype/plugins/nuke/load/load_backdrop.py b/pype/plugins/nuke/load/load_backdrop.py index 04cff311d1..66f9a8e1c1 100644 --- a/pype/plugins/nuke/load/load_backdrop.py +++ b/pype/plugins/nuke/load/load_backdrop.py @@ -1,7 +1,7 @@ from avalon import api, style, io import nuke import nukescripts -from pype.nuke import lib as pnlib +from pype.hosts.nuke import lib as pnlib from avalon.nuke import lib as anlib from avalon.nuke import containerise, update_container reload(pnlib) diff --git a/pype/plugins/nuke/load/load_gizmo_ip.py b/pype/plugins/nuke/load/load_gizmo_ip.py index 5fecbc4c5c..e735e27bbf 100644 --- a/pype/plugins/nuke/load/load_gizmo_ip.py +++ b/pype/plugins/nuke/load/load_gizmo_ip.py @@ -1,6 +1,6 @@ from avalon import api, style, io import nuke -from pype.nuke import lib as pnlib +from pype.hosts.nuke import lib as pnlib from avalon.nuke import lib as anlib from avalon.nuke import containerise, update_container diff --git a/pype/plugins/nuke/load/load_luts_ip.py b/pype/plugins/nuke/load/load_luts_ip.py index 41cc6c1a43..241e077659 100644 --- a/pype/plugins/nuke/load/load_luts_ip.py +++ b/pype/plugins/nuke/load/load_luts_ip.py @@ -2,7 +2,7 @@ from avalon import api, style, io import nuke import json from collections import OrderedDict -from pype.nuke import lib +from pype.hosts.nuke import lib class LoadLutsInputProcess(api.Loader): diff --git a/pype/plugins/nuke/load/load_mov.py b/pype/plugins/nuke/load/load_mov.py index 5d15efcd3a..d252aaa09d 100644 --- a/pype/plugins/nuke/load/load_mov.py +++ b/pype/plugins/nuke/load/load_mov.py @@ -3,8 +3,8 @@ import nuke import contextlib from avalon import api, io -from pype.nuke import presets -from pypeapp import config +from pype.hosts.nuke import presets +from pype.api import config @contextlib.contextmanager diff --git a/pype/plugins/nuke/load/load_sequence.py b/pype/plugins/nuke/load/load_sequence.py index 1ee8f0481e..aa79d8736a 100644 --- a/pype/plugins/nuke/load/load_sequence.py +++ b/pype/plugins/nuke/load/load_sequence.py @@ -3,7 +3,7 @@ import nuke import contextlib from avalon import api, io -from pype.nuke import presets +from pype.hosts.nuke import presets @contextlib.contextmanager diff --git a/pype/plugins/nuke/publish/collect_backdrop.py b/pype/plugins/nuke/publish/collect_backdrop.py index 10729b217b..5a117c2920 100644 --- a/pype/plugins/nuke/publish/collect_backdrop.py +++ b/pype/plugins/nuke/publish/collect_backdrop.py @@ -1,6 +1,6 @@ import pyblish.api import pype.api as pype -from pype.nuke import lib as pnlib +from pype.hosts.nuke import lib as pnlib import nuke @pyblish.api.log diff --git a/pype/plugins/nuke/publish/extract_backdrop.py b/pype/plugins/nuke/publish/extract_backdrop.py index 7b01b5deac..0f7198887f 100644 --- a/pype/plugins/nuke/publish/extract_backdrop.py +++ b/pype/plugins/nuke/publish/extract_backdrop.py @@ -1,6 +1,6 @@ import pyblish.api from avalon.nuke import lib as anlib -from pype.nuke import lib as pnlib +from pype.hosts.nuke import lib as pnlib import nuke import os import pype diff --git a/pype/plugins/nuke/publish/extract_gizmo.py b/pype/plugins/nuke/publish/extract_gizmo.py index 36ef1d464c..465bf9824c 100644 --- a/pype/plugins/nuke/publish/extract_gizmo.py +++ b/pype/plugins/nuke/publish/extract_gizmo.py @@ -1,7 +1,7 @@ import pyblish.api from avalon.nuke import lib as anlib -from pype.nuke import lib as pnlib -from pype.nuke import utils as pnutils +from pype.hosts.nuke import lib as pnlib +from pype.hosts.nuke import utils as pnutils import nuke import os import pype diff --git a/pype/plugins/nuke/publish/extract_review_data_lut.py b/pype/plugins/nuke/publish/extract_review_data_lut.py index 90b1fda1ec..10fe8fa2a9 100644 --- a/pype/plugins/nuke/publish/extract_review_data_lut.py +++ b/pype/plugins/nuke/publish/extract_review_data_lut.py @@ -1,7 +1,7 @@ import os import pyblish.api from avalon.nuke import lib as anlib -from pype.nuke import lib as pnlib +from pype.hosts.nuke import lib as pnlib import pype reload(pnlib) diff --git a/pype/plugins/nuke/publish/extract_review_data_mov.py b/pype/plugins/nuke/publish/extract_review_data_mov.py index 7c56dc8b92..e9ac3c2c84 100644 --- a/pype/plugins/nuke/publish/extract_review_data_mov.py +++ b/pype/plugins/nuke/publish/extract_review_data_mov.py @@ -1,7 +1,7 @@ import os import pyblish.api from avalon.nuke import lib as anlib -from pype.nuke import lib as pnlib +from pype.hosts.nuke import lib as pnlib import pype diff --git a/pype/plugins/nuke/publish/validate_script.py b/pype/plugins/nuke/publish/validate_script.py index 36df228ed5..52980a8455 100644 --- a/pype/plugins/nuke/publish/validate_script.py +++ b/pype/plugins/nuke/publish/validate_script.py @@ -11,6 +11,7 @@ class ValidateScript(pyblish.api.InstancePlugin): families = ["workfile"] label = "Check script settings" hosts = ["nuke"] + optional = True def process(self, instance): ctx_data = instance.context.data diff --git a/pype/plugins/nuke/publish/validate_write_deadline_tab.py b/pype/plugins/nuke/publish/validate_write_deadline_tab.py index 0510bdaebf..e751a99771 100644 --- a/pype/plugins/nuke/publish/validate_write_deadline_tab.py +++ b/pype/plugins/nuke/publish/validate_write_deadline_tab.py @@ -1,5 +1,5 @@ import pyblish.api -import pype.nuke.lib +import pype.hosts.nuke.lib class RepairNukeWriteDeadlineTab(pyblish.api.Action): @@ -24,12 +24,12 @@ class RepairNukeWriteDeadlineTab(pyblish.api.Action): group_node = [x for x in instance if x.Class() == "Group"][0] # Remove exising knobs. - knob_names = pype.nuke.lib.get_deadline_knob_names() + knob_names = pype.hosts.nuke.lib.get_deadline_knob_names() for name, knob in group_node.knobs().iteritems(): if name in knob_names: group_node.removeKnob(knob) - pype.nuke.lib.add_deadline_tab(group_node) + pype.hosts.nuke.lib.add_deadline_tab(group_node) class ValidateNukeWriteDeadlineTab(pyblish.api.InstancePlugin): @@ -45,7 +45,7 @@ class ValidateNukeWriteDeadlineTab(pyblish.api.InstancePlugin): def process(self, instance): group_node = [x for x in instance if x.Class() == "Group"][0] - knob_names = pype.nuke.lib.get_deadline_knob_names() + knob_names = pype.hosts.nuke.lib.get_deadline_knob_names() missing_knobs = [] for name in knob_names: if name not in group_node.knobs().keys(): diff --git a/pype/plugins/nuke/publish/validate_write_nodes.py b/pype/plugins/nuke/publish/validate_write_nodes.py index 836cee6c8f..bd33194897 100644 --- a/pype/plugins/nuke/publish/validate_write_nodes.py +++ b/pype/plugins/nuke/publish/validate_write_nodes.py @@ -1,7 +1,7 @@ import os import pyblish.api import pype.utils -import pype.nuke.lib as nukelib +import pype.hosts.nuke.lib as nukelib import avalon.nuke @pyblish.api.log diff --git a/pype/plugins/nukestudio/load/load_sequences_to_timeline_asset_origin.py b/pype/plugins/nukestudio/load/load_sequences_to_timeline_asset_origin.py index 2ee2409b86..c56dcbcaaa 100644 --- a/pype/plugins/nukestudio/load/load_sequences_to_timeline_asset_origin.py +++ b/pype/plugins/nukestudio/load/load_sequences_to_timeline_asset_origin.py @@ -1,6 +1,6 @@ from avalon import api import hiero -from pype.nukestudio import lib +from pype.hosts.nukestudio import lib reload(lib) diff --git a/pype/plugins/standalonepublisher/publish/collect_context.py b/pype/plugins/standalonepublisher/publish/collect_context.py index 0567f82755..8bd4e609ab 100644 --- a/pype/plugins/standalonepublisher/publish/collect_context.py +++ b/pype/plugins/standalonepublisher/publish/collect_context.py @@ -52,7 +52,7 @@ class CollectContextDataSAPublish(pyblish.api.ContextPlugin): # Load presets presets = context.data.get("presets") if not presets: - from pypeapp import config + from pype.api import config presets = config.get_presets() diff --git a/pype/plugins/unreal/create/create_staticmeshfbx.py b/pype/plugins/unreal/create/create_staticmeshfbx.py index 8002299f0a..fa41590ef5 100644 --- a/pype/plugins/unreal/create/create_staticmeshfbx.py +++ b/pype/plugins/unreal/create/create_staticmeshfbx.py @@ -1,5 +1,5 @@ import unreal -from pype.unreal.plugin import Creator +from pype.hosts.unreal.plugin import Creator from avalon.unreal import ( instantiate, ) diff --git a/pype/scripts/fusion_switch_shot.py b/pype/scripts/fusion_switch_shot.py index 539bcf4f68..f936b7d8e0 100644 --- a/pype/scripts/fusion_switch_shot.py +++ b/pype/scripts/fusion_switch_shot.py @@ -9,7 +9,7 @@ import avalon.fusion # Config imports import pype.lib as pype -import pype.fusion.lib as fusion_lib +import pype.hosts.fusion.lib as fusion_lib log = logging.getLogger("Update Slap Comp") diff --git a/pype/scripts/otio_burnin.py b/pype/scripts/otio_burnin.py index 138165d489..104ff0255c 100644 --- a/pype/scripts/otio_burnin.py +++ b/pype/scripts/otio_burnin.py @@ -4,8 +4,7 @@ import re import subprocess import json import opentimelineio_contrib.adapters.ffmpeg_burnins as ffmpeg_burnins -from pypeapp.lib import config -from pypeapp import Logger +from pype.api import Logger, config import pype.lib log = Logger().get_logger("BurninWrapper", "burninwrap") diff --git a/pype/scripts/slates/slate_base/lib.py b/pype/scripts/slates/slate_base/lib.py index d9f8ad6d42..6b0c01883c 100644 --- a/pype/scripts/slates/slate_base/lib.py +++ b/pype/scripts/slates/slate_base/lib.py @@ -13,7 +13,7 @@ from .items import ( ) try: - from pypeapp.config import get_presets + from pype.api.config import get_presets except Exception: get_presets = dict diff --git a/pype/setdress_api.py b/pype/setdress_api.py index 707a5b713f..7c764a42df 100644 --- a/pype/setdress_api.py +++ b/pype/setdress_api.py @@ -9,7 +9,7 @@ from maya import cmds from avalon import api, io from avalon.maya.lib import unique_namespace -from pype.maya.lib import matrix_equals +from pype.hosts.maya.lib import matrix_equals log = logging.getLogger("PackageLoader") @@ -161,7 +161,7 @@ def _add(instance, representation_id, loaders, namespace, root="|"): """ - from pype.maya.lib import get_container_transforms + from pype.hosts.maya.lib import get_container_transforms # Process within the namespace with namespaced(namespace, new=False) as namespace: @@ -358,7 +358,7 @@ def update_scene(set_container, containers, current_data, new_data, new_file): """ - from pype.maya.lib import DEFAULT_MATRIX, get_container_transforms + from pype.hosts.maya.lib import DEFAULT_MATRIX, get_container_transforms set_namespace = set_container['namespace'] diff --git a/pype/tools/assetcreator/app.py b/pype/tools/assetcreator/app.py index 5f9ff80de6..71b1027ef4 100644 --- a/pype/tools/assetcreator/app.py +++ b/pype/tools/assetcreator/app.py @@ -6,7 +6,7 @@ try: import ftrack_api_old as ftrack_api except Exception: import ftrack_api -from pypeapp import config +from pype.api import config from pype import lib as pypelib from avalon.vendor.Qt import QtWidgets, QtCore from avalon import io, api, style, schema diff --git a/pype/tools/texture_copy/app.py b/pype/tools/texture_copy/app.py index 5f89db53ff..cda7b5a443 100644 --- a/pype/tools/texture_copy/app.py +++ b/pype/tools/texture_copy/app.py @@ -5,7 +5,7 @@ from avalon import io, api from pprint import pprint from pypeapp.lib.Terminal import Terminal -from pypeapp import Anatomy +from pype.api import Anatomy import shutil import speedcopy diff --git a/pype/version.py b/pype/version.py index 892994aa6c..334087f851 100644 --- a/pype/version.py +++ b/pype/version.py @@ -1 +1 @@ -__version__ = "2.8.0" +__version__ = "2.9.1" diff --git a/setup/blender/init.py b/setup/blender/init.py index 05c15eaeb2..8aa83e51c9 100644 --- a/setup/blender/init.py +++ b/setup/blender/init.py @@ -1,3 +1,3 @@ -from pype import blender +from pype.hosts import blender blender.install() diff --git a/setup/maya/userSetup.py b/setup/maya/userSetup.py index 4f4aed36b7..bbf66846da 100644 --- a/setup/maya/userSetup.py +++ b/setup/maya/userSetup.py @@ -1,6 +1,6 @@ import os -from pypeapp import config -import pype.maya.lib as mlib +from pype.api import config +import pype.hosts.maya.lib as mlib from maya import cmds diff --git a/setup/nuke/nuke_path/menu.py b/setup/nuke/nuke_path/menu.py index be4f39b542..d9341045a9 100644 --- a/setup/nuke/nuke_path/menu.py +++ b/setup/nuke/nuke_path/menu.py @@ -2,14 +2,14 @@ import os import sys import KnobScripter -from pype.nuke.lib import ( +from pype.hosts.nuke.lib import ( writes_version_sync, on_script_load, check_inventory_versions ) import nuke -from pypeapp import Logger +from pype.api import Logger log = Logger().get_logger(__name__, "nuke") diff --git a/setup/nuke/nuke_path/write_to_read.py b/setup/nuke/nuke_path/write_to_read.py index 2cf6598b3b..7ea9220ad8 100644 --- a/setup/nuke/nuke_path/write_to_read.py +++ b/setup/nuke/nuke_path/write_to_read.py @@ -2,8 +2,8 @@ import re import os import glob import nuke -from pype import api as pype -log = pype.Logger().get_logger(__name__, "nuke") +from pype.api import Logger +log = Logger().get_logger(__name__, "nuke") SINGLE_FILE_FORMATS = ['avi', 'mp4', 'mxf', 'mov', 'mpg', 'mpeg', 'wmv', 'm4v', 'm2v'] @@ -122,7 +122,7 @@ def write_to_read(gn): ) if not file_path_new: return - + myfiletranslated, firstFrame, lastFrame = file_path_new # get node data ndata = { diff --git a/setup/nukestudio/hiero_plugin_path/Python/Startup/Startup.py b/setup/nukestudio/hiero_plugin_path/Python/Startup/Startup.py index bbef6502a9..e5c5729e2c 100644 --- a/setup/nukestudio/hiero_plugin_path/Python/Startup/Startup.py +++ b/setup/nukestudio/hiero_plugin_path/Python/Startup/Startup.py @@ -2,11 +2,11 @@ import traceback # activate nukestudio from pype import avalon.api -import pype.nukestudio -avalon.api.install(pype.nukestudio) +import pype.hosts.nukestudio +avalon.api.install(pype.hosts.nukestudio) try: - __import__("pype.nukestudio") + __import__("pype.hosts.nukestudio") __import__("pyblish") except ImportError as e: @@ -15,5 +15,5 @@ except ImportError as e: else: # Setup integration - import pype.nukestudio.lib - pype.nukestudio.lib.setup() + import pype.hosts.nukestudio.lib + pype.hosts.nukestudio.lib.setup()