From 22132f6e4db34e3989621c8a30281d6c6dbdac66 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 16 Sep 2020 16:11:13 +0200 Subject: [PATCH 01/95] feat(global): adding burnin suffix only if more filtered burnin profil --- pype/plugins/global/publish/extract_burnin.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pype/plugins/global/publish/extract_burnin.py b/pype/plugins/global/publish/extract_burnin.py index 4443cfe223..6e8da1b054 100644 --- a/pype/plugins/global/publish/extract_burnin.py +++ b/pype/plugins/global/publish/extract_burnin.py @@ -195,11 +195,14 @@ class ExtractBurnin(pype.api.Extractor): if "delete" in new_repre["tags"]: new_repre["tags"].remove("delete") - # Update name and outputName to be able have multiple outputs - # Join previous "outputName" with filename suffix - new_name = "_".join([new_repre["outputName"], filename_suffix]) - new_repre["name"] = new_name - new_repre["outputName"] = new_name + if len(repre_burnin_defs.keys()) > 1: + # Update name and outputName to be + # able have multiple outputs in case of more burnin presets + # Join previous "outputName" with filename suffix + new_name = "_".join( + [new_repre["outputName"], filename_suffix]) + new_repre["name"] = new_name + new_repre["outputName"] = new_name # Prepare paths and files for process. self.input_output_paths(new_repre, temp_data, filename_suffix) From 4e5226cdc581e05b41730bf4780e982b48b06f49 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 22 Sep 2020 11:42:23 +0200 Subject: [PATCH 02/95] fixed clipboard copy in global loaders when Qt is runnign QCoreApplication --- pype/plugins/global/load/copy_file.py | 5 ++--- pype/plugins/global/load/copy_file_path.py | 7 +++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pype/plugins/global/load/copy_file.py b/pype/plugins/global/load/copy_file.py index bbb8e1d6f7..1acacf6b27 100644 --- a/pype/plugins/global/load/copy_file.py +++ b/pype/plugins/global/load/copy_file.py @@ -20,8 +20,8 @@ class CopyFile(api.Loader): def copy_file_to_clipboard(path): from avalon.vendor.Qt import QtCore, QtWidgets - app = QtWidgets.QApplication.instance() - assert app, "Must have running QApplication instance" + clipboard = QtWidgets.QApplication.clipboard() + assert clipboard, "Must have running QApplication instance" # Build mime data for clipboard data = QtCore.QMimeData() @@ -29,5 +29,4 @@ class CopyFile(api.Loader): data.setUrls([url]) # Set to Clipboard - clipboard = app.clipboard() clipboard.setMimeData(data) diff --git a/pype/plugins/global/load/copy_file_path.py b/pype/plugins/global/load/copy_file_path.py index cfda9dc271..f64f3e76d8 100644 --- a/pype/plugins/global/load/copy_file_path.py +++ b/pype/plugins/global/load/copy_file_path.py @@ -19,11 +19,10 @@ class CopyFilePath(api.Loader): @staticmethod def copy_path_to_clipboard(path): - from avalon.vendor.Qt import QtCore, QtWidgets + from avalon.vendor.Qt import QtWidgets - app = QtWidgets.QApplication.instance() - assert app, "Must have running QApplication instance" + clipboard = QtWidgets.QApplication.clipboard() + assert clipboard, "Must have running QApplication instance" # Set to Clipboard - clipboard = app.clipboard() clipboard.setText(os.path.normpath(path)) From 066349a3cb4424c4a0317002cdb5918c16614491 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 22 Sep 2020 12:02:39 +0200 Subject: [PATCH 03/95] implemented base pype module class in modules --- pype/modules/__init__.py | 5 +++++ pype/modules/base.py | 26 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 pype/modules/base.py diff --git a/pype/modules/__init__.py b/pype/modules/__init__.py index e69de29bb2..32b7426ba5 100644 --- a/pype/modules/__init__.py +++ b/pype/modules/__init__.py @@ -0,0 +1,5 @@ +from .base import PypeModule + +__all__ = ( + "PypeModule", +) diff --git a/pype/modules/base.py b/pype/modules/base.py new file mode 100644 index 0000000000..2d97bc5e14 --- /dev/null +++ b/pype/modules/base.py @@ -0,0 +1,26 @@ +from uuid import uuid4 +from pype.api import Logger + + +class PypeModule: + """Base class of pype module.""" + enabled = False + name = None + _id = None + + def __init__(self, settings): + if self.name is None: + self.name = self.__class__.__name__ + + self.log = Logger().get_logger(self.name) + + self.settings = settings.get(self.name) + self.enabled = settings.get("enabled", False) + self._id = uuid4() + + @property + def id(self): + return self._id + + def startup_environments(self): + return {} From b50438a66cebbbb1dc7767a6973ff781c5b429b4 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 22 Sep 2020 12:03:35 +0200 Subject: [PATCH 04/95] implemented basic pype modules manager which does not much do at this time --- pype/modules_manager.py | 104 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 pype/modules_manager.py diff --git a/pype/modules_manager.py b/pype/modules_manager.py new file mode 100644 index 0000000000..073b153f08 --- /dev/null +++ b/pype/modules_manager.py @@ -0,0 +1,104 @@ +import os +import sys +import inspect + +import pype.modules +from pype.modules import PypeModule +from pype.settings import system_settings +from pype.api import Logger + + +class PypeModuleManager: + skip_module_names = ("__pycache__", ) + + def __init__(self): + self.log = Logger().get_logger( + "{}.{}".format(__name__, self.__class__.__name__) + ) + + self.pype_modules = self.find_pype_modules() + + def modules_environments(self): + environments = {} + for pype_module in self.pype_modules.values(): + environments.update(pype_module.startup_environments()) + return environments + + def find_pype_modules(self): + settings = system_settings() + modules = [] + dirpath = os.path.dirname(pype.modules.__file__) + for module_name in os.listdir(dirpath): + # Check if path lead to a folder + full_path = os.path.join(dirpath, module_name) + if not os.path.isdir(full_path): + continue + + # Skip known invalid names + if module_name in self.skip_module_names: + continue + + import_name = "pype.modules.{}".format(module_name) + try: + modules.append( + __import__(import_name, fromlist=[""]) + ) + print(import_name, sys.modules.get("PyQt5")) + + except Exception: + self.log.warning( + "Couldn't import {}".format(import_name), exc_info=True + ) + + pype_module_classes = [] + for module in modules: + try: + pype_module_classes.extend( + self._classes_from_module(PypeModule, module) + ) + except Exception: + self.log.warning( + "Couldn't import {}".format(import_name), exc_info=True + ) + + pype_modules = {} + for pype_module_class in pype_module_classes: + try: + pype_module = pype_module_class(settings) + if pype_module.enabled: + pype_modules[pype_module.id] = pype_module + except Exception: + self.log.warning( + "Couldn't create instance of {}".format( + pype_module_class.__class__.__name__ + ), + exc_info=True + ) + return pype_modules + + def _classes_from_module(self, superclass, module): + classes = list() + + def recursive_bases(klass): + output = [] + output.extend(klass.__bases__) + for base in klass.__bases__: + output.extend(recursive_bases(base)) + return output + + for name in dir(module): + # It could be anything at this point + obj = getattr(module, name) + + if not inspect.isclass(obj) or not len(obj.__bases__) > 0: + continue + + # Use string comparison rather than `issubclass` + # in order to support reloading of this module. + bases = recursive_bases(obj) + if not any(base.__name__ == superclass.__name__ for base in bases): + continue + + classes.append(obj) + + return classes From d5c0fa464ae7b0fdc61367e8b14719aa972a589a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 22 Sep 2020 14:05:36 +0200 Subject: [PATCH 05/95] removed debug prints --- pype/modules_manager.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pype/modules_manager.py b/pype/modules_manager.py index 073b153f08..4b337c075b 100644 --- a/pype/modules_manager.py +++ b/pype/modules_manager.py @@ -43,7 +43,6 @@ class PypeModuleManager: modules.append( __import__(import_name, fromlist=[""]) ) - print(import_name, sys.modules.get("PyQt5")) except Exception: self.log.warning( From 4db75b45e5c26dac46ddbf75a11676adee5d9c44 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 22 Sep 2020 14:06:43 +0200 Subject: [PATCH 06/95] PypeModule inherit from abstract class --- pype/modules/base.py | 3 ++- pype/modules_manager.py | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pype/modules/base.py b/pype/modules/base.py index 2d97bc5e14..ede2f41bd5 100644 --- a/pype/modules/base.py +++ b/pype/modules/base.py @@ -1,8 +1,9 @@ from uuid import uuid4 +from abc import ABC from pype.api import Logger -class PypeModule: +class PypeModule(ABC): """Base class of pype module.""" enabled = False name = None diff --git a/pype/modules_manager.py b/pype/modules_manager.py index 4b337c075b..6538187ea9 100644 --- a/pype/modules_manager.py +++ b/pype/modules_manager.py @@ -1,5 +1,4 @@ import os -import sys import inspect import pype.modules From 3cf6962d3c344a45a809b2ee7450fc56bf763d43 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 22 Sep 2020 14:44:00 +0200 Subject: [PATCH 07/95] location configrations are refreshed if is triggered session.rollback() in ftrack plugins --- pype/plugins/ftrack/publish/integrate_ftrack_api.py | 8 ++++++++ .../plugins/ftrack/publish/integrate_ftrack_note.py | 1 + .../ftrack/publish/integrate_hierarchy_ftrack.py | 13 +++++++++++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/pype/plugins/ftrack/publish/integrate_ftrack_api.py b/pype/plugins/ftrack/publish/integrate_ftrack_api.py index 0c4c6d49b5..2c8e06a099 100644 --- a/pype/plugins/ftrack/publish/integrate_ftrack_api.py +++ b/pype/plugins/ftrack/publish/integrate_ftrack_api.py @@ -97,6 +97,7 @@ class IntegrateFtrackApi(pyblish.api.InstancePlugin): except Exception: tp, value, tb = sys.exc_info() session.rollback() + session._configure_locations() six.reraise(tp, value, tb) def process(self, instance): @@ -178,6 +179,7 @@ class IntegrateFtrackApi(pyblish.api.InstancePlugin): except Exception: tp, value, tb = sys.exc_info() session.rollback() + session._configure_locations() six.reraise(tp, value, tb) # Adding metadata @@ -228,6 +230,7 @@ class IntegrateFtrackApi(pyblish.api.InstancePlugin): except Exception: tp, value, tb = sys.exc_info() session.rollback() + session._configure_locations() six.reraise(tp, value, tb) # Adding metadata @@ -242,6 +245,7 @@ class IntegrateFtrackApi(pyblish.api.InstancePlugin): session.commit() except Exception: session.rollback() + session._configure_locations() self.log.warning(( "Comment was not possible to set for AssetVersion" "\"{0}\". Can't set it's value to: \"{1}\"" @@ -258,6 +262,7 @@ class IntegrateFtrackApi(pyblish.api.InstancePlugin): continue except Exception: session.rollback() + session._configure_locations() self.log.warning(( "Custom Attrubute \"{0}\"" @@ -272,6 +277,7 @@ class IntegrateFtrackApi(pyblish.api.InstancePlugin): except Exception: tp, value, tb = sys.exc_info() session.rollback() + session._configure_locations() six.reraise(tp, value, tb) # Component @@ -316,6 +322,7 @@ class IntegrateFtrackApi(pyblish.api.InstancePlugin): except Exception: tp, value, tb = sys.exc_info() session.rollback() + session._configure_locations() six.reraise(tp, value, tb) # Reset members in memory @@ -432,6 +439,7 @@ class IntegrateFtrackApi(pyblish.api.InstancePlugin): except Exception: tp, value, tb = sys.exc_info() session.rollback() + session._configure_locations() six.reraise(tp, value, tb) if assetversion_entity not in used_asset_versions: diff --git a/pype/plugins/ftrack/publish/integrate_ftrack_note.py b/pype/plugins/ftrack/publish/integrate_ftrack_note.py index 9566207145..acd295854d 100644 --- a/pype/plugins/ftrack/publish/integrate_ftrack_note.py +++ b/pype/plugins/ftrack/publish/integrate_ftrack_note.py @@ -145,4 +145,5 @@ class IntegrateFtrackNote(pyblish.api.InstancePlugin): except Exception: tp, value, tb = sys.exc_info() session.rollback() + session._configure_locations() six.reraise(tp, value, tb) diff --git a/pype/plugins/ftrack/publish/integrate_hierarchy_ftrack.py b/pype/plugins/ftrack/publish/integrate_hierarchy_ftrack.py index c4d8f2f705..95408e90ee 100644 --- a/pype/plugins/ftrack/publish/integrate_hierarchy_ftrack.py +++ b/pype/plugins/ftrack/publish/integrate_hierarchy_ftrack.py @@ -128,6 +128,7 @@ class IntegrateHierarchyToFtrack(pyblish.api.ContextPlugin): except Exception: tp, value, tb = sys.exc_info() self.session.rollback() + self.session._configure_locations() six.reraise(tp, value, tb) # TASKS @@ -156,6 +157,7 @@ class IntegrateHierarchyToFtrack(pyblish.api.ContextPlugin): except Exception: tp, value, tb = sys.exc_info() self.session.rollback() + self.session._configure_locations() six.reraise(tp, value, tb) # Incoming links. @@ -165,6 +167,7 @@ class IntegrateHierarchyToFtrack(pyblish.api.ContextPlugin): except Exception: tp, value, tb = sys.exc_info() self.session.rollback() + self.session._configure_locations() six.reraise(tp, value, tb) # Create notes. @@ -185,6 +188,7 @@ class IntegrateHierarchyToFtrack(pyblish.api.ContextPlugin): except Exception: tp, value, tb = sys.exc_info() self.session.rollback() + self.session._configure_locations() six.reraise(tp, value, tb) # Import children. @@ -201,6 +205,7 @@ class IntegrateHierarchyToFtrack(pyblish.api.ContextPlugin): except Exception: tp, value, tb = sys.exc_info() self.session.rollback() + self.session._configure_locations() six.reraise(tp, value, tb) # Create new links. @@ -242,6 +247,7 @@ class IntegrateHierarchyToFtrack(pyblish.api.ContextPlugin): except Exception: tp, value, tb = sys.exc_info() self.session.rollback() + self.session._configure_locations() six.reraise(tp, value, tb) return task @@ -256,6 +262,7 @@ class IntegrateHierarchyToFtrack(pyblish.api.ContextPlugin): except Exception: tp, value, tb = sys.exc_info() self.session.rollback() + self.session._configure_locations() six.reraise(tp, value, tb) return entity @@ -270,7 +277,8 @@ class IntegrateHierarchyToFtrack(pyblish.api.ContextPlugin): except Exception: tp, value, tb = sys.exc_info() self.session.rollback() - raise + self.session._configure_locations() + six.reraise(tp, value, tb) def auto_sync_on(self, project): @@ -283,4 +291,5 @@ class IntegrateHierarchyToFtrack(pyblish.api.ContextPlugin): except Exception: tp, value, tb = sys.exc_info() self.session.rollback() - raise + self.session._configure_locations() + six.reraise(tp, value, tb) From b4080ebbe23855a943f3b61ba9ae24deabe307bc Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Tue, 22 Sep 2020 16:12:25 +0200 Subject: [PATCH 08/95] docstrings and abstract method --- pype/modules/__init__.py | 1 + pype/modules/base.py | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/pype/modules/__init__.py b/pype/modules/__init__.py index 32b7426ba5..aacd541e18 100644 --- a/pype/modules/__init__.py +++ b/pype/modules/__init__.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from .base import PypeModule __all__ = ( diff --git a/pype/modules/base.py b/pype/modules/base.py index ede2f41bd5..ee90aa4cbb 100644 --- a/pype/modules/base.py +++ b/pype/modules/base.py @@ -1,10 +1,19 @@ +# -*- coding: utf-8 -*- +"""Base class for Pype Modules.""" from uuid import uuid4 -from abc import ABC +from abc import ABC, abstractmethod from pype.api import Logger class PypeModule(ABC): - """Base class of pype module.""" + """Base class of pype module. + + Attributes: + id (UUID): Module id. + enabled (bool): Is module enabled. + name (str): Module name. + """ + enabled = False name = None _id = None @@ -23,5 +32,7 @@ class PypeModule(ABC): def id(self): return self._id + @abstractmethod def startup_environments(self): + """Get startup environments for module.""" return {} From c2d8868ac043bf1a041510d15d6696bb9848074f Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 22 Sep 2020 15:25:46 +0100 Subject: [PATCH 09/95] FIx missing update of frame range. --- pype/plugins/maya/load/load_image_plane.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pype/plugins/maya/load/load_image_plane.py b/pype/plugins/maya/load/load_image_plane.py index 7d8ae27f89..e17382f7ed 100644 --- a/pype/plugins/maya/load/load_image_plane.py +++ b/pype/plugins/maya/load/load_image_plane.py @@ -1,7 +1,7 @@ import pymel.core as pc import maya.cmds as cmds -from avalon import api +from avalon import api, io from avalon.maya.pipeline import containerise from avalon.maya import lib from Qt import QtWidgets @@ -147,6 +147,17 @@ class ImagePlaneLoader(api.Loader): type="string" ) + # Set frame range. + version = io.find_one({"_id": representation["parent"]}) + subset = io.find_one({"_id": version["parent"]}) + asset = io.find_one({"_id": subset["parent"]}) + start_frame = asset["data"]["frameStart"] + end_frame = asset["data"]["frameEnd"] + image_plane_shape.frameOffset.set(1 - start_frame) + image_plane_shape.frameIn.set(start_frame) + image_plane_shape.frameOut.set(end_frame) + image_plane_shape.frameCache.set(end_frame) + def switch(self, container, representation): self.update(container, representation) From 40c8b3fd7975cd8972e7aa6f66c8473406a12072 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 22 Sep 2020 15:26:16 +0100 Subject: [PATCH 10/95] Fix missing frame range update. --- pype/plugins/maya/load/load_audio.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pype/plugins/maya/load/load_audio.py b/pype/plugins/maya/load/load_audio.py index ca38082ed0..81bcca48e1 100644 --- a/pype/plugins/maya/load/load_audio.py +++ b/pype/plugins/maya/load/load_audio.py @@ -1,7 +1,7 @@ from maya import cmds, mel import pymel.core as pc -from avalon import api +from avalon import api, io from avalon.maya.pipeline import containerise from avalon.maya import lib @@ -58,6 +58,13 @@ class AudioLoader(api.Loader): type="string" ) + # Set frame range. + version = io.find_one({"_id": representation["parent"]}) + subset = io.find_one({"_id": version["parent"]}) + asset = io.find_one({"_id": subset["parent"]}) + audio_node.sourceStart.set(1 - asset["data"]["frameStart"]) + audio_node.sourceEnd.set(asset["data"]["frameEnd"]) + def switch(self, container, representation): self.update(container, representation) From 1c8709b07559fb8d7da45863d4c2d4ce2892a200 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 23 Sep 2020 12:30:53 +0200 Subject: [PATCH 11/95] implemented basic value type validations to not crash gui when different type is loaded from settings --- .../settings/settings/widgets/item_types.py | 117 ++++++++++++++++-- 1 file changed, 110 insertions(+), 7 deletions(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index e589b89c0f..58263175cc 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -1,5 +1,4 @@ import json -import logging import collections from Qt import QtWidgets, QtCore, QtGui from .widgets import ( @@ -9,9 +8,28 @@ from .widgets import ( GridLabelWidget ) from .lib import NOT_SET, METADATA_KEY, TypeToKlass, CHILD_OFFSET +from pype.api import Logger from avalon.vendor import qtawesome +class InvalidValueType(Exception): + msg_template = "{}" + + def __init__(self, valid_types, invalid_type, key): + msg = "" + if key: + msg += "Key \"{}\". ".format(key) + + joined_types = ", ".join( + [str(valid_type) for valid_type in valid_types] + ) + msg += "Got invalid type \"{}\". Expected: {}".format( + invalid_type, joined_types + ) + self.msg = msg + super(InvalidValueType, self).__init__(msg) + + class SettingObject: """Partially abstract class for Setting's item type workflow.""" # `is_input_type` attribute says if has implemented item type methods @@ -27,6 +45,19 @@ class SettingObject: value_changed = None # Item will expand to full width in grid layout expand_in_grid = False + # types that are valid for `set_value` method + valid_value_types = tuple() + + def validate_value(self, value): + if not self.valid_value_types: + return + + for valid_type in self.valid_value_types: + if isinstance(value, valid_type): + return + + key = getattr(self, "key", None) + raise InvalidValueType(self.valid_value_types, type(value), key) def _set_default_attributes(self): """Create and reset attributes required for all item types. @@ -109,7 +140,7 @@ class SettingObject: def log(self): """Auto created logger for debugging.""" if self._log is None: - self._log = logging.getLogger(self.__class__.__name__) + self._log = Logger().get_logger(self.__class__.__name__) return self._log @property @@ -564,7 +595,7 @@ class InputObject(SettingObject): self._is_modified = False value = NOT_SET - if self._as_widget: + if self.as_widget: value = parent_values elif parent_values is not NOT_SET: value = parent_values.get(self.key, NOT_SET) @@ -589,7 +620,10 @@ class InputObject(SettingObject): self.default_value = value self._has_studio_override = False self._had_studio_override = False - self.set_value(value) + try: + self.set_value(value) + except InvalidValueType as exc: + self.log.warning(exc.msg) def update_studio_values(self, parent_values): self._state = None @@ -605,12 +639,17 @@ class InputObject(SettingObject): if value is not NOT_SET: self._has_studio_override = True self._had_studio_override = True - self.set_value(value) else: self._has_studio_override = False self._had_studio_override = False - self.set_value(self.default_value) + value = self.default_value + + try: + self.set_value(value) + except InvalidValueType as exc: + self.studio_value = NOT_SET + self.log.warning(exc.msg) def apply_overrides(self, parent_values): self._is_modified = False @@ -637,7 +676,11 @@ class InputObject(SettingObject): self._was_overriden = True value = override_value - self.set_value(value) + try: + self.set_value(value) + except InvalidValueType as exc: + self.override_value = NOT_SET + self.log.warning(exc.msg) def _on_value_change(self, item=None): if self.ignore_value_changes: @@ -753,6 +796,7 @@ class InputObject(SettingObject): class BooleanWidget(QtWidgets.QWidget, InputObject): default_input_value = True value_changed = QtCore.Signal(object) + valid_value_types = (bool, ) def __init__( self, input_data, parent, @@ -791,6 +835,7 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): def set_value(self, value): # Ignore value change because if `self.isChecked()` has same # value as `value` the `_on_value_change` is not triggered + self.validate_value(value) self.checkbox.setChecked(value) def update_style(self): @@ -831,6 +876,7 @@ class NumberWidget(QtWidgets.QWidget, InputObject): default_input_value = 0 value_changed = QtCore.Signal(object) input_modifiers = ("minimum", "maximum", "decimal") + valid_value_types = (int, float) def __init__( self, input_data, parent, @@ -868,6 +914,7 @@ class NumberWidget(QtWidgets.QWidget, InputObject): self.input_field.valueChanged.connect(self._on_value_change) def set_value(self, value): + self.validate_value(value) self.input_field.setValue(value) def update_style(self): @@ -908,6 +955,7 @@ class NumberWidget(QtWidgets.QWidget, InputObject): class TextWidget(QtWidgets.QWidget, InputObject): default_input_value = "" value_changed = QtCore.Signal(object) + valid_value_types = (int, str) def __init__( self, input_data, parent, @@ -953,6 +1001,7 @@ class TextWidget(QtWidgets.QWidget, InputObject): self.text_input.textChanged.connect(self._on_value_change) def set_value(self, value): + self.validate_value(value) if self.multiline: self.text_input.setPlainText(value) else: @@ -1000,6 +1049,7 @@ class TextWidget(QtWidgets.QWidget, InputObject): class PathInputWidget(QtWidgets.QWidget, InputObject): default_input_value = "" value_changed = QtCore.Signal(object) + valid_value_types = (str, ) def __init__( self, input_data, parent, @@ -1030,6 +1080,7 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): self.path_input.textChanged.connect(self._on_value_change) def set_value(self, value): + self.validate_value(value) self.path_input.setText(value) def focusOutEvent(self, event): @@ -1102,6 +1153,7 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): def set_value(self, value): if value is NOT_SET: value = "" + elif not isinstance(value, str): try: value = json.dumps(value, indent=4) @@ -1127,6 +1179,7 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): class RawJsonWidget(QtWidgets.QWidget, InputObject): default_input_value = "{}" value_changed = QtCore.Signal(object) + valid_value_types = (str, dict, list, type(NOT_SET)) def __init__( self, input_data, parent, @@ -1166,6 +1219,7 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): return super(RawJsonWidget, self).update_studio_values(parent_values) def set_value(self, value): + self.validate_value(value) self.text_input.set_value(value) def _on_value_change(self, *args, **kwargs): @@ -1395,6 +1449,7 @@ class ListItem(QtWidgets.QWidget, SettingObject): class ListWidget(QtWidgets.QWidget, InputObject): default_input_value = [] value_changed = QtCore.Signal(object) + valid_value_types = (list, ) def __init__( self, input_data, parent, @@ -1446,6 +1501,8 @@ class ListWidget(QtWidgets.QWidget, InputObject): self.hierarchical_style_update() def set_value(self, value): + self.validate_value(value) + previous_inputs = tuple(self.input_fields) for item_value in value: self.add_row(value=item_value) @@ -1631,6 +1688,7 @@ class ListWidget(QtWidgets.QWidget, InputObject): class ListStrictWidget(QtWidgets.QWidget, InputObject): value_changed = QtCore.Signal(object) _default_input_value = None + valid_value_types = (list, ) def __init__( self, input_data, parent, @@ -1750,6 +1808,8 @@ class ListStrictWidget(QtWidgets.QWidget, InputObject): return self._default_input_value def set_value(self, value): + self.validate_value(value) + if self._is_overriden: method_name = "apply_overrides" elif not self._has_studio_override: @@ -1985,6 +2045,7 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): # TODO this is actually input field (do not care if is group or not) value_changed = QtCore.Signal(object) expand_in_grid = True + valid_value_types = (dict, ) def __init__( self, input_data, parent, @@ -2061,6 +2122,8 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): return len(self.input_fields) def set_value(self, value): + self.validate_value(value) + previous_inputs = tuple(self.input_fields) for item_key, item_value in value.items(): self.add_row(key=item_key, value=item_value) @@ -2236,6 +2299,7 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): class DictWidget(QtWidgets.QWidget, SettingObject): value_changed = QtCore.Signal(object) expand_in_grid = True + valid_value_types = (dict, type(NOT_SET)) def __init__( self, input_data, parent, @@ -2414,6 +2478,12 @@ class DictWidget(QtWidgets.QWidget, SettingObject): elif parent_values is not NOT_SET: value = parent_values.get(self.key, NOT_SET) + try: + self.validate_value(value) + except InvalidValueType as exc: + value = NOT_SET + self.log.warning(exc.msg) + for item in self.input_fields: item.update_default_values(value) @@ -2434,6 +2504,14 @@ class DictWidget(QtWidgets.QWidget, SettingObject): self._had_studio_override = bool(self._has_studio_override) + try: + self.validate_value(value) + except InvalidValueType as exc: + value = NOT_SET + self._has_studio_override = False + self._had_studio_override = False + self.log.warning(exc.msg) + for item in self.input_fields: item.update_studio_values(value) @@ -2453,6 +2531,12 @@ class DictWidget(QtWidgets.QWidget, SettingObject): self._is_overriden = self.key in groups + try: + self.validate_value(override_values) + except InvalidValueType as exc: + override_values = NOT_SET + self.log.warning(exc.msg) + for item in self.input_fields: item.apply_overrides(override_values) @@ -2618,6 +2702,7 @@ class DictInvisible(QtWidgets.QWidget, SettingObject): value_changed = QtCore.Signal(object) allow_actions = False expand_in_grid = True + valid_value_types = (dict, type(NOT_SET)) def __init__( self, input_data, parent, @@ -2788,6 +2873,12 @@ class DictInvisible(QtWidgets.QWidget, SettingObject): elif parent_values is not NOT_SET: value = parent_values.get(self.key, NOT_SET) + try: + self.validate_value(value) + except InvalidValueType as exc: + value = NOT_SET + self.log.warning(exc.msg) + for item in self.input_fields: item.update_default_values(value) @@ -2796,6 +2887,12 @@ class DictInvisible(QtWidgets.QWidget, SettingObject): if parent_values is not NOT_SET: value = parent_values.get(self.key, NOT_SET) + try: + self.validate_value(value) + except InvalidValueType as exc: + value = NOT_SET + self.log.warning(exc.msg) + for item in self.input_fields: item.update_studio_values(value) @@ -2814,6 +2911,12 @@ class DictInvisible(QtWidgets.QWidget, SettingObject): self._is_overriden = self.key in groups + try: + self.validate_value(override_values) + except InvalidValueType as exc: + override_values = NOT_SET + self.log.warning(exc.msg) + for item in self.input_fields: item.apply_overrides(override_values) From 2c360a99c7642376ce95551c29f8bd8427157f64 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 23 Sep 2020 15:18:00 +0200 Subject: [PATCH 12/95] invalid default value is also marked as bad and modified --- pype/tools/settings/settings/widgets/item_types.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 58263175cc..2ad18001b7 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -623,6 +623,8 @@ class InputObject(SettingObject): try: self.set_value(value) except InvalidValueType as exc: + self.default_value = NOT_SET + self.defaults_not_set = True self.log.warning(exc.msg) def update_studio_values(self, parent_values): @@ -2530,6 +2532,8 @@ class DictWidget(QtWidgets.QWidget, SettingObject): override_values = parent_values.get(self.key, override_values) self._is_overriden = self.key in groups + else: + override_values = parent_values try: self.validate_value(override_values) @@ -2868,7 +2872,7 @@ class DictInvisible(QtWidgets.QWidget, SettingObject): def update_default_values(self, parent_values): value = NOT_SET - if self._as_widget: + if self.as_widget: value = parent_values elif parent_values is not NOT_SET: value = parent_values.get(self.key, NOT_SET) From 2e8f5ee55cf460e118d16647af34918f43123751 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 24 Sep 2020 12:47:08 +0200 Subject: [PATCH 13/95] collect anatomy instance data plugin converted to context plugin --- pype/plugins/global/publish/collect_anatomy_instance_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/plugins/global/publish/collect_anatomy_instance_data.py b/pype/plugins/global/publish/collect_anatomy_instance_data.py index 44a4d43946..455b44c4f1 100644 --- a/pype/plugins/global/publish/collect_anatomy_instance_data.py +++ b/pype/plugins/global/publish/collect_anatomy_instance_data.py @@ -28,7 +28,7 @@ from avalon import io import pyblish.api -class CollectAnatomyInstanceData(pyblish.api.InstancePlugin): +class CollectAnatomyInstanceData(pyblish.api.ContextPlugin): """Collect Instance specific Anatomy data.""" order = pyblish.api.CollectorOrder + 0.49 From 2831f3f4b4cde563fcb0da7690b528b0f0c221f6 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 24 Sep 2020 12:48:18 +0200 Subject: [PATCH 14/95] collecting was separated to 3 parts with only 3 calls to mongo database --- .../publish/collect_anatomy_instance_data.py | 315 +++++++++++++----- 1 file changed, 224 insertions(+), 91 deletions(-) diff --git a/pype/plugins/global/publish/collect_anatomy_instance_data.py b/pype/plugins/global/publish/collect_anatomy_instance_data.py index 455b44c4f1..446f671b86 100644 --- a/pype/plugins/global/publish/collect_anatomy_instance_data.py +++ b/pype/plugins/global/publish/collect_anatomy_instance_data.py @@ -23,123 +23,256 @@ Provides: import copy import json +import collections from avalon import io import pyblish.api class CollectAnatomyInstanceData(pyblish.api.ContextPlugin): - """Collect Instance specific Anatomy data.""" + """Collect Instance specific Anatomy data. + + Plugin is running for all instances on context even not active instances. + """ order = pyblish.api.CollectorOrder + 0.49 label = "Collect Anatomy Instance data" - def process(self, instance): - # get all the stuff from the database - anatomy_data = copy.deepcopy(instance.context.data["anatomyData"]) - project_entity = instance.context.data["projectEntity"] - context_asset_entity = instance.context.data["assetEntity"] - instance_asset_entity = instance.data.get("assetEntity") + def process(self, context): + self.log.info("Collecting anatomy data for all instances.") - asset_name = instance.data["asset"] + self.fill_missing_asset_docs(context) + self.fill_latest_versions(context) + self.fill_anatomy_data(context) - # There is possibility that assetEntity on instance is already set - # which can happen in standalone publisher - if ( - instance_asset_entity - and instance_asset_entity["name"] == asset_name - ): - asset_entity = instance_asset_entity + self.log.info("Anatomy Data collection finished.") - # Check if asset name is the same as what is in context - # - they may be different, e.g. in NukeStudio - elif context_asset_entity["name"] == asset_name: - asset_entity = context_asset_entity + def fill_missing_asset_docs(self, context): + self.log.debug("Qeurying asset documents for instances.") - else: - asset_entity = io.find_one({ - "type": "asset", - "name": asset_name, - "parent": project_entity["_id"] - }) + context_asset_doc = context.data["assetEntity"] - subset_name = instance.data["subset"] - version_number = instance.data.get("version") - latest_version = None + instances_with_missing_asset_doc = collections.defaultdict(list) + for instance in context: + instance_asset_doc = instance.data.get("assetEntity") + _asset_name = instance.data["asset"] - if asset_entity: - subset_entity = io.find_one({ - "type": "subset", - "name": subset_name, - "parent": asset_entity["_id"] - }) + # There is possibility that assetEntity on instance is already set + # which can happen in standalone publisher + if ( + instance_asset_doc + and instance_asset_doc["name"] == _asset_name + ): + continue + + # Check if asset name is the same as what is in context + # - they may be different, e.g. in NukeStudio + if context_asset_doc["name"] == _asset_name: + instance.data["assetEntity"] = context_asset_doc - if subset_entity is None: - self.log.debug("Subset entity does not exist yet.") else: - version_entity = io.find_one( - { - "type": "version", - "parent": subset_entity["_id"] - }, - sort=[("name", -1)] - ) - if version_entity: - latest_version = version_entity["name"] + instances_with_missing_asset_doc[_asset_name].append(instance) - # If version is not specified for instance or context - if version_number is None: - # TODO we should be able to change default version by studio - # preferences (like start with version number `0`) - version_number = 1 - # use latest version (+1) if already any exist - if latest_version is not None: - version_number += int(latest_version) + if not instances_with_missing_asset_doc: + self.log.debug("All instances already had right asset document.") + return - anatomy_updates = { - "asset": asset_name, - "family": instance.data["family"], - "subset": subset_name, - "version": version_number + asset_names = list(instances_with_missing_asset_doc.keys()) + self.log.debug("Querying asset documents with names: {}".format( + ", ".join(["\"{}\"".format(name) for name in asset_names]) + )) + asset_docs = io.find({ + "type": "asset", + "name": {"$in": asset_names} + }) + asset_docs_by_name = { + asset_doc["name"]: asset_doc + for asset_doc in asset_docs } - if ( - asset_entity - and asset_entity["_id"] != context_asset_entity["_id"] - ): - parents = asset_entity["data"].get("parents") or list() - anatomy_updates["hierarchy"] = "/".join(parents) - task_name = instance.data.get("task") - if task_name: - anatomy_updates["task"] = task_name + not_found_asset_names = [] + for asset_name, instances in instances_with_missing_asset_doc.items(): + asset_doc = asset_docs_by_name.get(asset_name) + if not asset_doc: + not_found_asset_names.append(asset_name) + continue - # Version should not be collected since may be instance - anatomy_data.update(anatomy_updates) + for _instance in instances: + _instance.data["assetEntity"] = asset_doc - resolution_width = instance.data.get("resolutionWidth") - if resolution_width: - anatomy_data["resolution_width"] = resolution_width + if not_found_asset_names: + joined_asset_names = ", ".join( + ["\"{}\"".format(name) for name in not_found_asset_names] + ) + self.log.warning(( + "Not found asset documents with names \"{}\"." + ).format(joined_asset_names)) - resolution_height = instance.data.get("resolutionHeight") - if resolution_height: - anatomy_data["resolution_height"] = resolution_height + def fill_latest_versions(self, context): + """Try to find latest version for each instance's subset. - pixel_aspect = instance.data.get("pixelAspect") - if pixel_aspect: - anatomy_data["pixel_aspect"] = float("{:0.2f}".format( - float(pixel_aspect))) + Key "latestVersion" is always set to latest version or `None`. - fps = instance.data.get("fps") - if fps: - anatomy_data["fps"] = float("{:0.2f}".format( - float(fps))) + Args: + context (pyblish.Context) - instance.data["projectEntity"] = project_entity - instance.data["assetEntity"] = asset_entity - instance.data["anatomyData"] = anatomy_data - instance.data["latestVersion"] = latest_version - # TODO should be version number set here? - instance.data["version"] = version_number + Returns: + None - self.log.info("Instance anatomy Data collected") - self.log.debug(json.dumps(anatomy_data, indent=4)) + """ + self.log.debug("Qeurying latest versions for instances.") + + hierarchy = {} + subset_names = set() + asset_ids = set() + for instance in context: + # Make sure `"latestVersion"` key is set + latest_version = instance.data.get("latestVersion") + instance.data["latestVersion"] = latest_version + + # Skip instances withou "assetEntity" + asset_doc = instance.data.get("assetEntity") + if not asset_doc: + continue + + # Store asset ids and subset names for queries + asset_id = asset_doc["_id"] + subset_name = instance.data["subset"] + asset_ids.add(asset_id) + subset_names.add(subset_name) + + # Prepare instance hiearchy for faster filling latest versions + if asset_id not in hierarchy: + hierarchy[asset_id] = {} + if subset_name not in hierarchy[asset_id]: + hierarchy[asset_id][subset_name] = [] + hierarchy[asset_id][subset_name].append(instance) + + subset_docs = list(io.find({ + "type": "subset", + "parent": {"$in": list(asset_ids)}, + "name": {"$in": list(subset_names)} + })) + + subset_ids = [ + subset_doc["_id"] + for subset_doc in subset_docs + ] + + last_version_by_subset_id = self._query_last_versions(subset_ids) + for subset_doc in subset_docs: + subset_id = subset_doc["_id"] + last_version = last_version_by_subset_id.get(subset_id) + if last_version is None: + continue + + asset_id = subset_doc["parent"] + subset_name = subset_doc["name"] + _instances = hierarchy[asset_id][subset_name] + for _instance in _instances: + _instance.data["latestVersion"] = last_version + + def _query_last_versions(self, subset_ids): + """Retrieve all latest versions for entered subset_ids. + + Args: + subset_ids (list): List of subset ids with type `ObjectId`. + + Returns: + dict: Key is subset id and value is last version name. + """ + _pipeline = [ + # Find all versions of those subsets + {"$match": { + "type": "version", + "parent": {"$in": subset_ids} + }}, + # Sorting versions all together + {"$sort": {"name": 1}}, + # Group them by "parent", but only take the last + {"$group": { + "_id": "$parent", + "_version_id": {"$last": "$_id"}, + "name": {"$last": "$name"} + }} + ] + + last_version_by_subset_id = {} + for doc in io.aggregate(_pipeline): + subset_id = doc["_id"] + last_version_by_subset_id[subset_id] = doc["name"] + + return last_version_by_subset_id + + def fill_anatomy_data(self, context): + self.log.debug("Storing anatomy data to instance data.") + + project_doc = context.data["projectEntity"] + context_asset_doc = context.data["assetEntity"] + + for instance in context: + version_number = instance.data.get("version") + # If version is not specified for instance or context + if version_number is None: + # TODO we should be able to change default version by studio + # preferences (like start with version number `0`) + version_number = 1 + # use latest version (+1) if already any exist + latest_version = instance.data["latestVersion"] + if latest_version is not None: + version_number += int(latest_version) + + anatomy_updates = { + "asset": instance.data["asset"], + "family": instance.data["family"], + "subset": instance.data["subset"], + "version": version_number + } + + # Hiearchy + asset_doc = instance.data.get("assetEntity") + if asset_doc and asset_doc["_id"] != context_asset_doc["_id"]: + parents = asset_doc["data"].get("parents") or list() + anatomy_updates["hierarchy"] = "/".join(parents) + + # Task + task_name = instance.data.get("task") + if task_name: + anatomy_updates["task"] = task_name + + # Additional data + resolution_width = instance.data.get("resolutionWidth") + if resolution_width: + anatomy_updates["resolution_width"] = resolution_width + + resolution_height = instance.data.get("resolutionHeight") + if resolution_height: + anatomy_updates["resolution_height"] = resolution_height + + pixel_aspect = instance.data.get("pixelAspect") + if pixel_aspect: + anatomy_updates["pixel_aspect"] = float( + "{:0.2f}".format(float(pixel_aspect)) + ) + + fps = instance.data.get("fps") + if fps: + anatomy_updates["fps"] = float("{:0.2f}".format(float(fps))) + + anatomy_data = copy.deepcopy(context.data["anatomyData"]) + anatomy_data.update(anatomy_updates) + + # Store anatomy data + instance.data["projectEntity"] = project_doc + instance.data["anatomyData"] = anatomy_data + instance.data["version"] = version_number + + # Log collected data + instance_name = instance.data["name"] + instance_label = instance.data.get("label") + if instance_label: + instance_name += "({})".format(instance_label) + self.log.debug("Anatomy data for instance {}: {}".format( + instance_name, + json.dumps(anatomy_data, indent=4) + )) From b0d1b9575177852d4bb14c819b52f031f0317647 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 24 Sep 2020 16:48:16 +0200 Subject: [PATCH 15/95] fix merge bug --- pype/tools/settings/settings/widgets/item_types.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 71516a1efc..addce2b6b5 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -2499,8 +2499,6 @@ class DictWidget(QtWidgets.QWidget, SettingObject): override_values = parent_values.get(self.key, override_values) self._is_overriden = self.key in groups - else: - override_values = parent_values try: self.validate_value(override_values) From 7104ac3fbce20b3bb2391e1db781d60b074d85e1 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 24 Sep 2020 17:30:08 +0200 Subject: [PATCH 16/95] rest api module is not using QThread for running but python's Thread --- pype/modules/rest_api/rest_api.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/pype/modules/rest_api/rest_api.py b/pype/modules/rest_api/rest_api.py index cc98b56a3b..3e0c646560 100644 --- a/pype/modules/rest_api/rest_api.py +++ b/pype/modules/rest_api/rest_api.py @@ -1,6 +1,6 @@ import os import socket -from Qt import QtCore +import threading from socketserver import ThreadingMixIn from http.server import HTTPServer @@ -155,14 +155,15 @@ class RestApiServer: def is_running(self): return self.rest_api_thread.is_running + def tray_exit(self): + self.stop() + def stop(self): - self.rest_api_thread.is_running = False - - def thread_stopped(self): - self._is_running = False + self.rest_api_thread.stop() + self.rest_api_thread.join() -class RestApiThread(QtCore.QThread): +class RestApiThread(threading.Thread): """ Listener for REST requests. It is possible to register callbacks for url paths. @@ -174,6 +175,12 @@ class RestApiThread(QtCore.QThread): self.is_running = False self.module = module self.port = port + self.httpd = None + + def stop(self): + self.is_running = False + if self.httpd: + self.httpd.server_close() def run(self): self.is_running = True @@ -185,12 +192,14 @@ class RestApiThread(QtCore.QThread): ) with ThreadingSimpleServer(("", self.port), Handler) as httpd: + self.httpd = httpd while self.is_running: httpd.handle_request() + except Exception: log.warning( "Rest Api Server service has failed", exc_info=True ) + self.httpd = None self.is_running = False - self.module.thread_stopped() From 2416d4d33f616dcf8f6c854e4cbad0e97961a753 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 25 Sep 2020 14:46:04 +0200 Subject: [PATCH 17/95] set port variable to None so the variable exists --- pype/modules/websocket_server/websocket_server.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pype/modules/websocket_server/websocket_server.py b/pype/modules/websocket_server/websocket_server.py index 1152c65e00..ec6785625a 100644 --- a/pype/modules/websocket_server/websocket_server.py +++ b/pype/modules/websocket_server/websocket_server.py @@ -31,6 +31,7 @@ class WebSocketServer(): self.client = None self.handlers = {} + port = None websocket_url = os.getenv("WEBSOCKET_URL") if websocket_url: parsed = urllib.parse.urlparse(websocket_url) From 64052aa44e8c159a2429d842e88d2fa3220fc124 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 25 Sep 2020 16:08:34 +0200 Subject: [PATCH 18/95] logging module without qt in globals --- pype/modules/logging/{ => tray}/gui/__init__.py | 0 pype/modules/logging/{ => tray}/gui/app.py | 0 pype/modules/logging/{ => tray}/gui/models.py | 0 pype/modules/logging/{ => tray}/gui/widgets.py | 0 pype/modules/logging/tray/logging_module.py | 8 +++++--- 5 files changed, 5 insertions(+), 3 deletions(-) rename pype/modules/logging/{ => tray}/gui/__init__.py (100%) rename pype/modules/logging/{ => tray}/gui/app.py (100%) rename pype/modules/logging/{ => tray}/gui/models.py (100%) rename pype/modules/logging/{ => tray}/gui/widgets.py (100%) diff --git a/pype/modules/logging/gui/__init__.py b/pype/modules/logging/tray/gui/__init__.py similarity index 100% rename from pype/modules/logging/gui/__init__.py rename to pype/modules/logging/tray/gui/__init__.py diff --git a/pype/modules/logging/gui/app.py b/pype/modules/logging/tray/gui/app.py similarity index 100% rename from pype/modules/logging/gui/app.py rename to pype/modules/logging/tray/gui/app.py diff --git a/pype/modules/logging/gui/models.py b/pype/modules/logging/tray/gui/models.py similarity index 100% rename from pype/modules/logging/gui/models.py rename to pype/modules/logging/tray/gui/models.py diff --git a/pype/modules/logging/gui/widgets.py b/pype/modules/logging/tray/gui/widgets.py similarity index 100% rename from pype/modules/logging/gui/widgets.py rename to pype/modules/logging/tray/gui/widgets.py diff --git a/pype/modules/logging/tray/logging_module.py b/pype/modules/logging/tray/logging_module.py index 9b26d5d9bf..a40ce90ea9 100644 --- a/pype/modules/logging/tray/logging_module.py +++ b/pype/modules/logging/tray/logging_module.py @@ -1,6 +1,4 @@ -from Qt import QtWidgets from pype.api import Logger -from ..gui.app import LogsWindow class LoggingModule: @@ -8,7 +6,11 @@ class LoggingModule: self.parent = parent self.log = Logger().get_logger(self.__class__.__name__, "logging") + self.tray_init(main_parent, parent) + + def tray_init(self, main_parent, parent): try: + from .gui.app import LogsWindow self.window = LogsWindow() self.tray_menu = self._tray_menu except Exception: @@ -18,9 +20,9 @@ class LoggingModule: # Definition of Tray menu def _tray_menu(self, parent_menu): + from Qt import QtWidgets # Menu for Tray App menu = QtWidgets.QMenu('Logging', parent_menu) - # menu.setProperty('submenu', 'on') show_action = QtWidgets.QAction("Show Logs", menu) show_action.triggered.connect(self.on_show_logs) From d67a8a5f833845f6fa077cea607eff51253bce94 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 25 Sep 2020 16:09:03 +0200 Subject: [PATCH 19/95] TimersManager is not singleton --- pype/modules/timers_manager/timers_manager.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/pype/modules/timers_manager/timers_manager.py b/pype/modules/timers_manager/timers_manager.py index 82ba1013f0..aeefddc75a 100644 --- a/pype/modules/timers_manager/timers_manager.py +++ b/pype/modules/timers_manager/timers_manager.py @@ -2,20 +2,7 @@ from .widget_user_idle import WidgetUserIdle, SignalHandler from pype.api import Logger, config -class Singleton(type): - """ Signleton implementation - """ - _instances = {} - - def __call__(cls, *args, **kwargs): - if cls not in cls._instances: - cls._instances[cls] = super( - Singleton, cls - ).__call__(*args, **kwargs) - return cls._instances[cls] - - -class TimersManager(metaclass=Singleton): +class TimersManager: """ Handles about Timers. Should be able to start/stop all timers at once. From 480acb9238eac4f183ae9f0a7022cb4250f27ed5 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 25 Sep 2020 16:09:30 +0200 Subject: [PATCH 20/95] timers manager has tray_init where all qt imports are done --- pype/modules/timers_manager/__init__.py | 1 - pype/modules/timers_manager/timers_manager.py | 10 +++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pype/modules/timers_manager/__init__.py b/pype/modules/timers_manager/__init__.py index a8a478d7ae..9de205f088 100644 --- a/pype/modules/timers_manager/__init__.py +++ b/pype/modules/timers_manager/__init__.py @@ -1,5 +1,4 @@ from .timers_manager import TimersManager -from .widget_user_idle import WidgetUserIdle CLASS_DEFINIION = TimersManager diff --git a/pype/modules/timers_manager/timers_manager.py b/pype/modules/timers_manager/timers_manager.py index aeefddc75a..62767c24f1 100644 --- a/pype/modules/timers_manager/timers_manager.py +++ b/pype/modules/timers_manager/timers_manager.py @@ -1,5 +1,4 @@ -from .widget_user_idle import WidgetUserIdle, SignalHandler -from pype.api import Logger, config +from pype.api import Logger class TimersManager: @@ -28,7 +27,13 @@ class TimersManager: self.idle_man = None self.signal_handler = None + + self.trat_init(tray_widget, main_widget) + + def trat_init(self, tray_widget, main_widget): + from .widget_user_idle import WidgetUserIdle, SignalHandler self.widget_user_idle = WidgetUserIdle(self, tray_widget) + self.signal_handler = SignalHandler(self) def set_signal_times(self): try: @@ -106,7 +111,6 @@ class TimersManager: """ if 'IdleManager' in modules: - self.signal_handler = SignalHandler(self) if self.set_signal_times() is True: self.register_to_idle_manager(modules['IdleManager']) From 903713c7497a36b699dbbc7e77dec0469a5013cb Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 25 Sep 2020 16:11:48 +0200 Subject: [PATCH 21/95] user module has also `tray_init` method for all Qt imports --- pype/modules/user/user_module.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pype/modules/user/user_module.py b/pype/modules/user/user_module.py index f2de9dc2fb..dc57fe4a63 100644 --- a/pype/modules/user/user_module.py +++ b/pype/modules/user/user_module.py @@ -3,8 +3,6 @@ import json import getpass import appdirs -from Qt import QtWidgets -from .widget_user import UserWidget from pype.api import Logger @@ -24,6 +22,12 @@ class UserModule: self.cred_path = os.path.normpath(os.path.join( self.cred_folder_path, self.cred_filename )) + self.widget_login = None + + self.tray_init(main_parent, parent) + + def tray_init(self, main_parent=None, parent=None): + from .widget_user import UserWidget self.widget_login = UserWidget(self) self.load_credentials() @@ -66,6 +70,7 @@ class UserModule: # Definition of Tray menu def tray_menu(self, parent_menu): + from Qt import QtWidgets """Add menu or action to Tray(or parent)'s menu""" action = QtWidgets.QAction("Username", parent_menu) action.triggered.connect(self.show_widget) @@ -121,7 +126,8 @@ class UserModule: self.cred = {"username": username} os.environ[self.env_name] = username - self.widget_login.set_user(username) + if self.widget_login: + self.widget_login.set_user(username) try: file = open(self.cred_path, "w") file.write(json.dumps(self.cred)) From 06b1501cacc27dd21a828851c66236ffeffd01cc Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 25 Sep 2020 16:11:58 +0200 Subject: [PATCH 22/95] small modification in logging module --- pype/modules/logging/tray/logging_module.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pype/modules/logging/tray/logging_module.py b/pype/modules/logging/tray/logging_module.py index a40ce90ea9..84b40f68e1 100644 --- a/pype/modules/logging/tray/logging_module.py +++ b/pype/modules/logging/tray/logging_module.py @@ -6,6 +6,8 @@ class LoggingModule: self.parent = parent self.log = Logger().get_logger(self.__class__.__name__, "logging") + self.window = None + self.tray_init(main_parent, parent) def tray_init(self, main_parent, parent): @@ -25,7 +27,7 @@ class LoggingModule: menu = QtWidgets.QMenu('Logging', parent_menu) show_action = QtWidgets.QAction("Show Logs", menu) - show_action.triggered.connect(self.on_show_logs) + show_action.triggered.connect(self._show_logs_gui) menu.addAction(show_action) parent_menu.addMenu(menu) @@ -36,5 +38,6 @@ class LoggingModule: def process_modules(self, modules): return - def on_show_logs(self): - self.window.show() + def _show_logs_gui(self): + if self.window: + self.window.show() From 0c92ca3808dce4adf017c72d329b9a4fb2c0cce7 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 25 Sep 2020 16:12:18 +0200 Subject: [PATCH 23/95] moved gui imports in standalone publisher from globals --- pype/modules/standalonepublish/standalonepublish_module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/modules/standalonepublish/standalonepublish_module.py b/pype/modules/standalonepublish/standalonepublish_module.py index ed997bfd9f..f8bc0c6f24 100644 --- a/pype/modules/standalonepublish/standalonepublish_module.py +++ b/pype/modules/standalonepublish/standalonepublish_module.py @@ -2,7 +2,6 @@ import os import sys import subprocess import pype -from pype import tools class StandAlonePublishModule: @@ -30,6 +29,7 @@ class StandAlonePublishModule: )) def show(self): + from pype import tools standalone_publisher_tool_path = os.path.join( os.path.dirname(tools.__file__), "standalonepublish" From bfb906f37ad1efcfc3d72768a12fb2841a9b583b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 30 Sep 2020 11:06:06 +0200 Subject: [PATCH 24/95] moved custom db connector to folder where is used --- .../custom_db_connector.py | 102 ++++++++---------- 1 file changed, 43 insertions(+), 59 deletions(-) rename pype/modules/ftrack/{lib => ftrack_server}/custom_db_connector.py (71%) diff --git a/pype/modules/ftrack/lib/custom_db_connector.py b/pype/modules/ftrack/ftrack_server/custom_db_connector.py similarity index 71% rename from pype/modules/ftrack/lib/custom_db_connector.py rename to pype/modules/ftrack/ftrack_server/custom_db_connector.py index d498d041dc..232481e6f4 100644 --- a/pype/modules/ftrack/lib/custom_db_connector.py +++ b/pype/modules/ftrack/ftrack_server/custom_db_connector.py @@ -16,9 +16,9 @@ import pymongo from pype.api import decompose_url -class NotActiveTable(Exception): +class NotActiveCollection(Exception): def __init__(self, *args, **kwargs): - msg = "Active table is not set. (This is bug)" + msg = "Active collection is not set. (This is bug)" if not (args or kwargs): args = [msg] super().__init__(*args, **kwargs) @@ -40,12 +40,12 @@ def auto_reconnect(func): return decorated -def check_active_table(func): +def check_active_collection(func): """Check if CustomDbConnector has active collection.""" @functools.wraps(func) def decorated(obj, *args, **kwargs): - if not obj.active_table: - raise NotActiveTable() + if not obj.active_collection: + raise NotActiveCollection() return func(obj, *args, **kwargs) return decorated @@ -55,7 +55,7 @@ class CustomDbConnector: timeout = int(os.environ["AVALON_TIMEOUT"]) def __init__( - self, uri, database_name, port=None, table_name=None + self, uri, database_name, port=None, collection_name=None ): self._mongo_client = None self._sentry_client = None @@ -76,10 +76,10 @@ class CustomDbConnector: self._port = port self._database_name = database_name - self.active_table = table_name + self.active_collection = collection_name def __getitem__(self, key): - # gives direct access to collection withou setting `active_table` + # gives direct access to collection withou setting `active_collection` return self._database[key] def __getattribute__(self, attr): @@ -88,9 +88,11 @@ class CustomDbConnector: try: return super(CustomDbConnector, self).__getattribute__(attr) except AttributeError: - if self.active_table is None: - raise NotActiveTable() - return self._database[self.active_table].__getattribute__(attr) + if self.active_collection is None: + raise NotActiveCollection() + return self._database[self.active_collection].__getattribute__( + attr + ) def install(self): """Establish a persistent connection to the database""" @@ -146,46 +148,28 @@ class CustomDbConnector: self._is_installed = False atexit.unregister(self.uninstall) - def create_table(self, name, **options): - if self.exist_table(name): + def collection_exists(self, collection_name): + return collection_name in self.collections() + + def create_collection(self, name, **options): + if self.collection_exists(name): return return self._database.create_collection(name, **options) - def exist_table(self, table_name): - return table_name in self.tables() - - def create_table(self, name, **options): - if self.exist_table(name): - return - - return self._database.create_collection(name, **options) - - def exist_table(self, table_name): - return table_name in self.tables() - - def tables(self): - """List available tables - Returns: - list of table names - """ - collection_names = self.collections() - for table_name in collection_names: - if table_name in ("system.indexes",): - continue - yield table_name - @auto_reconnect def collections(self): - return self._database.collection_names() + for col_name in self._database.collection_names(): + if col_name not in ("system.indexes",): + yield col_name - @check_active_table + @check_active_collection @auto_reconnect def insert_one(self, item, **options): assert isinstance(item, dict), "item must be of type " - return self._database[self.active_table].insert_one(item, **options) + return self._database[self.active_collection].insert_one(item, **options) - @check_active_table + @check_active_collection @auto_reconnect def insert_many(self, items, ordered=True, **options): # check if all items are valid @@ -194,72 +178,72 @@ class CustomDbConnector: assert isinstance(item, dict), "`item` must be of type " options["ordered"] = ordered - return self._database[self.active_table].insert_many(items, **options) + return self._database[self.active_collection].insert_many(items, **options) - @check_active_table + @check_active_collection @auto_reconnect def find(self, filter, projection=None, sort=None, **options): options["sort"] = sort - return self._database[self.active_table].find( + return self._database[self.active_collection].find( filter, projection, **options ) - @check_active_table + @check_active_collection @auto_reconnect def find_one(self, filter, projection=None, sort=None, **options): assert isinstance(filter, dict), "filter must be " options["sort"] = sort - return self._database[self.active_table].find_one( + return self._database[self.active_collection].find_one( filter, projection, **options ) - @check_active_table + @check_active_collection @auto_reconnect def replace_one(self, filter, replacement, **options): - return self._database[self.active_table].replace_one( + return self._database[self.active_collection].replace_one( filter, replacement, **options ) - @check_active_table + @check_active_collection @auto_reconnect def update_one(self, filter, update, **options): - return self._database[self.active_table].update_one( + return self._database[self.active_collection].update_one( filter, update, **options ) - @check_active_table + @check_active_collection @auto_reconnect def update_many(self, filter, update, **options): - return self._database[self.active_table].update_many( + return self._database[self.active_collection].update_many( filter, update, **options ) - @check_active_table + @check_active_collection @auto_reconnect def distinct(self, **options): - return self._database[self.active_table].distinct(**options) + return self._database[self.active_collection].distinct(**options) - @check_active_table + @check_active_collection @auto_reconnect def drop_collection(self, name_or_collection, **options): - return self._database[self.active_table].drop( + return self._database[self.active_collection].drop( name_or_collection, **options ) - @check_active_table + @check_active_collection @auto_reconnect def delete_one(self, filter, collation=None, **options): options["collation"] = collation - return self._database[self.active_table].delete_one( + return self._database[self.active_collection].delete_one( filter, **options ) - @check_active_table + @check_active_collection @auto_reconnect def delete_many(self, filter, collation=None, **options): options["collation"] = collation - return self._database[self.active_table].delete_many( + return self._database[self.active_collection].delete_many( filter, **options ) From b41f9ac8bc63c54f380c24780fe7ac10889afb80 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 30 Sep 2020 11:07:35 +0200 Subject: [PATCH 25/95] variables with table changed to collection --- pype/modules/ftrack/ftrack_server/lib.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pype/modules/ftrack/ftrack_server/lib.py b/pype/modules/ftrack/ftrack_server/lib.py index ee6b1216dc..3a1c742ae8 100644 --- a/pype/modules/ftrack/ftrack_server/lib.py +++ b/pype/modules/ftrack/ftrack_server/lib.py @@ -153,9 +153,9 @@ class StorerEventHub(SocketBaseEventHub): class ProcessEventHub(SocketBaseEventHub): hearbeat_msg = b"processor" - uri, port, database, table_name = get_ftrack_event_mongo_info() + uri, port, database, collection_name = get_ftrack_event_mongo_info() - is_table_created = False + is_collection_created = False pypelog = Logger().get_logger("Session Processor") def __init__(self, *args, **kwargs): @@ -163,7 +163,7 @@ class ProcessEventHub(SocketBaseEventHub): self.uri, self.database, self.port, - self.table_name + self.collection_name ) super(ProcessEventHub, self).__init__(*args, **kwargs) @@ -184,7 +184,7 @@ class ProcessEventHub(SocketBaseEventHub): "Error with Mongo access, probably permissions." "Check if exist database with name \"{}\"" " and collection \"{}\" inside." - ).format(self.database, self.table_name)) + ).format(self.database, self.collection_name)) self.sock.sendall(b"MongoError") sys.exit(0) From 15172d32e3295b2f404c18cdabb32eeac800e85c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 30 Sep 2020 11:12:23 +0200 Subject: [PATCH 26/95] modified imports inside ftrack module to be explicit --- pype/modules/ftrack/__init__.py | 12 +++++++++++- pype/modules/ftrack/ftrack_server/__init__.py | 6 ++++++ pype/modules/ftrack/ftrack_server/lib.py | 2 +- .../modules/ftrack/ftrack_server/sub_event_storer.py | 10 ++++++---- pype/modules/ftrack/lib/ftrack_base_handler.py | 6 +++--- pype/modules/ftrack/tray/login_dialog.py | 2 +- 6 files changed, 28 insertions(+), 10 deletions(-) diff --git a/pype/modules/ftrack/__init__.py b/pype/modules/ftrack/__init__.py index aa8f04bffb..fad771f084 100644 --- a/pype/modules/ftrack/__init__.py +++ b/pype/modules/ftrack/__init__.py @@ -1,2 +1,12 @@ -from .lib import * +from . import ftrack_server from .ftrack_server import FtrackServer, check_ftrack_url +from .lib import BaseHandler, BaseEvent, BaseAction + +__all__ = ( + "ftrack_server", + "FtrackServer", + "check_ftrack_url", + "BaseHandler", + "BaseEvent", + "BaseAction" +) diff --git a/pype/modules/ftrack/ftrack_server/__init__.py b/pype/modules/ftrack/ftrack_server/__init__.py index fcae4e0690..9e3920b500 100644 --- a/pype/modules/ftrack/ftrack_server/__init__.py +++ b/pype/modules/ftrack/ftrack_server/__init__.py @@ -1,2 +1,8 @@ from .ftrack_server import FtrackServer from .lib import check_ftrack_url + + +__all__ = ( + "FtrackServer", + "check_ftrack_url" +) diff --git a/pype/modules/ftrack/ftrack_server/lib.py b/pype/modules/ftrack/ftrack_server/lib.py index 3a1c742ae8..79b708b17a 100644 --- a/pype/modules/ftrack/ftrack_server/lib.py +++ b/pype/modules/ftrack/ftrack_server/lib.py @@ -26,7 +26,7 @@ from pype.api import ( compose_url ) -from pype.modules.ftrack.lib.custom_db_connector import CustomDbConnector +from .custom_db_connector import CustomDbConnector TOPIC_STATUS_SERVER = "pype.event.server.status" diff --git a/pype/modules/ftrack/ftrack_server/sub_event_storer.py b/pype/modules/ftrack/ftrack_server/sub_event_storer.py index 1635f6cea3..2f4395c8db 100644 --- a/pype/modules/ftrack/ftrack_server/sub_event_storer.py +++ b/pype/modules/ftrack/ftrack_server/sub_event_storer.py @@ -12,7 +12,9 @@ from pype.modules.ftrack.ftrack_server.lib import ( get_ftrack_event_mongo_info, TOPIC_STATUS_SERVER, TOPIC_STATUS_SERVER_RESULT ) -from pype.modules.ftrack.lib.custom_db_connector import CustomDbConnector +from pype.modules.ftrack.ftrack_server.custom_db_connector import ( + CustomDbConnector +) from pype.api import Logger log = Logger().get_logger("Event storer") @@ -23,8 +25,8 @@ class SessionFactory: session = None -uri, port, database, table_name = get_ftrack_event_mongo_info() -dbcon = CustomDbConnector(uri, database, port, table_name) +uri, port, database, collection_name = get_ftrack_event_mongo_info() +dbcon = CustomDbConnector(uri, database, port, collection_name) # ignore_topics = ["ftrack.meta.connected"] ignore_topics = [] @@ -200,7 +202,7 @@ def main(args): "Error with Mongo access, probably permissions." "Check if exist database with name \"{}\"" " and collection \"{}\" inside." - ).format(database, table_name)) + ).format(database, collection_name)) sock.sendall(b"MongoError") finally: diff --git a/pype/modules/ftrack/lib/ftrack_base_handler.py b/pype/modules/ftrack/lib/ftrack_base_handler.py index ce6607d6bf..d322fbaf23 100644 --- a/pype/modules/ftrack/lib/ftrack_base_handler.py +++ b/pype/modules/ftrack/lib/ftrack_base_handler.py @@ -2,7 +2,7 @@ import functools import time from pype.api import Logger import ftrack_api -from pype.modules.ftrack.ftrack_server.lib import SocketSession +from pype.modules.ftrack import ftrack_server class MissingPermision(Exception): @@ -41,7 +41,7 @@ class BaseHandler(object): self.log = Logger().get_logger(self.__class__.__name__) if not( isinstance(session, ftrack_api.session.Session) or - isinstance(session, SocketSession) + isinstance(session, ftrack_server.lib.SocketSession) ): raise Exception(( "Session object entered with args is instance of \"{}\"" @@ -49,7 +49,7 @@ class BaseHandler(object): ).format( str(type(session)), str(ftrack_api.session.Session), - str(SocketSession) + str(ftrack_server.lib.SocketSession) )) self._session = session diff --git a/pype/modules/ftrack/tray/login_dialog.py b/pype/modules/ftrack/tray/login_dialog.py index 7730ee1609..aeed82671f 100644 --- a/pype/modules/ftrack/tray/login_dialog.py +++ b/pype/modules/ftrack/tray/login_dialog.py @@ -1,7 +1,7 @@ import os import requests from avalon import style -from pype.modules.ftrack import credentials +from pype.modules.ftrack.lib import credentials from . import login_tools from pype.api import resources from Qt import QtCore, QtGui, QtWidgets From 689c483631a42dd39079bf02851e6e1f9d05225c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 30 Sep 2020 11:12:31 +0200 Subject: [PATCH 27/95] formatting changes --- pype/modules/ftrack/lib/avalon_sync.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pype/modules/ftrack/lib/avalon_sync.py b/pype/modules/ftrack/lib/avalon_sync.py index 03124ab10d..292ce752cf 100644 --- a/pype/modules/ftrack/lib/avalon_sync.py +++ b/pype/modules/ftrack/lib/avalon_sync.py @@ -1022,7 +1022,7 @@ class SyncEntitiesFactory: continue ent_path_items = [ent["name"] for ent in entity["link"]] - parents = ent_path_items[1:len(ent_path_items)-1:] + parents = ent_path_items[1:len(ent_path_items) - 1:] hierarchy = "" if len(parents) > 0: hierarchy = os.path.sep.join(parents) @@ -1141,7 +1141,7 @@ class SyncEntitiesFactory: if not is_right and not else_match_better: entity = entity_dict["entity"] ent_path_items = [ent["name"] for ent in entity["link"]] - parents = ent_path_items[1:len(ent_path_items)-1:] + parents = ent_path_items[1:len(ent_path_items) - 1:] av_parents = av_ent_by_mongo_id["data"]["parents"] if av_parents == parents: is_right = True From bb77c72b98d204b39d7d4bd953df289eeab5b18e Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 30 Sep 2020 11:30:21 +0200 Subject: [PATCH 28/95] fix thread stopping in ftrack login --- pype/modules/ftrack/tray/login_dialog.py | 2 ++ pype/modules/ftrack/tray/login_tools.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/pype/modules/ftrack/tray/login_dialog.py b/pype/modules/ftrack/tray/login_dialog.py index aeed82671f..94ad29e478 100644 --- a/pype/modules/ftrack/tray/login_dialog.py +++ b/pype/modules/ftrack/tray/login_dialog.py @@ -238,6 +238,8 @@ class CredentialsDialog(QtWidgets.QDialog): # If there is an existing server thread running we need to stop it. if self._login_server_thread: + if self._login_server_thread.isAlive(): + self._login_server_thread.stop() self._login_server_thread.join() self._login_server_thread = None diff --git a/pype/modules/ftrack/tray/login_tools.py b/pype/modules/ftrack/tray/login_tools.py index e7d22fbc19..d3297eaa76 100644 --- a/pype/modules/ftrack/tray/login_tools.py +++ b/pype/modules/ftrack/tray/login_tools.py @@ -61,12 +61,17 @@ class LoginServerThread(threading.Thread): def __init__(self, url, callback): self.url = url self.callback = callback + self._server = None super(LoginServerThread, self).__init__() def _handle_login(self, api_user, api_key): '''Login to server with *api_user* and *api_key*.''' self.callback(api_user, api_key) + def stop(self): + if self._server: + self._server.server_close() + def run(self): '''Listen for events.''' self._server = HTTPServer( From c9f381e60b6b1fc4956c1bfb718d49f8180c2478 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 30 Sep 2020 11:46:23 +0200 Subject: [PATCH 29/95] hound fixes --- pype/modules/ftrack/ftrack_server/custom_db_connector.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pype/modules/ftrack/ftrack_server/custom_db_connector.py b/pype/modules/ftrack/ftrack_server/custom_db_connector.py index 232481e6f4..8a8ba4ccbb 100644 --- a/pype/modules/ftrack/ftrack_server/custom_db_connector.py +++ b/pype/modules/ftrack/ftrack_server/custom_db_connector.py @@ -167,7 +167,9 @@ class CustomDbConnector: @auto_reconnect def insert_one(self, item, **options): assert isinstance(item, dict), "item must be of type " - return self._database[self.active_collection].insert_one(item, **options) + return self._database[self.active_collection].insert_one( + item, **options + ) @check_active_collection @auto_reconnect @@ -178,7 +180,9 @@ class CustomDbConnector: assert isinstance(item, dict), "`item` must be of type " options["ordered"] = ordered - return self._database[self.active_collection].insert_many(items, **options) + return self._database[self.active_collection].insert_many( + items, **options + ) @check_active_collection @auto_reconnect From f16d601a8a1c00d48404909662f90ed1010dd378 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 30 Sep 2020 12:22:17 +0200 Subject: [PATCH 30/95] changed default port to 8098 --- pype/modules/websocket_server/websocket_server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/modules/websocket_server/websocket_server.py b/pype/modules/websocket_server/websocket_server.py index ec6785625a..daf4b03103 100644 --- a/pype/modules/websocket_server/websocket_server.py +++ b/pype/modules/websocket_server/websocket_server.py @@ -37,7 +37,7 @@ class WebSocketServer(): parsed = urllib.parse.urlparse(websocket_url) port = parsed.port if not port: - port = 8099 # fallback + port = 8098 # fallback self.app = web.Application() From d384fb9a45afa0c0b065ed977eced85a6269002a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 30 Sep 2020 13:21:24 +0200 Subject: [PATCH 31/95] Qt is not used in avalon_apps module if tray_init is not triggered --- pype/modules/avalon_apps/avalon_app.py | 34 ++++++++++++++++++-------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/pype/modules/avalon_apps/avalon_app.py b/pype/modules/avalon_apps/avalon_app.py index 7ed651f82b..de10268304 100644 --- a/pype/modules/avalon_apps/avalon_app.py +++ b/pype/modules/avalon_apps/avalon_app.py @@ -1,16 +1,27 @@ -from Qt import QtWidgets -from avalon.tools import libraryloader from pype.api import Logger -from pype.tools.launcher import LauncherWindow, actions class AvalonApps: def __init__(self, main_parent=None, parent=None): self.log = Logger().get_logger(__name__) - self.main_parent = main_parent + + self.tray_init(main_parent, parent) + + def tray_init(self, main_parent, parent): + from avalon.tools.libraryloader import app + from avalon import style + from pype.tools.launcher import LauncherWindow, actions + self.parent = parent + self.main_parent = main_parent self.app_launcher = LauncherWindow() + self.libraryloader = app.Window( + icon=self.parent.icon, + show_projects=True, + show_libraries=True + ) + self.libraryloader.setStyleSheet(style.load_stylesheet()) # actions.register_default_actions() actions.register_config_actions() @@ -23,6 +34,7 @@ class AvalonApps: # Definition of Tray menu def tray_menu(self, parent_menu=None): + from Qt import QtWidgets # Actions if parent_menu is None: if self.parent is None: @@ -52,9 +64,11 @@ class AvalonApps: self.app_launcher.activateWindow() def show_library_loader(self): - libraryloader.show( - parent=self.main_parent, - icon=self.parent.icon, - show_projects=True, - show_libraries=True - ) + self.libraryloader.show() + + # Raise and activate the window + # for MacOS + self.libraryloader.raise_() + # for Windows + self.libraryloader.activateWindow() + self.libraryloader.refresh() From 7b93174d920d3f7f4dc582bdae75b155b19c64a7 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 30 Sep 2020 14:39:30 +0200 Subject: [PATCH 32/95] moved environments folder one level higher --- .../{system_settings => }/environments/avalon.json | 0 .../{system_settings => }/environments/blender.json | 3 ++- .../{system_settings => }/environments/celaction.json | 0 .../{system_settings => }/environments/deadline.json | 0 .../{system_settings => }/environments/ftrack.json | 0 .../{system_settings => }/environments/global.json | 6 +++--- .../{system_settings => }/environments/harmony.json | 0 .../{system_settings => }/environments/houdini.json | 0 .../defaults/{system_settings => }/environments/maya.json | 0 .../{system_settings => }/environments/maya_2018.json | 0 .../{system_settings => }/environments/maya_2020.json | 0 .../{system_settings => }/environments/mayabatch.json | 0 .../{system_settings => }/environments/mayabatch_2019.json | 0 .../{system_settings => }/environments/mtoa_3.1.1.json | 0 .../{system_settings => }/environments/muster.json | 0 .../defaults/{system_settings => }/environments/nuke.json | 0 .../{system_settings => }/environments/nukestudio.json | 0 .../environments/nukestudio_10.0.json | 0 .../defaults/{system_settings => }/environments/nukex.json | 0 .../{system_settings => }/environments/nukex_10.0.json | 0 pype/settings/defaults/environments/photoshop.json | 7 +++++++ .../{system_settings => }/environments/premiere.json | 0 .../{system_settings => }/environments/resolve.json | 0 .../{system_settings => }/environments/storyboardpro.json | 0 .../{system_settings => }/environments/unreal_4.24.json | 0 .../{system_settings => }/environments/vray_4300.json | 0 .../defaults/system_settings/environments/photoshop.json | 4 ---- 27 files changed, 12 insertions(+), 8 deletions(-) rename pype/settings/defaults/{system_settings => }/environments/avalon.json (100%) rename pype/settings/defaults/{system_settings => }/environments/blender.json (82%) rename pype/settings/defaults/{system_settings => }/environments/celaction.json (100%) rename pype/settings/defaults/{system_settings => }/environments/deadline.json (100%) rename pype/settings/defaults/{system_settings => }/environments/ftrack.json (100%) rename pype/settings/defaults/{system_settings => }/environments/global.json (91%) rename pype/settings/defaults/{system_settings => }/environments/harmony.json (100%) rename pype/settings/defaults/{system_settings => }/environments/houdini.json (100%) rename pype/settings/defaults/{system_settings => }/environments/maya.json (100%) rename pype/settings/defaults/{system_settings => }/environments/maya_2018.json (100%) rename pype/settings/defaults/{system_settings => }/environments/maya_2020.json (100%) rename pype/settings/defaults/{system_settings => }/environments/mayabatch.json (100%) rename pype/settings/defaults/{system_settings => }/environments/mayabatch_2019.json (100%) rename pype/settings/defaults/{system_settings => }/environments/mtoa_3.1.1.json (100%) rename pype/settings/defaults/{system_settings => }/environments/muster.json (100%) rename pype/settings/defaults/{system_settings => }/environments/nuke.json (100%) rename pype/settings/defaults/{system_settings => }/environments/nukestudio.json (100%) rename pype/settings/defaults/{system_settings => }/environments/nukestudio_10.0.json (100%) rename pype/settings/defaults/{system_settings => }/environments/nukex.json (100%) rename pype/settings/defaults/{system_settings => }/environments/nukex_10.0.json (100%) create mode 100644 pype/settings/defaults/environments/photoshop.json rename pype/settings/defaults/{system_settings => }/environments/premiere.json (100%) rename pype/settings/defaults/{system_settings => }/environments/resolve.json (100%) rename pype/settings/defaults/{system_settings => }/environments/storyboardpro.json (100%) rename pype/settings/defaults/{system_settings => }/environments/unreal_4.24.json (100%) rename pype/settings/defaults/{system_settings => }/environments/vray_4300.json (100%) delete mode 100644 pype/settings/defaults/system_settings/environments/photoshop.json diff --git a/pype/settings/defaults/system_settings/environments/avalon.json b/pype/settings/defaults/environments/avalon.json similarity index 100% rename from pype/settings/defaults/system_settings/environments/avalon.json rename to pype/settings/defaults/environments/avalon.json diff --git a/pype/settings/defaults/system_settings/environments/blender.json b/pype/settings/defaults/environments/blender.json similarity index 82% rename from pype/settings/defaults/system_settings/environments/blender.json rename to pype/settings/defaults/environments/blender.json index 6f4f6a012d..00a4070b8e 100644 --- a/pype/settings/defaults/system_settings/environments/blender.json +++ b/pype/settings/defaults/environments/blender.json @@ -3,5 +3,6 @@ "PYTHONPATH": [ "{PYPE_SETUP_PATH}/repos/avalon-core/setup/blender", "{PYTHONPATH}" - ] + ], + "CREATE_NEW_CONSOLE": "yes" } diff --git a/pype/settings/defaults/system_settings/environments/celaction.json b/pype/settings/defaults/environments/celaction.json similarity index 100% rename from pype/settings/defaults/system_settings/environments/celaction.json rename to pype/settings/defaults/environments/celaction.json diff --git a/pype/settings/defaults/system_settings/environments/deadline.json b/pype/settings/defaults/environments/deadline.json similarity index 100% rename from pype/settings/defaults/system_settings/environments/deadline.json rename to pype/settings/defaults/environments/deadline.json diff --git a/pype/settings/defaults/system_settings/environments/ftrack.json b/pype/settings/defaults/environments/ftrack.json similarity index 100% rename from pype/settings/defaults/system_settings/environments/ftrack.json rename to pype/settings/defaults/environments/ftrack.json diff --git a/pype/settings/defaults/system_settings/environments/global.json b/pype/settings/defaults/environments/global.json similarity index 91% rename from pype/settings/defaults/system_settings/environments/global.json rename to pype/settings/defaults/environments/global.json index ef528e6857..ba467d2f5d 100644 --- a/pype/settings/defaults/system_settings/environments/global.json +++ b/pype/settings/defaults/environments/global.json @@ -6,9 +6,9 @@ "PYPE_PROJECT_PLUGINS": "", "STUDIO_SOFT": "{PYP_SETUP_ROOT}/soft", "FFMPEG_PATH": { - "windows": "{VIRTUAL_ENV}/localized/ffmpeg_exec/windows/bin;{PYPE_SETUP_PATH}/vendor/ffmpeg_exec/windows/bin", - "darwin": "{VIRTUAL_ENV}/localized/ffmpeg_exec/darwin/bin:{PYPE_SETUP_PATH}/vendor/ffmpeg_exec/darwin/bin", - "linux": "{VIRTUAL_ENV}/localized/ffmpeg_exec/linux:{PYPE_SETUP_PATH}/vendor/ffmpeg_exec/linux" + "windows": "{VIRTUAL_ENV}/localized/ffmpeg_exec/windows/bin;{PYPE_SETUP_PATH}/vendor/bin/ffmpeg_exec/windows/bin", + "darwin": "{VIRTUAL_ENV}/localized/ffmpeg_exec/darwin/bin:{PYPE_SETUP_PATH}/vendor/bin/ffmpeg_exec/darwin/bin", + "linux": "{VIRTUAL_ENV}/localized/ffmpeg_exec/linux:{PYPE_SETUP_PATH}/vendor/bin/ffmpeg_exec/linux" }, "DJV_PATH": { "windows": [ diff --git a/pype/settings/defaults/system_settings/environments/harmony.json b/pype/settings/defaults/environments/harmony.json similarity index 100% rename from pype/settings/defaults/system_settings/environments/harmony.json rename to pype/settings/defaults/environments/harmony.json diff --git a/pype/settings/defaults/system_settings/environments/houdini.json b/pype/settings/defaults/environments/houdini.json similarity index 100% rename from pype/settings/defaults/system_settings/environments/houdini.json rename to pype/settings/defaults/environments/houdini.json diff --git a/pype/settings/defaults/system_settings/environments/maya.json b/pype/settings/defaults/environments/maya.json similarity index 100% rename from pype/settings/defaults/system_settings/environments/maya.json rename to pype/settings/defaults/environments/maya.json diff --git a/pype/settings/defaults/system_settings/environments/maya_2018.json b/pype/settings/defaults/environments/maya_2018.json similarity index 100% rename from pype/settings/defaults/system_settings/environments/maya_2018.json rename to pype/settings/defaults/environments/maya_2018.json diff --git a/pype/settings/defaults/system_settings/environments/maya_2020.json b/pype/settings/defaults/environments/maya_2020.json similarity index 100% rename from pype/settings/defaults/system_settings/environments/maya_2020.json rename to pype/settings/defaults/environments/maya_2020.json diff --git a/pype/settings/defaults/system_settings/environments/mayabatch.json b/pype/settings/defaults/environments/mayabatch.json similarity index 100% rename from pype/settings/defaults/system_settings/environments/mayabatch.json rename to pype/settings/defaults/environments/mayabatch.json diff --git a/pype/settings/defaults/system_settings/environments/mayabatch_2019.json b/pype/settings/defaults/environments/mayabatch_2019.json similarity index 100% rename from pype/settings/defaults/system_settings/environments/mayabatch_2019.json rename to pype/settings/defaults/environments/mayabatch_2019.json diff --git a/pype/settings/defaults/system_settings/environments/mtoa_3.1.1.json b/pype/settings/defaults/environments/mtoa_3.1.1.json similarity index 100% rename from pype/settings/defaults/system_settings/environments/mtoa_3.1.1.json rename to pype/settings/defaults/environments/mtoa_3.1.1.json diff --git a/pype/settings/defaults/system_settings/environments/muster.json b/pype/settings/defaults/environments/muster.json similarity index 100% rename from pype/settings/defaults/system_settings/environments/muster.json rename to pype/settings/defaults/environments/muster.json diff --git a/pype/settings/defaults/system_settings/environments/nuke.json b/pype/settings/defaults/environments/nuke.json similarity index 100% rename from pype/settings/defaults/system_settings/environments/nuke.json rename to pype/settings/defaults/environments/nuke.json diff --git a/pype/settings/defaults/system_settings/environments/nukestudio.json b/pype/settings/defaults/environments/nukestudio.json similarity index 100% rename from pype/settings/defaults/system_settings/environments/nukestudio.json rename to pype/settings/defaults/environments/nukestudio.json diff --git a/pype/settings/defaults/system_settings/environments/nukestudio_10.0.json b/pype/settings/defaults/environments/nukestudio_10.0.json similarity index 100% rename from pype/settings/defaults/system_settings/environments/nukestudio_10.0.json rename to pype/settings/defaults/environments/nukestudio_10.0.json diff --git a/pype/settings/defaults/system_settings/environments/nukex.json b/pype/settings/defaults/environments/nukex.json similarity index 100% rename from pype/settings/defaults/system_settings/environments/nukex.json rename to pype/settings/defaults/environments/nukex.json diff --git a/pype/settings/defaults/system_settings/environments/nukex_10.0.json b/pype/settings/defaults/environments/nukex_10.0.json similarity index 100% rename from pype/settings/defaults/system_settings/environments/nukex_10.0.json rename to pype/settings/defaults/environments/nukex_10.0.json diff --git a/pype/settings/defaults/environments/photoshop.json b/pype/settings/defaults/environments/photoshop.json new file mode 100644 index 0000000000..d39634ce20 --- /dev/null +++ b/pype/settings/defaults/environments/photoshop.json @@ -0,0 +1,7 @@ +{ + "AVALON_PHOTOSHOP_WORKFILES_ON_LAUNCH": "1", + "PYTHONPATH": "{PYTHONPATH}", + "PYPE_LOG_NO_COLORS": "Yes", + "WEBSOCKET_URL": "ws://localhost:8099/ws/", + "WORKFILES_SAVE_AS": "Yes" +} diff --git a/pype/settings/defaults/system_settings/environments/premiere.json b/pype/settings/defaults/environments/premiere.json similarity index 100% rename from pype/settings/defaults/system_settings/environments/premiere.json rename to pype/settings/defaults/environments/premiere.json diff --git a/pype/settings/defaults/system_settings/environments/resolve.json b/pype/settings/defaults/environments/resolve.json similarity index 100% rename from pype/settings/defaults/system_settings/environments/resolve.json rename to pype/settings/defaults/environments/resolve.json diff --git a/pype/settings/defaults/system_settings/environments/storyboardpro.json b/pype/settings/defaults/environments/storyboardpro.json similarity index 100% rename from pype/settings/defaults/system_settings/environments/storyboardpro.json rename to pype/settings/defaults/environments/storyboardpro.json diff --git a/pype/settings/defaults/system_settings/environments/unreal_4.24.json b/pype/settings/defaults/environments/unreal_4.24.json similarity index 100% rename from pype/settings/defaults/system_settings/environments/unreal_4.24.json rename to pype/settings/defaults/environments/unreal_4.24.json diff --git a/pype/settings/defaults/system_settings/environments/vray_4300.json b/pype/settings/defaults/environments/vray_4300.json similarity index 100% rename from pype/settings/defaults/system_settings/environments/vray_4300.json rename to pype/settings/defaults/environments/vray_4300.json diff --git a/pype/settings/defaults/system_settings/environments/photoshop.json b/pype/settings/defaults/system_settings/environments/photoshop.json deleted file mode 100644 index 2208a88665..0000000000 --- a/pype/settings/defaults/system_settings/environments/photoshop.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "AVALON_PHOTOSHOP_WORKFILES_ON_LAUNCH": "1", - "PYTHONPATH": "{PYTHONPATH}" -} From 68c10ab1ee47e9ddc408d7006c2562941f282963 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 30 Sep 2020 14:39:44 +0200 Subject: [PATCH 33/95] added launchers to pype --- .../defaults/launchers/blender_2.80.toml | 8 +++++ .../defaults/launchers/blender_2.81.toml | 9 ++++++ .../defaults/launchers/blender_2.82.toml | 9 ++++++ .../defaults/launchers/blender_2.83.toml | 9 ++++++ .../defaults/launchers/celaction_local.toml | 9 ++++++ .../defaults/launchers/celaction_publish.toml | 8 +++++ .../defaults/launchers/darwin/blender_2.82 | 2 ++ .../defaults/launchers/darwin/harmony_17 | 9 ++++++ .../launchers/darwin/harmony_17_launch | 5 ++++ .../defaults/launchers/darwin/python3 | 2 ++ .../defaults/launchers/harmony_17.toml | 9 ++++++ .../defaults/launchers/houdini_16.toml | 8 +++++ .../defaults/launchers/houdini_17.toml | 8 +++++ .../defaults/launchers/houdini_18.toml | 8 +++++ .../defaults/launchers/linux/maya2016 | 8 +++++ .../defaults/launchers/linux/maya2017 | 8 +++++ .../defaults/launchers/linux/maya2018 | 8 +++++ .../defaults/launchers/linux/maya2019 | 8 +++++ .../defaults/launchers/linux/maya2020 | 8 +++++ .../defaults/launchers/linux/nuke11.3 | 2 ++ .../defaults/launchers/linux/nuke12.0 | 2 ++ .../defaults/launchers/linux/nukestudio11.3 | 2 ++ .../defaults/launchers/linux/nukestudio12.0 | 2 ++ .../defaults/launchers/linux/nukex11.3 | 2 ++ .../defaults/launchers/linux/nukex12.0 | 2 ++ .../defaults/launchers/maya_2016.toml | 27 +++++++++++++++++ .../defaults/launchers/maya_2017.toml | 29 +++++++++++++++++++ .../defaults/launchers/maya_2018.toml | 15 ++++++++++ .../defaults/launchers/maya_2019.toml | 15 ++++++++++ .../defaults/launchers/maya_2020.toml | 15 ++++++++++ .../defaults/launchers/mayabatch_2019.toml | 17 +++++++++++ .../defaults/launchers/mayabatch_2020.toml | 17 +++++++++++ .../defaults/launchers/mayapy2016.toml | 17 +++++++++++ .../defaults/launchers/mayapy2017.toml | 17 +++++++++++ .../defaults/launchers/mayapy2018.toml | 17 +++++++++++ .../defaults/launchers/mayapy2019.toml | 17 +++++++++++ .../defaults/launchers/mayapy2020.toml | 17 +++++++++++ pype/settings/defaults/launchers/myapp.toml | 5 ++++ .../defaults/launchers/nuke_10.0.toml | 8 +++++ .../defaults/launchers/nuke_11.0.toml | 8 +++++ .../defaults/launchers/nuke_11.2.toml | 8 +++++ .../defaults/launchers/nuke_11.3.toml | 8 +++++ .../defaults/launchers/nuke_12.0.toml | 8 +++++ .../defaults/launchers/nukestudio_10.0.toml | 8 +++++ .../defaults/launchers/nukestudio_11.0.toml | 8 +++++ .../defaults/launchers/nukestudio_11.2.toml | 8 +++++ .../defaults/launchers/nukestudio_11.3.toml | 8 +++++ .../defaults/launchers/nukestudio_12.0.toml | 8 +++++ .../defaults/launchers/nukex_10.0.toml | 8 +++++ .../defaults/launchers/nukex_11.0.toml | 8 +++++ .../defaults/launchers/nukex_11.2.toml | 8 +++++ .../defaults/launchers/nukex_11.3.toml | 8 +++++ .../defaults/launchers/nukex_12.0.toml | 8 +++++ .../defaults/launchers/photoshop_2020.toml | 9 ++++++ .../defaults/launchers/premiere_2019.toml | 9 ++++++ .../defaults/launchers/premiere_2020.toml | 10 +++++++ .../settings/defaults/launchers/python_2.toml | 12 ++++++++ .../settings/defaults/launchers/python_3.toml | 12 ++++++++ .../defaults/launchers/resolve_16.toml | 10 +++++++ pype/settings/defaults/launchers/shell.toml | 7 +++++ .../defaults/launchers/storyboardpro_7.toml | 9 ++++++ .../defaults/launchers/unreal_4.24.toml | 10 +++++++ .../launchers/windows/blender_2.80.bat | 11 +++++++ .../launchers/windows/blender_2.81.bat | 11 +++++++ .../launchers/windows/blender_2.82.bat | 11 +++++++ .../launchers/windows/blender_2.83.bat | 11 +++++++ .../launchers/windows/celaction_local.bat | 19 ++++++++++++ .../launchers/windows/celaction_publish.bat | 3 ++ .../defaults/launchers/windows/harmony_17.bat | 13 +++++++++ .../defaults/launchers/windows/houdini_16.bat | 13 +++++++++ .../defaults/launchers/windows/houdini_17.bat | 13 +++++++++ .../defaults/launchers/windows/houdini_18.bat | 13 +++++++++ .../defaults/launchers/windows/maya2016.bat | 17 +++++++++++ .../defaults/launchers/windows/maya2017.bat | 17 +++++++++++ .../defaults/launchers/windows/maya2018.bat | 17 +++++++++++ .../defaults/launchers/windows/maya2019.bat | 17 +++++++++++ .../defaults/launchers/windows/maya2020.bat | 17 +++++++++++ .../launchers/windows/mayabatch2019.bat | 14 +++++++++ .../launchers/windows/mayabatch2020.bat | 14 +++++++++ .../defaults/launchers/windows/mayapy2016.bat | 13 +++++++++ .../defaults/launchers/windows/mayapy2017.bat | 13 +++++++++ .../defaults/launchers/windows/mayapy2018.bat | 13 +++++++++ .../defaults/launchers/windows/mayapy2019.bat | 13 +++++++++ .../defaults/launchers/windows/mayapy2020.bat | 13 +++++++++ .../defaults/launchers/windows/nuke10.0.bat | 13 +++++++++ .../defaults/launchers/windows/nuke11.0.bat | 13 +++++++++ .../defaults/launchers/windows/nuke11.2.bat | 13 +++++++++ .../defaults/launchers/windows/nuke11.3.bat | 13 +++++++++ .../defaults/launchers/windows/nuke12.0.bat | 13 +++++++++ .../launchers/windows/nukestudio10.0.bat | 13 +++++++++ .../launchers/windows/nukestudio11.0.bat | 13 +++++++++ .../launchers/windows/nukestudio11.2.bat | 13 +++++++++ .../launchers/windows/nukestudio11.3.bat | 13 +++++++++ .../launchers/windows/nukestudio12.0.bat | 13 +++++++++ .../defaults/launchers/windows/nukex10.0.bat | 13 +++++++++ .../defaults/launchers/windows/nukex11.0.bat | 13 +++++++++ .../defaults/launchers/windows/nukex11.2.bat | 13 +++++++++ .../defaults/launchers/windows/nukex11.3.bat | 13 +++++++++ .../defaults/launchers/windows/nukex12.0.bat | 13 +++++++++ .../launchers/windows/photoshop_2020.bat | 15 ++++++++++ .../launchers/windows/premiere_pro_2019.bat | 14 +++++++++ .../launchers/windows/premiere_pro_2020.bat | 13 +++++++++ .../defaults/launchers/windows/python3.bat | 13 +++++++++ .../defaults/launchers/windows/resolve_16.bat | 17 +++++++++++ .../defaults/launchers/windows/shell.bat | 2 ++ .../launchers/windows/storyboardpro_7.bat | 13 +++++++++ .../defaults/launchers/windows/unreal.bat | 11 +++++++ 107 files changed, 1177 insertions(+) create mode 100644 pype/settings/defaults/launchers/blender_2.80.toml create mode 100644 pype/settings/defaults/launchers/blender_2.81.toml create mode 100644 pype/settings/defaults/launchers/blender_2.82.toml create mode 100644 pype/settings/defaults/launchers/blender_2.83.toml create mode 100644 pype/settings/defaults/launchers/celaction_local.toml create mode 100644 pype/settings/defaults/launchers/celaction_publish.toml create mode 100644 pype/settings/defaults/launchers/darwin/blender_2.82 create mode 100644 pype/settings/defaults/launchers/darwin/harmony_17 create mode 100644 pype/settings/defaults/launchers/darwin/harmony_17_launch create mode 100644 pype/settings/defaults/launchers/darwin/python3 create mode 100644 pype/settings/defaults/launchers/harmony_17.toml create mode 100644 pype/settings/defaults/launchers/houdini_16.toml create mode 100644 pype/settings/defaults/launchers/houdini_17.toml create mode 100644 pype/settings/defaults/launchers/houdini_18.toml create mode 100644 pype/settings/defaults/launchers/linux/maya2016 create mode 100644 pype/settings/defaults/launchers/linux/maya2017 create mode 100644 pype/settings/defaults/launchers/linux/maya2018 create mode 100644 pype/settings/defaults/launchers/linux/maya2019 create mode 100644 pype/settings/defaults/launchers/linux/maya2020 create mode 100644 pype/settings/defaults/launchers/linux/nuke11.3 create mode 100644 pype/settings/defaults/launchers/linux/nuke12.0 create mode 100644 pype/settings/defaults/launchers/linux/nukestudio11.3 create mode 100644 pype/settings/defaults/launchers/linux/nukestudio12.0 create mode 100644 pype/settings/defaults/launchers/linux/nukex11.3 create mode 100644 pype/settings/defaults/launchers/linux/nukex12.0 create mode 100644 pype/settings/defaults/launchers/maya_2016.toml create mode 100644 pype/settings/defaults/launchers/maya_2017.toml create mode 100644 pype/settings/defaults/launchers/maya_2018.toml create mode 100644 pype/settings/defaults/launchers/maya_2019.toml create mode 100644 pype/settings/defaults/launchers/maya_2020.toml create mode 100644 pype/settings/defaults/launchers/mayabatch_2019.toml create mode 100644 pype/settings/defaults/launchers/mayabatch_2020.toml create mode 100644 pype/settings/defaults/launchers/mayapy2016.toml create mode 100644 pype/settings/defaults/launchers/mayapy2017.toml create mode 100644 pype/settings/defaults/launchers/mayapy2018.toml create mode 100644 pype/settings/defaults/launchers/mayapy2019.toml create mode 100644 pype/settings/defaults/launchers/mayapy2020.toml create mode 100644 pype/settings/defaults/launchers/myapp.toml create mode 100644 pype/settings/defaults/launchers/nuke_10.0.toml create mode 100644 pype/settings/defaults/launchers/nuke_11.0.toml create mode 100644 pype/settings/defaults/launchers/nuke_11.2.toml create mode 100644 pype/settings/defaults/launchers/nuke_11.3.toml create mode 100644 pype/settings/defaults/launchers/nuke_12.0.toml create mode 100644 pype/settings/defaults/launchers/nukestudio_10.0.toml create mode 100644 pype/settings/defaults/launchers/nukestudio_11.0.toml create mode 100644 pype/settings/defaults/launchers/nukestudio_11.2.toml create mode 100644 pype/settings/defaults/launchers/nukestudio_11.3.toml create mode 100644 pype/settings/defaults/launchers/nukestudio_12.0.toml create mode 100644 pype/settings/defaults/launchers/nukex_10.0.toml create mode 100644 pype/settings/defaults/launchers/nukex_11.0.toml create mode 100644 pype/settings/defaults/launchers/nukex_11.2.toml create mode 100644 pype/settings/defaults/launchers/nukex_11.3.toml create mode 100644 pype/settings/defaults/launchers/nukex_12.0.toml create mode 100644 pype/settings/defaults/launchers/photoshop_2020.toml create mode 100644 pype/settings/defaults/launchers/premiere_2019.toml create mode 100644 pype/settings/defaults/launchers/premiere_2020.toml create mode 100644 pype/settings/defaults/launchers/python_2.toml create mode 100644 pype/settings/defaults/launchers/python_3.toml create mode 100644 pype/settings/defaults/launchers/resolve_16.toml create mode 100644 pype/settings/defaults/launchers/shell.toml create mode 100644 pype/settings/defaults/launchers/storyboardpro_7.toml create mode 100644 pype/settings/defaults/launchers/unreal_4.24.toml create mode 100644 pype/settings/defaults/launchers/windows/blender_2.80.bat create mode 100644 pype/settings/defaults/launchers/windows/blender_2.81.bat create mode 100644 pype/settings/defaults/launchers/windows/blender_2.82.bat create mode 100644 pype/settings/defaults/launchers/windows/blender_2.83.bat create mode 100644 pype/settings/defaults/launchers/windows/celaction_local.bat create mode 100644 pype/settings/defaults/launchers/windows/celaction_publish.bat create mode 100644 pype/settings/defaults/launchers/windows/harmony_17.bat create mode 100644 pype/settings/defaults/launchers/windows/houdini_16.bat create mode 100644 pype/settings/defaults/launchers/windows/houdini_17.bat create mode 100644 pype/settings/defaults/launchers/windows/houdini_18.bat create mode 100644 pype/settings/defaults/launchers/windows/maya2016.bat create mode 100644 pype/settings/defaults/launchers/windows/maya2017.bat create mode 100644 pype/settings/defaults/launchers/windows/maya2018.bat create mode 100644 pype/settings/defaults/launchers/windows/maya2019.bat create mode 100644 pype/settings/defaults/launchers/windows/maya2020.bat create mode 100644 pype/settings/defaults/launchers/windows/mayabatch2019.bat create mode 100644 pype/settings/defaults/launchers/windows/mayabatch2020.bat create mode 100644 pype/settings/defaults/launchers/windows/mayapy2016.bat create mode 100644 pype/settings/defaults/launchers/windows/mayapy2017.bat create mode 100644 pype/settings/defaults/launchers/windows/mayapy2018.bat create mode 100644 pype/settings/defaults/launchers/windows/mayapy2019.bat create mode 100644 pype/settings/defaults/launchers/windows/mayapy2020.bat create mode 100644 pype/settings/defaults/launchers/windows/nuke10.0.bat create mode 100644 pype/settings/defaults/launchers/windows/nuke11.0.bat create mode 100644 pype/settings/defaults/launchers/windows/nuke11.2.bat create mode 100644 pype/settings/defaults/launchers/windows/nuke11.3.bat create mode 100644 pype/settings/defaults/launchers/windows/nuke12.0.bat create mode 100644 pype/settings/defaults/launchers/windows/nukestudio10.0.bat create mode 100644 pype/settings/defaults/launchers/windows/nukestudio11.0.bat create mode 100644 pype/settings/defaults/launchers/windows/nukestudio11.2.bat create mode 100644 pype/settings/defaults/launchers/windows/nukestudio11.3.bat create mode 100644 pype/settings/defaults/launchers/windows/nukestudio12.0.bat create mode 100644 pype/settings/defaults/launchers/windows/nukex10.0.bat create mode 100644 pype/settings/defaults/launchers/windows/nukex11.0.bat create mode 100644 pype/settings/defaults/launchers/windows/nukex11.2.bat create mode 100644 pype/settings/defaults/launchers/windows/nukex11.3.bat create mode 100644 pype/settings/defaults/launchers/windows/nukex12.0.bat create mode 100644 pype/settings/defaults/launchers/windows/photoshop_2020.bat create mode 100644 pype/settings/defaults/launchers/windows/premiere_pro_2019.bat create mode 100644 pype/settings/defaults/launchers/windows/premiere_pro_2020.bat create mode 100644 pype/settings/defaults/launchers/windows/python3.bat create mode 100644 pype/settings/defaults/launchers/windows/resolve_16.bat create mode 100644 pype/settings/defaults/launchers/windows/shell.bat create mode 100644 pype/settings/defaults/launchers/windows/storyboardpro_7.bat create mode 100644 pype/settings/defaults/launchers/windows/unreal.bat diff --git a/pype/settings/defaults/launchers/blender_2.80.toml b/pype/settings/defaults/launchers/blender_2.80.toml new file mode 100644 index 0000000000..88b5ea0c11 --- /dev/null +++ b/pype/settings/defaults/launchers/blender_2.80.toml @@ -0,0 +1,8 @@ +application_dir = "blender" +executable = "blender_2.80" +schema = "avalon-core:application-1.0" +label = "Blender" +label_variant = "2.80" +ftrack_label = "Blender" +icon = "app_icons/blender.png" +ftrack_icon = "{}/app_icons/blender.png" diff --git a/pype/settings/defaults/launchers/blender_2.81.toml b/pype/settings/defaults/launchers/blender_2.81.toml new file mode 100644 index 0000000000..072eaa8141 --- /dev/null +++ b/pype/settings/defaults/launchers/blender_2.81.toml @@ -0,0 +1,9 @@ +application_dir = "blender" +executable = "blender_2.81" +schema = "avalon-core:application-1.0" +label = "Blender" +label_variant = "2.81" +icon = "app_icons/blender.png" + +ftrack_label = "Blender" +ftrack_icon = '{}/app_icons/blender.png' diff --git a/pype/settings/defaults/launchers/blender_2.82.toml b/pype/settings/defaults/launchers/blender_2.82.toml new file mode 100644 index 0000000000..a485f790f1 --- /dev/null +++ b/pype/settings/defaults/launchers/blender_2.82.toml @@ -0,0 +1,9 @@ +application_dir = "blender" +executable = "blender_2.82" +schema = "avalon-core:application-1.0" +label = "Blender" +label_variant = "2.82" +icon = "app_icons/blender.png" + +ftrack_label = "Blender" +ftrack_icon = '{}/app_icons/blender.png' diff --git a/pype/settings/defaults/launchers/blender_2.83.toml b/pype/settings/defaults/launchers/blender_2.83.toml new file mode 100644 index 0000000000..0f98151d01 --- /dev/null +++ b/pype/settings/defaults/launchers/blender_2.83.toml @@ -0,0 +1,9 @@ +application_dir = "blender" +executable = "blender_2.83" +schema = "avalon-core:application-1.0" +label = "Blender" +label_variant = "2.83" +icon = "app_icons/blender.png" + +ftrack_label = "Blender" +ftrack_icon = '{}/app_icons/blender.png' diff --git a/pype/settings/defaults/launchers/celaction_local.toml b/pype/settings/defaults/launchers/celaction_local.toml new file mode 100644 index 0000000000..6cc5d4fa0e --- /dev/null +++ b/pype/settings/defaults/launchers/celaction_local.toml @@ -0,0 +1,9 @@ +executable = "celaction_local" +schema = "avalon-core:application-1.0" +application_dir = "celaction" +label = "CelAction2D" +icon = "app_icons/celaction_local.png" +launch_hook = "pype/hooks/celaction/prelaunch.py/CelactionPrelaunchHook" + +ftrack_label = "CelAction2D" +ftrack_icon = '{}/app_icons/celaction_local.png' diff --git a/pype/settings/defaults/launchers/celaction_publish.toml b/pype/settings/defaults/launchers/celaction_publish.toml new file mode 100644 index 0000000000..dc7ac82673 --- /dev/null +++ b/pype/settings/defaults/launchers/celaction_publish.toml @@ -0,0 +1,8 @@ +schema = "avalon-core:application-1.0" +application_dir = "shell" +executable = "celaction_publish" +label = "Celaction Shell" +icon = "app_icons/celaction.png" + +[environment] +CREATE_NEW_CONSOLE = "Yes" diff --git a/pype/settings/defaults/launchers/darwin/blender_2.82 b/pype/settings/defaults/launchers/darwin/blender_2.82 new file mode 100644 index 0000000000..8254411ea2 --- /dev/null +++ b/pype/settings/defaults/launchers/darwin/blender_2.82 @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +open -a blender $@ diff --git a/pype/settings/defaults/launchers/darwin/harmony_17 b/pype/settings/defaults/launchers/darwin/harmony_17 new file mode 100644 index 0000000000..b7eba2c2d0 --- /dev/null +++ b/pype/settings/defaults/launchers/darwin/harmony_17 @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +DIRNAME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +set >~/environment.tmp +if [ $? -ne -0 ] ; then + echo "ERROR: cannot write to '~/environment.tmp'!" + read -n 1 -s -r -p "Press any key to exit" + return +fi +open -a Terminal.app "$DIRNAME/harmony_17_launch" diff --git a/pype/settings/defaults/launchers/darwin/harmony_17_launch b/pype/settings/defaults/launchers/darwin/harmony_17_launch new file mode 100644 index 0000000000..5dcf5db57e --- /dev/null +++ b/pype/settings/defaults/launchers/darwin/harmony_17_launch @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +source ~/environment.tmp +export $(cut -d= -f1 ~/environment.tmp) +exe="/Applications/Toon Boom Harmony 17 Premium/Harmony Premium.app/Contents/MacOS/Harmony Premium" +$PYPE_PYTHON_EXE -c "import avalon.harmony;avalon.harmony.launch('$exe')" diff --git a/pype/settings/defaults/launchers/darwin/python3 b/pype/settings/defaults/launchers/darwin/python3 new file mode 100644 index 0000000000..c2b82c7638 --- /dev/null +++ b/pype/settings/defaults/launchers/darwin/python3 @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +open /usr/bin/python3 --args $@ diff --git a/pype/settings/defaults/launchers/harmony_17.toml b/pype/settings/defaults/launchers/harmony_17.toml new file mode 100644 index 0000000000..dd1c929b1b --- /dev/null +++ b/pype/settings/defaults/launchers/harmony_17.toml @@ -0,0 +1,9 @@ +application_dir = "harmony" +label = "Harmony" +label_variant = "17" +ftrack_label = "Harmony" +schema = "avalon-core:application-1.0" +executable = "harmony_17" +description = "" +icon = "app_icons/harmony.png" +ftrack_icon = '{}/app_icons/harmony.png' diff --git a/pype/settings/defaults/launchers/houdini_16.toml b/pype/settings/defaults/launchers/houdini_16.toml new file mode 100644 index 0000000000..0a0876a264 --- /dev/null +++ b/pype/settings/defaults/launchers/houdini_16.toml @@ -0,0 +1,8 @@ +executable = "houdini_16" +schema = "avalon-core:application-1.0" +application_dir = "houdini" +label = "Houdini" +label_variant = "16" +ftrack_label = "Houdini" +icon = "app_icons/houdini.png" +ftrack_icon = '{}/app_icons/houdini.png' diff --git a/pype/settings/defaults/launchers/houdini_17.toml b/pype/settings/defaults/launchers/houdini_17.toml new file mode 100644 index 0000000000..203f5cdb9b --- /dev/null +++ b/pype/settings/defaults/launchers/houdini_17.toml @@ -0,0 +1,8 @@ +executable = "houdini_17" +schema = "avalon-core:application-1.0" +application_dir = "houdini" +label = "Houdini" +label_variant = "17" +ftrack_label = "Houdini" +icon = "app_icons/houdini.png" +ftrack_icon = '{}/app_icons/houdini.png' diff --git a/pype/settings/defaults/launchers/houdini_18.toml b/pype/settings/defaults/launchers/houdini_18.toml new file mode 100644 index 0000000000..40f530c291 --- /dev/null +++ b/pype/settings/defaults/launchers/houdini_18.toml @@ -0,0 +1,8 @@ +executable = "houdini_18" +schema = "avalon-core:application-1.0" +application_dir = "houdini" +label = "Houdini" +label_variant = "18" +ftrack_label = "Houdini" +icon = "app_icons/houdini.png" +ftrack_icon = '{}/app_icons/houdini.png' diff --git a/pype/settings/defaults/launchers/linux/maya2016 b/pype/settings/defaults/launchers/linux/maya2016 new file mode 100644 index 0000000000..98424304b1 --- /dev/null +++ b/pype/settings/defaults/launchers/linux/maya2016 @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +maya_path = "/usr/autodesk/maya2016/bin/maya" + +if [[ -z $PYPE_LOG_NO_COLORS ]]; then + $maya_path -file "$AVALON_LAST_WORKFILE" $@ +else + $maya_path $@ diff --git a/pype/settings/defaults/launchers/linux/maya2017 b/pype/settings/defaults/launchers/linux/maya2017 new file mode 100644 index 0000000000..7a2662a55e --- /dev/null +++ b/pype/settings/defaults/launchers/linux/maya2017 @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +maya_path = "/usr/autodesk/maya2017/bin/maya" + +if [[ -z $AVALON_LAST_WORKFILE ]]; then + $maya_path -file "$AVALON_LAST_WORKFILE" $@ +else + $maya_path $@ diff --git a/pype/settings/defaults/launchers/linux/maya2018 b/pype/settings/defaults/launchers/linux/maya2018 new file mode 100644 index 0000000000..db832b3fe7 --- /dev/null +++ b/pype/settings/defaults/launchers/linux/maya2018 @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +maya_path = "/usr/autodesk/maya2018/bin/maya" + +if [[ -z $AVALON_LAST_WORKFILE ]]; then + $maya_path -file "$AVALON_LAST_WORKFILE" $@ +else + $maya_path $@ diff --git a/pype/settings/defaults/launchers/linux/maya2019 b/pype/settings/defaults/launchers/linux/maya2019 new file mode 100644 index 0000000000..8398734ab9 --- /dev/null +++ b/pype/settings/defaults/launchers/linux/maya2019 @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +maya_path = "/usr/autodesk/maya2019/bin/maya" + +if [[ -z $AVALON_LAST_WORKFILE ]]; then + $maya_path -file "$AVALON_LAST_WORKFILE" $@ +else + $maya_path $@ diff --git a/pype/settings/defaults/launchers/linux/maya2020 b/pype/settings/defaults/launchers/linux/maya2020 new file mode 100644 index 0000000000..18a1edd598 --- /dev/null +++ b/pype/settings/defaults/launchers/linux/maya2020 @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +maya_path = "/usr/autodesk/maya2020/bin/maya" + +if [[ -z $AVALON_LAST_WORKFILE ]]; then + $maya_path -file "$AVALON_LAST_WORKFILE" $@ +else + $maya_path $@ diff --git a/pype/settings/defaults/launchers/linux/nuke11.3 b/pype/settings/defaults/launchers/linux/nuke11.3 new file mode 100644 index 0000000000..b1c9a90d74 --- /dev/null +++ b/pype/settings/defaults/launchers/linux/nuke11.3 @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +gnome-terminal -e '/usr/local/Nuke11.3v5/Nuke11.3' diff --git a/pype/settings/defaults/launchers/linux/nuke12.0 b/pype/settings/defaults/launchers/linux/nuke12.0 new file mode 100644 index 0000000000..99ea1a6b0c --- /dev/null +++ b/pype/settings/defaults/launchers/linux/nuke12.0 @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +gnome-terminal -e '/usr/local/Nuke12.0v1/Nuke12.0' diff --git a/pype/settings/defaults/launchers/linux/nukestudio11.3 b/pype/settings/defaults/launchers/linux/nukestudio11.3 new file mode 100644 index 0000000000..750d54a7d5 --- /dev/null +++ b/pype/settings/defaults/launchers/linux/nukestudio11.3 @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +gnome-terminal -e '/usr/local/Nuke11.3v5/Nuke11.3 --studio' diff --git a/pype/settings/defaults/launchers/linux/nukestudio12.0 b/pype/settings/defaults/launchers/linux/nukestudio12.0 new file mode 100644 index 0000000000..ba5cf654a8 --- /dev/null +++ b/pype/settings/defaults/launchers/linux/nukestudio12.0 @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +gnome-terminal -e '/usr/local/Nuke12.0v1/Nuke12.0 --studio' diff --git a/pype/settings/defaults/launchers/linux/nukex11.3 b/pype/settings/defaults/launchers/linux/nukex11.3 new file mode 100644 index 0000000000..d913e4b961 --- /dev/null +++ b/pype/settings/defaults/launchers/linux/nukex11.3 @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +gnome-terminal -e '/usr/local/Nuke11.3v5/Nuke11.3 -nukex' diff --git a/pype/settings/defaults/launchers/linux/nukex12.0 b/pype/settings/defaults/launchers/linux/nukex12.0 new file mode 100644 index 0000000000..da2721c48b --- /dev/null +++ b/pype/settings/defaults/launchers/linux/nukex12.0 @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +gnome-terminal -e '/usr/local/Nuke12.0v1/Nuke12.0 -nukex' diff --git a/pype/settings/defaults/launchers/maya_2016.toml b/pype/settings/defaults/launchers/maya_2016.toml new file mode 100644 index 0000000000..24a463d9c6 --- /dev/null +++ b/pype/settings/defaults/launchers/maya_2016.toml @@ -0,0 +1,27 @@ +application_dir = "maya" +default_dirs = [ + "scenes", + "data", + "renderData/shaders", + "images" +] +label = "Autodesk Maya" +label_variant = "2016" +ftrack_label = "Maya" +schema = "avalon-core:application-1.0" +executable = "maya2016" +description = "" +icon = "app_icons/maya.png" +ftrack_icon = '{}/app_icons/maya.png' + +[copy] +"{PYPE_MODULE_ROOT}/pype/resources/maya/workspace.mel" = "workspace.mel" + +[environment] +MAYA_DISABLE_CLIC_IPM = "Yes" # Disable the AdSSO process +MAYA_DISABLE_CIP = "Yes" # Shorten time to boot +MAYA_DISABLE_CER = "Yes" +PYTHONPATH = [ + "{AVALON_CORE}/setup/maya", + "{PYTHONPATH}" +] diff --git a/pype/settings/defaults/launchers/maya_2017.toml b/pype/settings/defaults/launchers/maya_2017.toml new file mode 100644 index 0000000000..5295862e87 --- /dev/null +++ b/pype/settings/defaults/launchers/maya_2017.toml @@ -0,0 +1,29 @@ +application_dir = "maya" +default_dirs = [ + "scenes", + "data", + "renderData/shaders", + "images" +] +label = "Autodesk Maya" +label_variant = "2017" +ftrack_label = "Maya" +schema = "avalon-core:application-1.0" +executable = "maya2017" +description = "" +icon = "app_icons/maya.png" +ftrack_icon = '{}/app_icons/maya.png' + +[copy] +"{PYPE_MODULE_ROOT}/pype/resources/maya/workspace.mel" = "workspace.mel" + +[environment] +MAYA_DISABLE_CLIC_IPM = "Yes" # Disable the AdSSO process +MAYA_DISABLE_CIP = "Yes" # Shorten time to boot +MAYA_DISABLE_CER = "Yes" +PYMEL_SKIP_MEL_INIT = "Yes" +LC_ALL= "C" # Mute color management warnings +PYTHONPATH = [ + "{AVALON_CORE}/setup/maya", + "{PYTHONPATH}" +] diff --git a/pype/settings/defaults/launchers/maya_2018.toml b/pype/settings/defaults/launchers/maya_2018.toml new file mode 100644 index 0000000000..2bdff2094d --- /dev/null +++ b/pype/settings/defaults/launchers/maya_2018.toml @@ -0,0 +1,15 @@ +application_dir = "maya" +default_dirs = [ + "renders" +] +label = "Autodesk Maya" +label_variant = "2018" +ftrack_label = "Maya" +schema = "avalon-core:application-1.0" +executable = "maya2018" +description = "" +icon = "app_icons/maya.png" +ftrack_icon = '{}/app_icons/maya.png' + +[copy] +"{PYPE_MODULE_ROOT}/pype/resources/maya/workspace.mel" = "workspace.mel" diff --git a/pype/settings/defaults/launchers/maya_2019.toml b/pype/settings/defaults/launchers/maya_2019.toml new file mode 100644 index 0000000000..8eb88179f9 --- /dev/null +++ b/pype/settings/defaults/launchers/maya_2019.toml @@ -0,0 +1,15 @@ +application_dir = "maya" +default_dirs = [ + "renders" +] +label = "Autodesk Maya" +label_variant = "2019" +ftrack_label = "Maya" +schema = "avalon-core:application-1.0" +executable = "maya2019" +description = "" +icon = "app_icons/maya.png" +ftrack_icon = '{}/app_icons/maya.png' + +[copy] +"{PYPE_MODULE_ROOT}/pype/resources/maya/workspace.mel" = "workspace.mel" diff --git a/pype/settings/defaults/launchers/maya_2020.toml b/pype/settings/defaults/launchers/maya_2020.toml new file mode 100644 index 0000000000..693de0cf9e --- /dev/null +++ b/pype/settings/defaults/launchers/maya_2020.toml @@ -0,0 +1,15 @@ +application_dir = "maya" +default_dirs = [ + "renders" +] +label = "Autodesk Maya" +label_variant = "2020" +ftrack_label = "Maya" +schema = "avalon-core:application-1.0" +executable = "maya2020" +description = "" +icon = "app_icons/maya.png" +ftrack_icon = '{}/app_icons/maya.png' + +[copy] +"{PYPE_MODULE_ROOT}/pype/resources/maya/workspace.mel" = "workspace.mel" diff --git a/pype/settings/defaults/launchers/mayabatch_2019.toml b/pype/settings/defaults/launchers/mayabatch_2019.toml new file mode 100644 index 0000000000..a928618d2b --- /dev/null +++ b/pype/settings/defaults/launchers/mayabatch_2019.toml @@ -0,0 +1,17 @@ +application_dir = "maya" +default_dirs = [ + "scenes", + "data", + "renderData/shaders", + "images" +] +label = "Autodesk Maya 2019x64" +schema = "avalon-core:application-1.0" +executable = "mayabatch2019" +description = "" + +[environment] +PYTHONPATH = [ + "{AVALON_CORE}/setup/maya", + "{PYTHONPATH}" +] diff --git a/pype/settings/defaults/launchers/mayabatch_2020.toml b/pype/settings/defaults/launchers/mayabatch_2020.toml new file mode 100644 index 0000000000..cd1e1e4474 --- /dev/null +++ b/pype/settings/defaults/launchers/mayabatch_2020.toml @@ -0,0 +1,17 @@ +application_dir = "maya" +default_dirs = [ + "scenes", + "data", + "renderData/shaders", + "images" +] +label = "Autodesk Maya 2020x64" +schema = "avalon-core:application-1.0" +executable = "mayabatch2020" +description = "" + +[environment] +PYTHONPATH = [ + "{AVALON_CORE}/setup/maya", + "{PYTHONPATH}" +] diff --git a/pype/settings/defaults/launchers/mayapy2016.toml b/pype/settings/defaults/launchers/mayapy2016.toml new file mode 100644 index 0000000000..ad1e3dee86 --- /dev/null +++ b/pype/settings/defaults/launchers/mayapy2016.toml @@ -0,0 +1,17 @@ +application_dir = "maya" +default_dirs = [ + "scenes", + "data", + "renderData/shaders", + "images" +] +label = "Autodesk Maya 2016x64" +schema = "avalon-core:application-1.0" +executable = "mayapy2016" +description = "" + +[environment] +PYTHONPATH = [ + "{AVALON_CORE}/setup/maya", + "{PYTHONPATH}" +] diff --git a/pype/settings/defaults/launchers/mayapy2017.toml b/pype/settings/defaults/launchers/mayapy2017.toml new file mode 100644 index 0000000000..8d2095ff47 --- /dev/null +++ b/pype/settings/defaults/launchers/mayapy2017.toml @@ -0,0 +1,17 @@ +application_dir = "maya" +default_dirs = [ + "scenes", + "data", + "renderData/shaders", + "images" +] +label = "Autodesk Maya 2017x64" +schema = "avalon-core:application-1.0" +executable = "mayapy2017" +description = "" + +[environment] +PYTHONPATH = [ + "{AVALON_CORE}/setup/maya", + "{PYTHONPATH}" +] diff --git a/pype/settings/defaults/launchers/mayapy2018.toml b/pype/settings/defaults/launchers/mayapy2018.toml new file mode 100644 index 0000000000..597744fd85 --- /dev/null +++ b/pype/settings/defaults/launchers/mayapy2018.toml @@ -0,0 +1,17 @@ +application_dir = "maya" +default_dirs = [ + "scenes", + "data", + "renderData/shaders", + "images" +] +label = "Autodesk Maya 2018x64" +schema = "avalon-core:application-1.0" +executable = "mayapy2017" +description = "" + +[environment] +PYTHONPATH = [ + "{AVALON_CORE}/setup/maya", + "{PYTHONPATH}" +] diff --git a/pype/settings/defaults/launchers/mayapy2019.toml b/pype/settings/defaults/launchers/mayapy2019.toml new file mode 100644 index 0000000000..3c8a9860f9 --- /dev/null +++ b/pype/settings/defaults/launchers/mayapy2019.toml @@ -0,0 +1,17 @@ +application_dir = "maya" +default_dirs = [ + "scenes", + "data", + "renderData/shaders", + "images" +] +label = "Autodesk Maya 2019x64" +schema = "avalon-core:application-1.0" +executable = "mayapy2019" +description = "" + +[environment] +PYTHONPATH = [ + "{AVALON_CORE}/setup/maya", + "{PYTHONPATH}" +] diff --git a/pype/settings/defaults/launchers/mayapy2020.toml b/pype/settings/defaults/launchers/mayapy2020.toml new file mode 100644 index 0000000000..8f2d2e4a67 --- /dev/null +++ b/pype/settings/defaults/launchers/mayapy2020.toml @@ -0,0 +1,17 @@ +application_dir = "maya" +default_dirs = [ + "scenes", + "data", + "renderData/shaders", + "images" +] +label = "Autodesk Maya 2020x64" +schema = "avalon-core:application-1.0" +executable = "mayapy2020" +description = "" + +[environment] +PYTHONPATH = [ + "{AVALON_CORE}/setup/maya", + "{PYTHONPATH}" +] diff --git a/pype/settings/defaults/launchers/myapp.toml b/pype/settings/defaults/launchers/myapp.toml new file mode 100644 index 0000000000..21da0d52b2 --- /dev/null +++ b/pype/settings/defaults/launchers/myapp.toml @@ -0,0 +1,5 @@ +executable = "python" +schema = "avalon-core:application-1.0" +application_dir = "myapp" +label = "My App" +arguments = [ "-c", "import sys; from Qt import QtWidgets; if __name__ == '__main__':;\n app = QtWidgets.QApplication(sys.argv);\n window = QtWidgets.QWidget();\n window.setWindowTitle(\"My App\");\n window.resize(400, 300);\n window.show();\n app.exec_();\n",] \ No newline at end of file diff --git a/pype/settings/defaults/launchers/nuke_10.0.toml b/pype/settings/defaults/launchers/nuke_10.0.toml new file mode 100644 index 0000000000..d4dd028942 --- /dev/null +++ b/pype/settings/defaults/launchers/nuke_10.0.toml @@ -0,0 +1,8 @@ +executable = "nuke10.0" +schema = "avalon-core:application-1.0" +application_dir = "nuke" +label = "Nuke" +label_variant = "10.0v4" +ftrack_label = "Nuke" +icon = "app_icons/nuke.png" +ftrack_icon = '{}/app_icons/nuke.png' diff --git a/pype/settings/defaults/launchers/nuke_11.0.toml b/pype/settings/defaults/launchers/nuke_11.0.toml new file mode 100644 index 0000000000..10ff6aca37 --- /dev/null +++ b/pype/settings/defaults/launchers/nuke_11.0.toml @@ -0,0 +1,8 @@ +executable = "nuke11.0" +schema = "avalon-core:application-1.0" +application_dir = "nuke" +label = "Nuke" +label_variant = "11.0" +ftrack_label = "Nuke" +icon = "app_icons/nuke.png" +ftrack_icon = '{}/app_icons/nuke.png' diff --git a/pype/settings/defaults/launchers/nuke_11.2.toml b/pype/settings/defaults/launchers/nuke_11.2.toml new file mode 100644 index 0000000000..530c7f610e --- /dev/null +++ b/pype/settings/defaults/launchers/nuke_11.2.toml @@ -0,0 +1,8 @@ +executable = "nuke11.2" +schema = "avalon-core:application-1.0" +application_dir = "nuke" +label = "Nuke" +label_variant = "11.2" +ftrack_label = "Nuke" +icon = "app_icons/nuke.png" +ftrack_icon = '{}/app_icons/nuke.png' diff --git a/pype/settings/defaults/launchers/nuke_11.3.toml b/pype/settings/defaults/launchers/nuke_11.3.toml new file mode 100644 index 0000000000..c9ff005feb --- /dev/null +++ b/pype/settings/defaults/launchers/nuke_11.3.toml @@ -0,0 +1,8 @@ +executable = "nuke11.3" +schema = "avalon-core:application-1.0" +application_dir = "nuke" +label = "Nuke" +label_variant = "11.3" +ftrack_label = "Nuke" +icon = "app_icons/nuke.png" +ftrack_icon = '{}/app_icons/nuke.png' diff --git a/pype/settings/defaults/launchers/nuke_12.0.toml b/pype/settings/defaults/launchers/nuke_12.0.toml new file mode 100644 index 0000000000..9ac1084fbf --- /dev/null +++ b/pype/settings/defaults/launchers/nuke_12.0.toml @@ -0,0 +1,8 @@ +executable = "nuke12.0" +schema = "avalon-core:application-1.0" +application_dir = "nuke" +label = "Nuke" +label_variant = "12.0" +ftrack_label = "Nuke" +icon = "app_icons/nuke.png" +ftrack_icon = '{}/app_icons/nuke.png' diff --git a/pype/settings/defaults/launchers/nukestudio_10.0.toml b/pype/settings/defaults/launchers/nukestudio_10.0.toml new file mode 100644 index 0000000000..6c554aff62 --- /dev/null +++ b/pype/settings/defaults/launchers/nukestudio_10.0.toml @@ -0,0 +1,8 @@ +executable = "nukestudio10.0" +schema = "avalon-core:application-1.0" +application_dir = "nukestudio" +label = "NukeStudio" +label_variant = "10.0" +ftrack_label = "NukeStudio" +icon = "app_icons/nuke.png" +ftrack_icon = '{}/app_icons/nuke.png' diff --git a/pype/settings/defaults/launchers/nukestudio_11.0.toml b/pype/settings/defaults/launchers/nukestudio_11.0.toml new file mode 100644 index 0000000000..482aa6587e --- /dev/null +++ b/pype/settings/defaults/launchers/nukestudio_11.0.toml @@ -0,0 +1,8 @@ +executable = "nukestudio11.0" +schema = "avalon-core:application-1.0" +application_dir = "nukestudio" +label = "NukeStudio" +label_variant = "11.0" +ftrack_label = "NukeStudio" +icon = "app_icons/nuke.png" +ftrack_icon = '{}/app_icons/nuke.png' diff --git a/pype/settings/defaults/launchers/nukestudio_11.2.toml b/pype/settings/defaults/launchers/nukestudio_11.2.toml new file mode 100644 index 0000000000..78d1de3d8b --- /dev/null +++ b/pype/settings/defaults/launchers/nukestudio_11.2.toml @@ -0,0 +1,8 @@ +executable = "nukestudio11.2" +schema = "avalon-core:application-1.0" +application_dir = "nukestudio" +label = "NukeStudio" +label_variant = "11.2" +ftrack_label = "NukeStudio" +icon = "app_icons/nuke.png" +ftrack_icon = '{}/app_icons/nuke.png' diff --git a/pype/settings/defaults/launchers/nukestudio_11.3.toml b/pype/settings/defaults/launchers/nukestudio_11.3.toml new file mode 100644 index 0000000000..35c6a08b2f --- /dev/null +++ b/pype/settings/defaults/launchers/nukestudio_11.3.toml @@ -0,0 +1,8 @@ +executable = "nukestudio11.3" +schema = "avalon-core:application-1.0" +application_dir = "nukestudio" +label = "NukeStudio" +label_variant = "11.3" +ftrack_label = "NukeStudio" +icon = "app_icons/nuke.png" +ftrack_icon = '{}/app_icons/nuke.png' diff --git a/pype/settings/defaults/launchers/nukestudio_12.0.toml b/pype/settings/defaults/launchers/nukestudio_12.0.toml new file mode 100644 index 0000000000..2754116aef --- /dev/null +++ b/pype/settings/defaults/launchers/nukestudio_12.0.toml @@ -0,0 +1,8 @@ +executable = "nukestudio12.0" +schema = "avalon-core:application-1.0" +application_dir = "nukestudio" +label = "NukeStudio" +label_variant = "12.0" +ftrack_label = "NukeStudio" +icon = "app_icons/nuke.png" +ftrack_icon = '{}/app_icons/nuke.png' diff --git a/pype/settings/defaults/launchers/nukex_10.0.toml b/pype/settings/defaults/launchers/nukex_10.0.toml new file mode 100644 index 0000000000..48da30fe16 --- /dev/null +++ b/pype/settings/defaults/launchers/nukex_10.0.toml @@ -0,0 +1,8 @@ +executable = "nukex10.0" +schema = "avalon-core:application-1.0" +application_dir = "nuke" +label = "NukeX" +label_variant = "10.0" +ftrack_label = "NukeX" +icon = "app_icons/nuke.png" +ftrack_icon = '{}/app_icons/nukex.png' diff --git a/pype/settings/defaults/launchers/nukex_11.0.toml b/pype/settings/defaults/launchers/nukex_11.0.toml new file mode 100644 index 0000000000..8f353e9e00 --- /dev/null +++ b/pype/settings/defaults/launchers/nukex_11.0.toml @@ -0,0 +1,8 @@ +executable = "nukex11.0" +schema = "avalon-core:application-1.0" +application_dir = "nuke" +label = "NukeX" +label_variant = "11.0" +ftrack_label = "NukeX" +icon = "app_icons/nuke.png" +ftrack_icon = '{}/app_icons/nukex.png' diff --git a/pype/settings/defaults/launchers/nukex_11.2.toml b/pype/settings/defaults/launchers/nukex_11.2.toml new file mode 100644 index 0000000000..38e37fa4c9 --- /dev/null +++ b/pype/settings/defaults/launchers/nukex_11.2.toml @@ -0,0 +1,8 @@ +executable = "nukex11.2" +schema = "avalon-core:application-1.0" +application_dir = "nuke" +label = "NukeX" +label_variant = "11.2" +ftrack_label = "NukeX" +icon = "app_icons/nuke.png" +ftrack_icon = '{}/app_icons/nukex.png' diff --git a/pype/settings/defaults/launchers/nukex_11.3.toml b/pype/settings/defaults/launchers/nukex_11.3.toml new file mode 100644 index 0000000000..42969c5e69 --- /dev/null +++ b/pype/settings/defaults/launchers/nukex_11.3.toml @@ -0,0 +1,8 @@ +executable = "nukex11.3" +schema = "avalon-core:application-1.0" +application_dir = "nuke" +label = "NukeX" +label_variant = "11.3" +ftrack_label = "NukeX" +icon = "app_icons/nuke.png" +ftrack_icon = '{}/app_icons/nukex.png' diff --git a/pype/settings/defaults/launchers/nukex_12.0.toml b/pype/settings/defaults/launchers/nukex_12.0.toml new file mode 100644 index 0000000000..19d27a12d7 --- /dev/null +++ b/pype/settings/defaults/launchers/nukex_12.0.toml @@ -0,0 +1,8 @@ +executable = "nukex12.0" +schema = "avalon-core:application-1.0" +application_dir = "nuke" +label = "NukeX" +label_variant = "12.0" +ftrack_label = "NukeX" +icon = "app_icons/nuke.png" +ftrack_icon = '{}/app_icons/nukex.png' diff --git a/pype/settings/defaults/launchers/photoshop_2020.toml b/pype/settings/defaults/launchers/photoshop_2020.toml new file mode 100644 index 0000000000..8164af929f --- /dev/null +++ b/pype/settings/defaults/launchers/photoshop_2020.toml @@ -0,0 +1,9 @@ +executable = "photoshop_2020" +schema = "avalon-core:application-1.0" +application_dir = "photoshop" +label = "Adobe Photoshop" +label_variant = "2020" +icon = "app_icons/photoshop.png" +ftrack_label = "Photoshop" +ftrack_icon = '{}/app_icons/photoshop.png' +launch_hook = "pype/hooks/photoshop/prelaunch.py/PhotoshopPrelaunch" diff --git a/pype/settings/defaults/launchers/premiere_2019.toml b/pype/settings/defaults/launchers/premiere_2019.toml new file mode 100644 index 0000000000..d03395e022 --- /dev/null +++ b/pype/settings/defaults/launchers/premiere_2019.toml @@ -0,0 +1,9 @@ +executable = "premiere_pro_2019" +schema = "avalon-core:application-1.0" +application_dir = "premiere" +label = "Adobe Premiere Pro CC" +label_variant = "2019" +icon = "app_icons/premiere.png" + +ftrack_label = "Premiere" +ftrack_icon = '{}/app_icons/premiere.png' diff --git a/pype/settings/defaults/launchers/premiere_2020.toml b/pype/settings/defaults/launchers/premiere_2020.toml new file mode 100644 index 0000000000..01c7b5b745 --- /dev/null +++ b/pype/settings/defaults/launchers/premiere_2020.toml @@ -0,0 +1,10 @@ +executable = "premiere_pro_2020" +schema = "avalon-core:application-1.0" +application_dir = "premiere" +label = "Adobe Premiere Pro CC" +label_variant = "2020" +launch_hook = "pype/hooks/premiere/prelaunch.py/PremierePrelaunch" +icon = "app_icons/premiere.png" + +ftrack_label = "Premiere" +ftrack_icon = '{}/app_icons/premiere.png' diff --git a/pype/settings/defaults/launchers/python_2.toml b/pype/settings/defaults/launchers/python_2.toml new file mode 100644 index 0000000000..f1c1ca7e68 --- /dev/null +++ b/pype/settings/defaults/launchers/python_2.toml @@ -0,0 +1,12 @@ +schema = "avalon-core:application-1.0" +application_dir = "python" +executable = "python" +label = "Python" +label_variant = "2" +icon = "app_icons/python.png" + +ftrack_label = "Python" +ftrack_icon = '{}/app_icons/python.png' + +[environment] +CREATE_NEW_CONSOLE = "Yes" diff --git a/pype/settings/defaults/launchers/python_3.toml b/pype/settings/defaults/launchers/python_3.toml new file mode 100644 index 0000000000..90fb10eaeb --- /dev/null +++ b/pype/settings/defaults/launchers/python_3.toml @@ -0,0 +1,12 @@ +schema = "avalon-core:application-1.0" +application_dir = "python" +executable = "python3" +label = "Python" +label_variant = "3" +icon = "app_icons/python.png" + +ftrack_label = "Python" +ftrack_icon = '{}/app_icons/python.png' + +[environment] +CREATE_NEW_CONSOLE = "Yes" diff --git a/pype/settings/defaults/launchers/resolve_16.toml b/pype/settings/defaults/launchers/resolve_16.toml new file mode 100644 index 0000000000..47918a22a6 --- /dev/null +++ b/pype/settings/defaults/launchers/resolve_16.toml @@ -0,0 +1,10 @@ +executable = "resolve_16" +schema = "avalon-core:application-1.0" +application_dir = "resolve" +label = "BM DaVinci Resolve" +label_variant = "16" +launch_hook = "pype/hooks/resolve/prelaunch.py/ResolvePrelaunch" +icon = "app_icons/resolve.png" + +ftrack_label = "BM DaVinci Resolve" +ftrack_icon = '{}/app_icons/resolve.png' diff --git a/pype/settings/defaults/launchers/shell.toml b/pype/settings/defaults/launchers/shell.toml new file mode 100644 index 0000000000..959ad392ea --- /dev/null +++ b/pype/settings/defaults/launchers/shell.toml @@ -0,0 +1,7 @@ +schema = "avalon-core:application-1.0" +application_dir = "shell" +executable = "shell" +label = "Shell" + +[environment] +CREATE_NEW_CONSOLE = "Yes" \ No newline at end of file diff --git a/pype/settings/defaults/launchers/storyboardpro_7.toml b/pype/settings/defaults/launchers/storyboardpro_7.toml new file mode 100644 index 0000000000..067f10a23a --- /dev/null +++ b/pype/settings/defaults/launchers/storyboardpro_7.toml @@ -0,0 +1,9 @@ +application_dir = "storyboardpro" +label = "Storyboard Pro" +label_variant = "7" +ftrack_label = "Storyboard Pro" +schema = "avalon-core:application-1.0" +executable = "storyboardpro_7" +description = "" +icon = "app_icons/storyboardpro.png" +ftrack_icon = '{}/app_icons/storyboardpro.png' diff --git a/pype/settings/defaults/launchers/unreal_4.24.toml b/pype/settings/defaults/launchers/unreal_4.24.toml new file mode 100644 index 0000000000..10b14e7f59 --- /dev/null +++ b/pype/settings/defaults/launchers/unreal_4.24.toml @@ -0,0 +1,10 @@ +executable = "unreal" +schema = "avalon-core:application-1.0" +application_dir = "unreal" +label = "Unreal Editor" +label_variant = "4.24" +icon = "app_icons/ue4.png" +launch_hook = "pype/hooks/unreal/unreal_prelaunch.py/UnrealPrelaunch" + +ftrack_label = "UnrealEditor" +ftrack_icon = '{}/app_icons/ue4.png' diff --git a/pype/settings/defaults/launchers/windows/blender_2.80.bat b/pype/settings/defaults/launchers/windows/blender_2.80.bat new file mode 100644 index 0000000000..5b8a37356b --- /dev/null +++ b/pype/settings/defaults/launchers/windows/blender_2.80.bat @@ -0,0 +1,11 @@ +set __app__="Blender" +set __exe__="C:\Program Files\Blender Foundation\Blender 2.80\blender.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/blender_2.81.bat b/pype/settings/defaults/launchers/windows/blender_2.81.bat new file mode 100644 index 0000000000..a900b18eda --- /dev/null +++ b/pype/settings/defaults/launchers/windows/blender_2.81.bat @@ -0,0 +1,11 @@ +set __app__="Blender" +set __exe__="C:\Program Files\Blender Foundation\Blender 2.81\blender.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/blender_2.82.bat b/pype/settings/defaults/launchers/windows/blender_2.82.bat new file mode 100644 index 0000000000..7105c1efe1 --- /dev/null +++ b/pype/settings/defaults/launchers/windows/blender_2.82.bat @@ -0,0 +1,11 @@ +set __app__="Blender" +set __exe__="C:\Program Files\Blender Foundation\Blender 2.82\blender.exe" --python-use-system-env +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/blender_2.83.bat b/pype/settings/defaults/launchers/windows/blender_2.83.bat new file mode 100644 index 0000000000..671952f0d7 --- /dev/null +++ b/pype/settings/defaults/launchers/windows/blender_2.83.bat @@ -0,0 +1,11 @@ +set __app__="Blender" +set __exe__="C:\Program Files\Blender Foundation\Blender 2.83\blender.exe" --python-use-system-env +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/celaction_local.bat b/pype/settings/defaults/launchers/windows/celaction_local.bat new file mode 100644 index 0000000000..8f2171617e --- /dev/null +++ b/pype/settings/defaults/launchers/windows/celaction_local.bat @@ -0,0 +1,19 @@ +set __app__="CelAction2D" +set __app_dir__="C:\Program Files (x86)\CelAction\" +set __exe__="C:\Program Files (x86)\CelAction\CelAction2D.exe" + +if not exist %__exe__% goto :missing_app + +pushd %__app_dir__% + +if "%PYPE_CELACTION_PROJECT_FILE%"=="" ( + start %__app__% %__exe__% %* +) else ( + start %__app__% %__exe__% "%PYPE_CELACTION_PROJECT_FILE%" %* +) + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/celaction_publish.bat b/pype/settings/defaults/launchers/windows/celaction_publish.bat new file mode 100644 index 0000000000..77ec2ac24e --- /dev/null +++ b/pype/settings/defaults/launchers/windows/celaction_publish.bat @@ -0,0 +1,3 @@ +echo %* + +%PYPE_PYTHON_EXE% "%PYPE_MODULE_ROOT%\pype\hosts\celaction\cli.py" %* diff --git a/pype/settings/defaults/launchers/windows/harmony_17.bat b/pype/settings/defaults/launchers/windows/harmony_17.bat new file mode 100644 index 0000000000..0822650875 --- /dev/null +++ b/pype/settings/defaults/launchers/windows/harmony_17.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Harmony 17" +set __exe__="C:/Program Files (x86)/Toon Boom Animation/Toon Boom Harmony 17 Premium/win64/bin/HarmonyPremium.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% cmd.exe /k "python -c ^"import avalon.harmony;avalon.harmony.launch("%__exe__%")^"" + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/houdini_16.bat b/pype/settings/defaults/launchers/windows/houdini_16.bat new file mode 100644 index 0000000000..018ba08b4c --- /dev/null +++ b/pype/settings/defaults/launchers/windows/houdini_16.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Houdini 16.0" +set __exe__="C:\Program Files\Side Effects Software\Houdini 16.0.621\bin\houdini.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/houdini_17.bat b/pype/settings/defaults/launchers/windows/houdini_17.bat new file mode 100644 index 0000000000..950a599623 --- /dev/null +++ b/pype/settings/defaults/launchers/windows/houdini_17.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Houdini 17.0" +set __exe__="C:\Program Files\Side Effects Software\Houdini 17.0.459\bin\houdini.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/houdini_18.bat b/pype/settings/defaults/launchers/windows/houdini_18.bat new file mode 100644 index 0000000000..3d6b1ae258 --- /dev/null +++ b/pype/settings/defaults/launchers/windows/houdini_18.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Houdini 18.0" +set __exe__="C:\Program Files\Side Effects Software\Houdini 18.0.287\bin\houdini.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/maya2016.bat b/pype/settings/defaults/launchers/windows/maya2016.bat new file mode 100644 index 0000000000..54f15cf269 --- /dev/null +++ b/pype/settings/defaults/launchers/windows/maya2016.bat @@ -0,0 +1,17 @@ +@echo off + +set __app__="Maya 2016" +set __exe__="C:\Program Files\Autodesk\Maya2016\bin\maya.exe" +if not exist %__exe__% goto :missing_app + +if "%AVALON_LAST_WORKFILE%"=="" ( + start %__app__% %__exe__% %* +) else ( + start %__app__% %__exe__% -file "%AVALON_LAST_WORKFILE%" %* +) + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/maya2017.bat b/pype/settings/defaults/launchers/windows/maya2017.bat new file mode 100644 index 0000000000..5c2aeb495c --- /dev/null +++ b/pype/settings/defaults/launchers/windows/maya2017.bat @@ -0,0 +1,17 @@ +@echo off + +set __app__="Maya 2017" +set __exe__="C:\Program Files\Autodesk\Maya2017\bin\maya.exe" +if not exist %__exe__% goto :missing_app + +if "%AVALON_LAST_WORKFILE%"=="" ( + start %__app__% %__exe__% %* +) else ( + start %__app__% %__exe__% -file "%AVALON_LAST_WORKFILE%" %* +) + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/maya2018.bat b/pype/settings/defaults/launchers/windows/maya2018.bat new file mode 100644 index 0000000000..28cf776c77 --- /dev/null +++ b/pype/settings/defaults/launchers/windows/maya2018.bat @@ -0,0 +1,17 @@ +@echo off + +set __app__="Maya 2018" +set __exe__="C:\Program Files\Autodesk\Maya2018\bin\maya.exe" +if not exist %__exe__% goto :missing_app + +if "%AVALON_LAST_WORKFILE%"=="" ( + start %__app__% %__exe__% %* +) else ( + start %__app__% %__exe__% -file "%AVALON_LAST_WORKFILE%" %* +) + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/maya2019.bat b/pype/settings/defaults/launchers/windows/maya2019.bat new file mode 100644 index 0000000000..7e80dd2557 --- /dev/null +++ b/pype/settings/defaults/launchers/windows/maya2019.bat @@ -0,0 +1,17 @@ +@echo off + +set __app__="Maya 2019" +set __exe__="C:\Program Files\Autodesk\Maya2019\bin\maya.exe" +if not exist %__exe__% goto :missing_app + +if "%AVALON_LAST_WORKFILE%"=="" ( + start %__app__% %__exe__% %* +) else ( + start %__app__% %__exe__% -file "%AVALON_LAST_WORKFILE%" %* +) + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/maya2020.bat b/pype/settings/defaults/launchers/windows/maya2020.bat new file mode 100644 index 0000000000..b2acb5df5a --- /dev/null +++ b/pype/settings/defaults/launchers/windows/maya2020.bat @@ -0,0 +1,17 @@ +@echo off + +set __app__="Maya 2020" +set __exe__="C:\Program Files\Autodesk\maya2020\bin\maya.exe" +if not exist %__exe__% goto :missing_app + +if "%AVALON_LAST_WORKFILE%"=="" ( + start %__app__% %__exe__% %* +) else ( + start %__app__% %__exe__% -file "%AVALON_LAST_WORKFILE%" %* +) + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/mayabatch2019.bat b/pype/settings/defaults/launchers/windows/mayabatch2019.bat new file mode 100644 index 0000000000..ddd9b9b956 --- /dev/null +++ b/pype/settings/defaults/launchers/windows/mayabatch2019.bat @@ -0,0 +1,14 @@ +@echo off + +set __app__="Maya Batch 2019" +set __exe__="C:\Program Files\Autodesk\Maya2019\bin\mayabatch.exe" +if not exist %__exe__% goto :missing_app + +echo "running maya : %*" +%__exe__% %* +echo "done." +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/mayabatch2020.bat b/pype/settings/defaults/launchers/windows/mayabatch2020.bat new file mode 100644 index 0000000000..b1cbc6dbb6 --- /dev/null +++ b/pype/settings/defaults/launchers/windows/mayabatch2020.bat @@ -0,0 +1,14 @@ +@echo off + +set __app__="Maya Batch 2020" +set __exe__="C:\Program Files\Autodesk\Maya2020\bin\mayabatch.exe" +if not exist %__exe__% goto :missing_app + +echo "running maya : %*" +%__exe__% %* +echo "done." +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/mayapy2016.bat b/pype/settings/defaults/launchers/windows/mayapy2016.bat new file mode 100644 index 0000000000..205991fd3d --- /dev/null +++ b/pype/settings/defaults/launchers/windows/mayapy2016.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Mayapy 2016" +set __exe__="C:\Program Files\Autodesk\Maya2016\bin\mayapy.exe" +if not exist %__exe__% goto :missing_app + +call %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found at %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/mayapy2017.bat b/pype/settings/defaults/launchers/windows/mayapy2017.bat new file mode 100644 index 0000000000..14aacc5a7f --- /dev/null +++ b/pype/settings/defaults/launchers/windows/mayapy2017.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Mayapy 2017" +set __exe__="C:\Program Files\Autodesk\Maya2017\bin\mayapy.exe" +if not exist %__exe__% goto :missing_app + +call %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found at %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/mayapy2018.bat b/pype/settings/defaults/launchers/windows/mayapy2018.bat new file mode 100644 index 0000000000..c47c472f46 --- /dev/null +++ b/pype/settings/defaults/launchers/windows/mayapy2018.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Mayapy 2018" +set __exe__="C:\Program Files\Autodesk\Maya2018\bin\mayapy.exe" +if not exist %__exe__% goto :missing_app + +call %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found at %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/mayapy2019.bat b/pype/settings/defaults/launchers/windows/mayapy2019.bat new file mode 100644 index 0000000000..73ca5b2d40 --- /dev/null +++ b/pype/settings/defaults/launchers/windows/mayapy2019.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Mayapy 2019" +set __exe__="C:\Program Files\Autodesk\Maya2019\bin\mayapy.exe" +if not exist %__exe__% goto :missing_app + +call %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found at %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/mayapy2020.bat b/pype/settings/defaults/launchers/windows/mayapy2020.bat new file mode 100644 index 0000000000..770a03dcf5 --- /dev/null +++ b/pype/settings/defaults/launchers/windows/mayapy2020.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Mayapy 2020" +set __exe__="C:\Program Files\Autodesk\Maya2020\bin\mayapy.exe" +if not exist %__exe__% goto :missing_app + +call %__exe__% %* + +goto :eofS + +:missing_app + echo ERROR: %__app__% not found at %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/nuke10.0.bat b/pype/settings/defaults/launchers/windows/nuke10.0.bat new file mode 100644 index 0000000000..a47cbdfb20 --- /dev/null +++ b/pype/settings/defaults/launchers/windows/nuke10.0.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Nuke10.0v4" +set __exe__="C:\Program Files\Nuke10.0v4\Nuke10.0.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/nuke11.0.bat b/pype/settings/defaults/launchers/windows/nuke11.0.bat new file mode 100644 index 0000000000..a374c5cf5b --- /dev/null +++ b/pype/settings/defaults/launchers/windows/nuke11.0.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Nuke11.0v4" +set __exe__="C:\Program Files\Nuke11.0v4\Nuke11.0.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/nuke11.2.bat b/pype/settings/defaults/launchers/windows/nuke11.2.bat new file mode 100644 index 0000000000..4c777ac28c --- /dev/null +++ b/pype/settings/defaults/launchers/windows/nuke11.2.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Nuke11.2v3" +set __exe__="C:\Program Files\Nuke11.2v3\Nuke11.2.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/nuke11.3.bat b/pype/settings/defaults/launchers/windows/nuke11.3.bat new file mode 100644 index 0000000000..a023f5f46f --- /dev/null +++ b/pype/settings/defaults/launchers/windows/nuke11.3.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Nuke11.3v1" +set __exe__="C:\Program Files\Nuke11.3v1\Nuke11.3.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/nuke12.0.bat b/pype/settings/defaults/launchers/windows/nuke12.0.bat new file mode 100644 index 0000000000..d8fb5772bb --- /dev/null +++ b/pype/settings/defaults/launchers/windows/nuke12.0.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Nuke12.0v1" +set __exe__="C:\Program Files\Nuke12.0v1\Nuke12.0.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/nukestudio10.0.bat b/pype/settings/defaults/launchers/windows/nukestudio10.0.bat new file mode 100644 index 0000000000..82f833667c --- /dev/null +++ b/pype/settings/defaults/launchers/windows/nukestudio10.0.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="NukeStudio10.0v4" +set __exe__="C:\Program Files\Nuke10.0v4\Nuke10.0.exe" --studio +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/nukestudio11.0.bat b/pype/settings/defaults/launchers/windows/nukestudio11.0.bat new file mode 100644 index 0000000000..b66797727e --- /dev/null +++ b/pype/settings/defaults/launchers/windows/nukestudio11.0.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="NukeStudio11.0v4" +set __exe__="C:\Program Files\Nuke11.0v4\Nuke11.0.exe" -studio +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/nukestudio11.2.bat b/pype/settings/defaults/launchers/windows/nukestudio11.2.bat new file mode 100644 index 0000000000..a653d816b4 --- /dev/null +++ b/pype/settings/defaults/launchers/windows/nukestudio11.2.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="NukeStudio11.2v3" +set __exe__="C:\Program Files\Nuke11.2v3\Nuke11.2.exe" -studio +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/nukestudio11.3.bat b/pype/settings/defaults/launchers/windows/nukestudio11.3.bat new file mode 100644 index 0000000000..62c8718873 --- /dev/null +++ b/pype/settings/defaults/launchers/windows/nukestudio11.3.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="NukeStudio11.3v1" +set __exe__="C:\Program Files\Nuke11.3v1\Nuke11.3.exe" --studio +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/nukestudio12.0.bat b/pype/settings/defaults/launchers/windows/nukestudio12.0.bat new file mode 100644 index 0000000000..488232bcbf --- /dev/null +++ b/pype/settings/defaults/launchers/windows/nukestudio12.0.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="NukeStudio12.0v1" +set __exe__="C:\Program Files\Nuke12.0v1\Nuke12.0.exe" --studio +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/nukex10.0.bat b/pype/settings/defaults/launchers/windows/nukex10.0.bat new file mode 100644 index 0000000000..1759706a7b --- /dev/null +++ b/pype/settings/defaults/launchers/windows/nukex10.0.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="NukeX10.0v4" +set __exe__="C:\Program Files\Nuke10.0v4\Nuke10.0.exe" -nukex +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/nukex11.0.bat b/pype/settings/defaults/launchers/windows/nukex11.0.bat new file mode 100644 index 0000000000..b554a7b6fa --- /dev/null +++ b/pype/settings/defaults/launchers/windows/nukex11.0.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="NukeX11.0v4" +set __exe__="C:\Program Files\Nuke11.0v4\Nuke11.0.exe" --nukex +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/nukex11.2.bat b/pype/settings/defaults/launchers/windows/nukex11.2.bat new file mode 100644 index 0000000000..a4cb5dec5c --- /dev/null +++ b/pype/settings/defaults/launchers/windows/nukex11.2.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="NukeX11.2v3" +set __exe__="C:\Program Files\Nuke11.2v3\Nuke11.2.exe" --nukex +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/nukex11.3.bat b/pype/settings/defaults/launchers/windows/nukex11.3.bat new file mode 100644 index 0000000000..490b55cf4c --- /dev/null +++ b/pype/settings/defaults/launchers/windows/nukex11.3.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="NukeX11.3v1" +set __exe__="C:\Program Files\Nuke11.3v1\Nuke11.3.exe" --nukex +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/nukex12.0.bat b/pype/settings/defaults/launchers/windows/nukex12.0.bat new file mode 100644 index 0000000000..26adf0d3f1 --- /dev/null +++ b/pype/settings/defaults/launchers/windows/nukex12.0.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="NukeX12.0v1" +set __exe__="C:\Program Files\Nuke12.0v1\Nuke12.0.exe" --nukex +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/photoshop_2020.bat b/pype/settings/defaults/launchers/windows/photoshop_2020.bat new file mode 100644 index 0000000000..6b90922ef6 --- /dev/null +++ b/pype/settings/defaults/launchers/windows/photoshop_2020.bat @@ -0,0 +1,15 @@ +@echo off + +set __app__="Photoshop 2020" +set __exe__="C:\Program Files\Adobe\Adobe Photoshop 2020\Photoshop.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% cmd.exe /k "%PYPE_PYTHON_EXE% -c ^"import avalon.photoshop;avalon.photoshop.launch("%__exe__%")^"" + +goto :eof + +pause + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/premiere_pro_2019.bat b/pype/settings/defaults/launchers/windows/premiere_pro_2019.bat new file mode 100644 index 0000000000..4886737d2f --- /dev/null +++ b/pype/settings/defaults/launchers/windows/premiere_pro_2019.bat @@ -0,0 +1,14 @@ +@echo off + +set __app__="Adobe Premiere Pro" +set __exe__="C:\Program Files\Adobe\Adobe Premiere Pro CC 2019\Adobe Premiere Pro.exe" +if not exist %__exe__% goto :missing_app + +python -u %PREMIERA_PATH%\init.py +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/premiere_pro_2020.bat b/pype/settings/defaults/launchers/windows/premiere_pro_2020.bat new file mode 100644 index 0000000000..14662d3be3 --- /dev/null +++ b/pype/settings/defaults/launchers/windows/premiere_pro_2020.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Adobe Premiere Pro" +set __exe__="C:\Program Files\Adobe\Adobe Premiere Pro 2020\Adobe Premiere Pro.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/python3.bat b/pype/settings/defaults/launchers/windows/python3.bat new file mode 100644 index 0000000000..c7c116fe72 --- /dev/null +++ b/pype/settings/defaults/launchers/windows/python3.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Python36" +set __exe__="C:\Python36\python.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/resolve_16.bat b/pype/settings/defaults/launchers/windows/resolve_16.bat new file mode 100644 index 0000000000..1a5d964e6b --- /dev/null +++ b/pype/settings/defaults/launchers/windows/resolve_16.bat @@ -0,0 +1,17 @@ +@echo off + +set __app__="Resolve" +set __appy__="Resolve Python Console" +set __exe__="C:/Program Files/Blackmagic Design/DaVinci Resolve/Resolve.exe" +set __py__="%PYTHON36_RESOLVE%/python.exe" + +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %* +IF "%RESOLVE_DEV%"=="True" (start %__appy__% %__py__% -i %PRE_PYTHON_SCRIPT%) + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/shell.bat b/pype/settings/defaults/launchers/windows/shell.bat new file mode 100644 index 0000000000..eb0895364f --- /dev/null +++ b/pype/settings/defaults/launchers/windows/shell.bat @@ -0,0 +1,2 @@ +@echo off +start cmd diff --git a/pype/settings/defaults/launchers/windows/storyboardpro_7.bat b/pype/settings/defaults/launchers/windows/storyboardpro_7.bat new file mode 100644 index 0000000000..122edac572 --- /dev/null +++ b/pype/settings/defaults/launchers/windows/storyboardpro_7.bat @@ -0,0 +1,13 @@ +@echo off + +set __app__="Storyboard Pro 7" +set __exe__="C:/Program Files (x86)/Toon Boom Animation/Toon Boom Storyboard Pro 7/win64/bin/StoryboardPro.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% cmd.exe /k "python -c ^"import avalon.storyboardpro;avalon.storyboardpro.launch("%__exe__%")^"" + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 diff --git a/pype/settings/defaults/launchers/windows/unreal.bat b/pype/settings/defaults/launchers/windows/unreal.bat new file mode 100644 index 0000000000..7771aaa5a5 --- /dev/null +++ b/pype/settings/defaults/launchers/windows/unreal.bat @@ -0,0 +1,11 @@ +set __app__="Unreal Editor" +set __exe__="%AVALON_CURRENT_UNREAL_ENGINE%\Engine\Binaries\Win64\UE4Editor.exe" +if not exist %__exe__% goto :missing_app + +start %__app__% %__exe__% %PYPE_UNREAL_PROJECT_FILE% %* + +goto :eof + +:missing_app + echo ERROR: %__app__% not found in %__exe__% + exit /B 1 From 9e40f3c9fd719bc39ce2a2efa26c2c4979272199 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 30 Sep 2020 14:50:33 +0200 Subject: [PATCH 34/95] implemented function which returns environments --- pype/settings/lib.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pype/settings/lib.py b/pype/settings/lib.py index 388557ca9b..848bdeea92 100644 --- a/pype/settings/lib.py +++ b/pype/settings/lib.py @@ -19,6 +19,12 @@ SYSTEM_SETTINGS_PATH = os.path.join( STUDIO_OVERRIDES_PATH, SYSTEM_SETTINGS_KEY + ".json" ) +# File where studio's environment overrides are stored +ENVIRONMENTS_KEY = "environments" +ENVIRONMENTS_PATH = os.path.join( + STUDIO_OVERRIDES_PATH, ENVIRONMENTS_KEY + ".json" +) + # File where studio's default project overrides are stored PROJECT_SETTINGS_KEY = "project_settings" PROJECT_SETTINGS_FILENAME = PROJECT_SETTINGS_KEY + ".json" @@ -162,6 +168,12 @@ def studio_system_settings(): return {} +def studio_environments(): + if os.path.exists(ENVIRONMENTS_PATH): + return load_json(ENVIRONMENTS_PATH) + return {} + + def studio_project_settings(): if os.path.exists(PROJECT_SETTINGS_PATH): return load_json(PROJECT_SETTINGS_PATH) @@ -256,3 +268,9 @@ def project_settings(project_name): project_overrides = project_settings_overrides(project_name) return apply_overrides(studio_overrides, project_overrides) + + +def environments(): + default_values = default_settings()[ENVIRONMENTS_KEY] + studio_values = studio_system_settings() + return apply_overrides(default_values, studio_values) From def129501420aa644d8304f6a6c719ac12a97c55 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 30 Sep 2020 14:50:48 +0200 Subject: [PATCH 35/95] added environemnts function to pype.api --- pype/api.py | 4 +++- pype/settings/__init__.py | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pype/api.py b/pype/api.py index 021080b4d5..c1bf84b4ef 100644 --- a/pype/api.py +++ b/pype/api.py @@ -1,6 +1,7 @@ from .settings import ( system_settings, - project_settings + project_settings, + environments ) from pypeapp import ( Logger, @@ -55,6 +56,7 @@ from .lib import _subprocess as subprocess __all__ = [ "system_settings", "project_settings", + "environments", "Logger", "Anatomy", diff --git a/pype/settings/__init__.py b/pype/settings/__init__.py index 7e73d541a4..7a99ba0b2f 100644 --- a/pype/settings/__init__.py +++ b/pype/settings/__init__.py @@ -1,9 +1,11 @@ from .lib import ( system_settings, - project_settings + project_settings, + environments ) __all__ = ( "system_settings", - "project_settings" + "project_settings", + "environments" ) From 6951e046de4a531a635a80ca8909f601cac076c9 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 30 Sep 2020 15:13:19 +0200 Subject: [PATCH 36/95] clockify modules does not use Qt unless tray_init is triggered --- pype/modules/clockify/clockify.py | 75 +++++++++++++++++-------------- 1 file changed, 41 insertions(+), 34 deletions(-) diff --git a/pype/modules/clockify/clockify.py b/pype/modules/clockify/clockify.py index fea15a1bea..24f1b0b39d 100644 --- a/pype/modules/clockify/clockify.py +++ b/pype/modules/clockify/clockify.py @@ -1,9 +1,8 @@ import os import threading +import time + from pype.api import Logger -from avalon import style -from Qt import QtWidgets -from .widgets import ClockifySettings, MessageWidget from .clockify_api import ClockifyAPI from .constants import CLOCKIFY_FTRACK_USER_PATH @@ -17,11 +16,21 @@ class ClockifyModule: os.environ["CLOCKIFY_WORKSPACE"] = self.workspace_name + self.timer_manager = None + self.MessageWidgetClass = None + + self.clockapi = ClockifyAPI(master_parent=self) + self.log = Logger().get_logger(self.__class__.__name__, "PypeTray") + self.tray_init(main_parent, parent) + + def tray_init(self, main_parent, parent): + from .widgets import ClockifySettings, MessageWidget + + self.MessageWidgetClass = MessageWidget self.main_parent = main_parent self.parent = parent - self.clockapi = ClockifyAPI(master_parent=self) self.message_widget = None self.widget_settings = ClockifySettings(main_parent, self) self.widget_settings_required = None @@ -78,12 +87,12 @@ class ClockifyModule: self.stop_timer() def timer_started(self, data): - if hasattr(self, 'timer_manager'): + if self.timer_manager: self.timer_manager.start_timers(data) def timer_stopped(self): self.bool_timer_run = False - if hasattr(self, 'timer_manager'): + if self.timer_manager: self.timer_manager.stop_timers() def start_timer_check(self): @@ -102,7 +111,7 @@ class ClockifyModule: self.thread_timer_check = None def check_running(self): - import time + while self.bool_thread_check_running is True: bool_timer_run = False if self.clockapi.get_in_progress() is not None: @@ -156,15 +165,14 @@ class ClockifyModule: self.timer_stopped() def signed_in(self): - if hasattr(self, 'timer_manager'): - if not self.timer_manager: - return + if not self.timer_manager: + return - if not self.timer_manager.last_task: - return + if not self.timer_manager.last_task: + return - if self.timer_manager.is_running: - self.start_timer_manager(self.timer_manager.last_task) + if self.timer_manager.is_running: + self.start_timer_manager(self.timer_manager.last_task) def start_timer(self, input_data): # If not api key is not entered then skip @@ -197,11 +205,12 @@ class ClockifyModule: "

Please inform your Project Manager." ).format(project_name, str(self.clockapi.workspace_name)) - self.message_widget = MessageWidget( - self.main_parent, msg, "Clockify - Info Message" - ) - self.message_widget.closed.connect(self.on_message_widget_close) - self.message_widget.show() + if self.MessageWidgetClass: + self.message_widget = self.MessageWidgetClass( + self.main_parent, msg, "Clockify - Info Message" + ) + self.message_widget.closed.connect(self.on_message_widget_close) + self.message_widget.show() return @@ -227,31 +236,29 @@ class ClockifyModule: # Definition of Tray menu def tray_menu(self, parent_menu): # Menu for Tray App - self.menu = QtWidgets.QMenu('Clockify', parent_menu) - self.menu.setProperty('submenu', 'on') - self.menu.setStyleSheet(style.load_stylesheet()) + from Qt import QtWidgets + menu = QtWidgets.QMenu("Clockify", parent_menu) + menu.setProperty("submenu", "on") # Actions - self.aShowSettings = QtWidgets.QAction( - "Settings", self.menu - ) - self.aStopTimer = QtWidgets.QAction( - "Stop timer", self.menu - ) + action_show_settings = QtWidgets.QAction("Settings", menu) + action_stop_timer = QtWidgets.QAction("Stop timer", menu) - self.menu.addAction(self.aShowSettings) - self.menu.addAction(self.aStopTimer) + menu.addAction(action_show_settings) + menu.addAction(action_stop_timer) - self.aShowSettings.triggered.connect(self.show_settings) - self.aStopTimer.triggered.connect(self.stop_timer) + action_show_settings.triggered.connect(self.show_settings) + action_stop_timer.triggered.connect(self.stop_timer) + + self.action_stop_timer = action_stop_timer self.set_menu_visibility() - parent_menu.addMenu(self.menu) + parent_menu.addMenu(menu) def show_settings(self): self.widget_settings.input_api_key.setText(self.clockapi.get_api_key()) self.widget_settings.show() def set_menu_visibility(self): - self.aStopTimer.setVisible(self.bool_timer_run) + self.action_stop_timer.setVisible(self.bool_timer_run) From d8eec091c316dc6bdbec09d9093a2778f77281ff Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 30 Sep 2020 15:19:31 +0200 Subject: [PATCH 37/95] fix hound --- pype/modules/clockify/clockify.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pype/modules/clockify/clockify.py b/pype/modules/clockify/clockify.py index 24f1b0b39d..4309bff9f2 100644 --- a/pype/modules/clockify/clockify.py +++ b/pype/modules/clockify/clockify.py @@ -66,11 +66,10 @@ class ClockifyModule: ) if 'AvalonApps' in modules: - from launcher import lib - actions_path = os.path.sep.join([ + actions_path = os.path.join( os.path.dirname(__file__), 'launcher_actions' - ]) + ) current = os.environ.get('AVALON_ACTIONS', '') if current: current += os.pathsep @@ -209,7 +208,9 @@ class ClockifyModule: self.message_widget = self.MessageWidgetClass( self.main_parent, msg, "Clockify - Info Message" ) - self.message_widget.closed.connect(self.on_message_widget_close) + self.message_widget.closed.connect( + self.on_message_widget_close + ) self.message_widget.show() return From 4785cf26c4afdf1e9cbe82806515a35e405c773e Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 30 Sep 2020 15:24:31 +0200 Subject: [PATCH 38/95] muster is not using Qt until tray_init is triggered --- pype/modules/muster/muster.py | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/pype/modules/muster/muster.py b/pype/modules/muster/muster.py index 629fb12635..beb30690ac 100644 --- a/pype/modules/muster/muster.py +++ b/pype/modules/muster/muster.py @@ -1,10 +1,7 @@ -import appdirs -from avalon import style -from Qt import QtWidgets import os import json -from .widget_login import MusterLogin -from avalon.vendor import requests +import appdirs +import requests class MusterModule: @@ -21,6 +18,11 @@ class MusterModule: self.cred_path = os.path.join( self.cred_folder_path, self.cred_filename ) + self.tray_init(main_parent, parent) + + def tray_init(self, main_parent, parent): + from .widget_login import MusterLogin + self.main_parent = main_parent self.parent = parent self.widget_login = MusterLogin(main_parent, self) @@ -38,10 +40,6 @@ class MusterModule: pass def process_modules(self, modules): - - def api_callback(): - self.aShowLogin.trigger() - if "RestApiServer" in modules: def api_show_login(): self.aShowLogin.trigger() @@ -51,13 +49,12 @@ class MusterModule: # Definition of Tray menu def tray_menu(self, parent): - """ - Add **change credentials** option to tray menu. - """ + """Add **change credentials** option to tray menu.""" + from Qt import QtWidgets + # Menu for Tray App self.menu = QtWidgets.QMenu('Muster', parent) self.menu.setProperty('submenu', 'on') - self.menu.setStyleSheet(style.load_stylesheet()) # Actions self.aShowLogin = QtWidgets.QAction( @@ -91,9 +88,9 @@ class MusterModule: if not MUSTER_REST_URL: raise AttributeError("Muster REST API url not set") params = { - 'username': username, - 'password': password - } + 'username': username, + 'password': password + } api_entry = '/api/login' response = self._requests_post( MUSTER_REST_URL + api_entry, params=params) From 15bb321b1f25cac721a10fc357f612c5d5d9ad46 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 1 Oct 2020 15:44:17 +0200 Subject: [PATCH 39/95] system widget can store environment fields --- pype/tools/settings/settings/widgets/base.py | 5 +++++ pype/tools/settings/settings/widgets/item_types.py | 3 +++ 2 files changed, 8 insertions(+) diff --git a/pype/tools/settings/settings/widgets/base.py b/pype/tools/settings/settings/widgets/base.py index 243a8448e5..9cff07ea90 100644 --- a/pype/tools/settings/settings/widgets/base.py +++ b/pype/tools/settings/settings/widgets/base.py @@ -47,6 +47,7 @@ class SystemWidget(QtWidgets.QWidget): self._ignore_value_changes = False self.input_fields = [] + self.environ_fields = [] scroll_widget = QtWidgets.QScrollArea(self) scroll_widget.setObjectName("GroupWidget") @@ -130,10 +131,14 @@ class SystemWidget(QtWidgets.QWidget): for input_field in self.input_fields: input_field.hierarchical_style_update() + def add_environ_field(self, input_field): + self.environ_fields.append(input_field) + def reset(self): reset_default_settings() self.input_fields.clear() + self.environ_fields.clear() while self.content_layout.count() != 0: widget = self.content_layout.itemAt(0).widget() self.content_layout.removeWidget(widget) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 4124c32ba8..9c55f5dc05 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -140,6 +140,9 @@ class SettingObject: """ return self._has_studio_override or self._parent.has_studio_override + def add_environ_field(self, input_field): + self._parent.add_environ_field(input_field) + @property def as_widget(self): """Item is used as widget in parent item. From 226ddab164af10a6c3447eca7dcf912a617e1748 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 1 Oct 2020 16:15:38 +0200 Subject: [PATCH 40/95] preparation for storing to separated environments settings --- .../settings/settings/widgets/item_types.py | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 9c55f5dc05..d1c29b6ae1 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -24,6 +24,8 @@ class SettingObject: # Will allow to show actions for the item type (disabled for proxies) else # item is skipped and try to trigger actions on it's parent. allow_actions = True + # If item can store environment values + allow_to_environment = False # All item types must have implemented Qt signal which is emitted when # it's or it's children value has changed, value_changed = None @@ -49,6 +51,9 @@ class SettingObject: self._as_widget = False self._is_group = False + # If value should be stored to environments + self._env_group_key = None + self._any_parent_as_widget = None self._any_parent_is_group = None @@ -84,6 +89,20 @@ class SettingObject: self._is_group = input_data.get("is_group", False) # TODO not implemented yet self._is_nullable = input_data.get("is_nullable", False) + self._env_group_key = input_data.get("env_group_key") + + if self.is_environ: + if not self.allow_to_environment: + raise TypeError(( + "Item {} does not allow to store environment values" + ).format(input_data["type"])) + + if self.as_widget: + raise TypeError(( + "Item is used as widget and" + " marked to store environments at the same time." + )) + self.add_environ_field(self) any_parent_as_widget = parent.as_widget if not any_parent_as_widget: @@ -140,9 +159,25 @@ class SettingObject: """ return self._has_studio_override or self._parent.has_studio_override + @property + def is_environ(self): + return self._env_group_key is not None + + @property + def env_group_key(self): + return self._env_group_key + def add_environ_field(self, input_field): self._parent.add_environ_field(input_field) + @property + def has_only_environ_children(self): + raise NotImplementedError( + "{} does not have implemented `has_only_environ_children`".format( + self + ) + ) + @property def as_widget(self): """Item is used as widget in parent item. @@ -270,8 +305,17 @@ class SettingObject: def config_value(self): """Output for saving changes or overrides.""" + if self.has_only_environ_children: + return {} return {self.key: self.item_value()} + def environment_value(self): + raise NotImplementedError( + "{} Method `set_studio_default` not implemented!".format( + repr(self) + ) + ) + @classmethod def style_state( cls, has_studio_override, is_invalid, is_overriden, is_modified @@ -667,6 +711,10 @@ class InputObject(SettingObject): self.value_changed.emit(self) + @property + def has_only_environ_children(self): + return self.is_environ + def studio_overrides(self): if ( not (self.as_widget or self.any_parent_as_widget) @@ -882,6 +930,7 @@ class NumberWidget(QtWidgets.QWidget, InputObject): class TextWidget(QtWidgets.QWidget, InputObject): default_input_value = "" value_changed = QtCore.Signal(object) + # allow_to_environment = True def __init__( self, input_data, parent, @@ -985,6 +1034,7 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): class EnumeratorWidget(QtWidgets.QWidget, InputObject): default_input_value = True value_changed = QtCore.Signal(object) + # allow_to_environment = True def __init__( self, input_data, parent, @@ -1136,6 +1186,7 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): class RawJsonWidget(QtWidgets.QWidget, InputObject): default_input_value = "{}" value_changed = QtCore.Signal(object) + allow_to_environment = True def __init__( self, input_data, parent, @@ -1182,6 +1233,12 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): self._is_invalid = self.input_field.has_invalid_value() return super(RawJsonWidget, self)._on_value_change(*args, **kwargs) + def environment_value(self): + output = {} + for key, value in self.item_value().items(): + output[key.upper()] = value + return output + def item_value(self): if self.is_invalid: return NOT_SET @@ -1372,6 +1429,7 @@ class ListItem(QtWidgets.QWidget, SettingObject): class ListWidget(QtWidgets.QWidget, InputObject): default_input_value = [] value_changed = QtCore.Signal(object) + # allow_to_environment = True def __init__( self, input_data, parent, @@ -1944,6 +2002,7 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): # TODO this is actually input field (do not care if is group or not) value_changed = QtCore.Signal(object) expand_in_grid = True + # allow_to_environment = True def __init__( self, input_data, parent, @@ -2209,6 +2268,8 @@ class DictWidget(QtWidgets.QWidget, SettingObject): self.input_fields = [] + self._has_only_environ_children = None + self.checkbox_widget = None self.checkbox_key = input_data.get("checkbox_key") @@ -2532,6 +2593,19 @@ class DictWidget(QtWidgets.QWidget, SettingObject): return True return False + @property + def has_only_environ_children(self): + if self._has_only_environ_children is None: + has_only_environ_children = True + if not self.is_environ: + for input_field in self.input_fields: + if not input_field.has_only_environ_children: + has_only_environ_children = False + break + + self._has_only_environ_children = has_only_environ_children + return self._has_only_environ_children + def get_invalid(self): output = [] for input_field in self.input_fields: @@ -2600,6 +2674,8 @@ class DictInvisible(QtWidgets.QWidget, SettingObject): self.initial_attributes(input_data, parent, as_widget) + self._has_only_environ_children = None + if self._is_group: raise TypeError("DictInvisible can't be marked as group input.") @@ -2660,6 +2736,19 @@ class DictInvisible(QtWidgets.QWidget, SettingObject): return True return False + @property + def has_only_environ_children(self): + if self._has_only_environ_children is None: + has_only_environ_children = True + if not self.is_environ: + for input_field in self.input_fields: + if not input_field.has_only_environ_children: + has_only_environ_children = False + break + + self._has_only_environ_children = has_only_environ_children + return self._has_only_environ_children + @property def child_modified(self): for input_field in self.input_fields: @@ -2840,6 +2929,7 @@ class PathWidget(QtWidgets.QWidget, SettingObject): "darwin": "MacOS", "linux": "Linux" } + # allow_to_environment = True def __init__( self, input_data, parent, @@ -3136,6 +3226,10 @@ class PathWidget(QtWidgets.QWidget, SettingObject): def set_as_overriden(self): self._is_overriden = True + @property + def has_only_environ_children(self): + return self.is_environ + @property def child_has_studio_override(self): return self.has_studio_override @@ -3200,6 +3294,8 @@ class DictFormWidget(QtWidgets.QWidget, SettingObject): self.initial_attributes(input_data, parent, as_widget) + self._has_only_environ_children = None + self._as_widget = False self._is_group = False @@ -3307,6 +3403,19 @@ class DictFormWidget(QtWidgets.QWidget, SettingObject): return True return False + @property + def has_only_environ_children(self): + if self._has_only_environ_children is None: + has_only_environ_children = True + if not self.is_environ: + for input_field in self.input_fields: + if not input_field.has_only_environ_children: + has_only_environ_children = False + break + + self._has_only_environ_children = has_only_environ_children + return self._has_only_environ_children + @property def child_modified(self): for input_field in self.input_fields: From 227755669f444f903e6cf73d50d3944250c617e2 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 1 Oct 2020 17:57:21 +0200 Subject: [PATCH 41/95] METATADATA_KEY is object not type --- pype/tools/settings/settings/widgets/lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/tools/settings/settings/widgets/lib.py b/pype/tools/settings/settings/widgets/lib.py index cf2bd7f8af..f9c0532a97 100644 --- a/pype/tools/settings/settings/widgets/lib.py +++ b/pype/tools/settings/settings/widgets/lib.py @@ -11,7 +11,7 @@ class TypeToKlass: NOT_SET = type("NOT_SET", (), {"__bool__": lambda obj: False})() -METADATA_KEY = type("METADATA_KEY", (), {}) +METADATA_KEY = type("METADATA_KEY", (), {})() OVERRIDE_VERSION = 1 CHILD_OFFSET = 15 From 8a8aa0422db964e2ed1162699e1f5ad33badb917 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 1 Oct 2020 17:57:51 +0200 Subject: [PATCH 42/95] raise KeyError exception not just create --- pype/tools/settings/settings/widgets/lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/tools/settings/settings/widgets/lib.py b/pype/tools/settings/settings/widgets/lib.py index f9c0532a97..88e4015198 100644 --- a/pype/tools/settings/settings/widgets/lib.py +++ b/pype/tools/settings/settings/widgets/lib.py @@ -30,7 +30,7 @@ def convert_gui_data_to_overrides(data, first=True): if key == "groups": output[OVERRIDEN_KEY] = value else: - KeyError("Unknown metadata key \"{}\"".format(key)) + raise KeyError("Unknown metadata key \"{}\"".format(key)) for key, value in data.items(): output[key] = convert_gui_data_to_overrides(value, False) From 9afcdd3546b79ad25c81b223f94410fb37250ddc Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 1 Oct 2020 17:59:04 +0200 Subject: [PATCH 43/95] renamed variable OVERRIDEN_KEY to M_OVERRIDEN_KEY --- pype/settings/lib.py | 6 +++--- pype/tools/settings/settings/widgets/lib.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pype/settings/lib.py b/pype/settings/lib.py index 848bdeea92..f8b483cae9 100644 --- a/pype/settings/lib.py +++ b/pype/settings/lib.py @@ -6,7 +6,7 @@ import copy log = logging.getLogger(__name__) # Metadata keys for work with studio and project overrides -OVERRIDEN_KEY = "__overriden_keys__" +M_OVERRIDEN_KEY = "__overriden_keys__" # NOTE key popping not implemented yet POP_KEY = "__pop_key__" @@ -223,8 +223,8 @@ def project_anatomy_overrides(project_name): def merge_overrides(global_dict, override_dict): - if OVERRIDEN_KEY in override_dict: - overriden_keys = set(override_dict.pop(OVERRIDEN_KEY)) + if M_OVERRIDEN_KEY in override_dict: + overriden_keys = set(override_dict.pop(M_OVERRIDEN_KEY)) else: overriden_keys = set() diff --git a/pype/tools/settings/settings/widgets/lib.py b/pype/tools/settings/settings/widgets/lib.py index 88e4015198..479653e4d4 100644 --- a/pype/tools/settings/settings/widgets/lib.py +++ b/pype/tools/settings/settings/widgets/lib.py @@ -1,7 +1,7 @@ import os import json import copy -from pype.settings.lib import OVERRIDEN_KEY +from pype.settings.lib import M_OVERRIDEN_KEY, M_ENVIRONMENT_KEY from queue import Queue @@ -28,7 +28,7 @@ def convert_gui_data_to_overrides(data, first=True): metadata = data.pop(METADATA_KEY) for key, value in metadata.items(): if key == "groups": - output[OVERRIDEN_KEY] = value + output[M_OVERRIDEN_KEY] = value else: raise KeyError("Unknown metadata key \"{}\"".format(key)) @@ -42,8 +42,8 @@ def convert_overrides_to_gui_data(data, first=True): return data output = {} - if OVERRIDEN_KEY in data: - groups = data.pop(OVERRIDEN_KEY) + if M_OVERRIDEN_KEY in data: + groups = data.pop(M_OVERRIDEN_KEY) if METADATA_KEY not in output: output[METADATA_KEY] = {} output[METADATA_KEY]["groups"] = groups From 4903c09f40a870c802f84f0c070d70c1e8d7052f Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 1 Oct 2020 17:59:20 +0200 Subject: [PATCH 44/95] variable POP_KEY renamed to M_POP_KEY --- pype/settings/lib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pype/settings/lib.py b/pype/settings/lib.py index f8b483cae9..4faf757198 100644 --- a/pype/settings/lib.py +++ b/pype/settings/lib.py @@ -8,7 +8,7 @@ log = logging.getLogger(__name__) # Metadata keys for work with studio and project overrides M_OVERRIDEN_KEY = "__overriden_keys__" # NOTE key popping not implemented yet -POP_KEY = "__pop_key__" +M_POP_KEY = "__pop_key__" # Folder where studio overrides are stored STUDIO_OVERRIDES_PATH = os.environ["PYPE_PROJECT_CONFIGS"] @@ -229,7 +229,7 @@ def merge_overrides(global_dict, override_dict): overriden_keys = set() for key, value in override_dict.items(): - if value == POP_KEY: + if value == M_POP_KEY: global_dict.pop(key) elif ( From ec445fcc2d28ea775c63227b265c3c03127aeabc Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 1 Oct 2020 17:59:32 +0200 Subject: [PATCH 45/95] added new M_ENVIRONMENT_KEY for storing environments --- pype/settings/lib.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pype/settings/lib.py b/pype/settings/lib.py index 4faf757198..b01c80038f 100644 --- a/pype/settings/lib.py +++ b/pype/settings/lib.py @@ -7,6 +7,8 @@ log = logging.getLogger(__name__) # Metadata keys for work with studio and project overrides M_OVERRIDEN_KEY = "__overriden_keys__" +# Metadata key for storing information about environments +M_ENVIRONMENT_KEY = "__environment_keys__" # NOTE key popping not implemented yet M_POP_KEY = "__pop_key__" From e6749a53f7f0285ab2b5ec767d9c6b1f463ec715 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 1 Oct 2020 18:00:11 +0200 Subject: [PATCH 46/95] added 2 functions for converting gui data for storing and oposite --- pype/tools/settings/settings/widgets/lib.py | 38 +++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/pype/tools/settings/settings/widgets/lib.py b/pype/tools/settings/settings/widgets/lib.py index 479653e4d4..e7ab00d7bd 100644 --- a/pype/tools/settings/settings/widgets/lib.py +++ b/pype/tools/settings/settings/widgets/lib.py @@ -16,6 +16,44 @@ OVERRIDE_VERSION = 1 CHILD_OFFSET = 15 +def convert_gui_data_with_metadata(data, ignored_keys=None): + if not data or not isinstance(data, dict): + return data + + if ignored_keys is None: + ignored_keys = tuple() + + output = {} + if METADATA_KEY in data: + metadata = data.pop(METADATA_KEY) + for key, value in metadata.items(): + if key in ignored_keys or key == "groups": + continue + + if key == "environments": + output[M_ENVIRONMENT_KEY] = value + else: + raise KeyError("Unknown metadata key \"{}\"".format(key)) + + for key, value in data.items(): + output[key] = convert_gui_data_with_metadata(value, ignored_keys) + return output + + +def convert_data_to_gui_data(data, first=True): + if not data or not isinstance(data, dict): + return data + + output = {} + if M_ENVIRONMENT_KEY in data: + data.pop(M_ENVIRONMENT_KEY) + + for key, value in data.items(): + output[key] = convert_data_to_gui_data(value, False) + + return output + + def convert_gui_data_to_overrides(data, first=True): if not data or not isinstance(data, dict): return data From 116c9469c8394ea55b03b2e1d56755c00bad1963 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 1 Oct 2020 18:01:04 +0200 Subject: [PATCH 47/95] fix not implemented message --- pype/tools/settings/settings/widgets/item_types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index d1c29b6ae1..bad1ce08fe 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -311,7 +311,7 @@ class SettingObject: def environment_value(self): raise NotImplementedError( - "{} Method `set_studio_default` not implemented!".format( + "{} Method `environment_value` not implemented!".format( repr(self) ) ) From 08554af5fdea03b76bf2a02bdb239848231f70bb Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 1 Oct 2020 18:01:38 +0200 Subject: [PATCH 48/95] bases use converting in and out data --- pype/tools/settings/settings/widgets/base.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/pype/tools/settings/settings/widgets/base.py b/pype/tools/settings/settings/widgets/base.py index 9cff07ea90..7cbe7c2f6f 100644 --- a/pype/tools/settings/settings/widgets/base.py +++ b/pype/tools/settings/settings/widgets/base.py @@ -219,7 +219,7 @@ class SystemWidget(QtWidgets.QWidget): all_values = _all_values # Skip first key - all_values = all_values["system"] + all_values = lib.convert_gui_data_with_metadata(all_values["system"]) prject_defaults_dir = os.path.join( DEFAULTS_DIR, SYSTEM_SETTINGS_KEY @@ -251,16 +251,19 @@ class SystemWidget(QtWidgets.QWidget): def _update_values(self): self.ignore_value_changes = True - default_values = { + default_values = lib.convert_data_to_gui_data({ "system": default_settings()[SYSTEM_SETTINGS_KEY] - } + }) for input_field in self.input_fields: input_field.update_default_values(default_values) if self._hide_studio_overrides: system_values = lib.NOT_SET else: - system_values = {"system": studio_system_settings()} + system_values = lib.convert_overrides_to_gui_data( + {"system": studio_system_settings()} + ) + for input_field in self.input_fields: input_field.update_studio_values(system_values) @@ -735,17 +738,20 @@ class ProjectWidget(QtWidgets.QWidget): def _update_values(self): self.ignore_value_changes = True - default_values = {"project": default_settings()} + default_values = default_values = lib.convert_data_to_gui_data( + {"project": default_settings()} + ) for input_field in self.input_fields: input_field.update_default_values(default_values) if self._hide_studio_overrides: studio_values = lib.NOT_SET else: - studio_values = {"project": { + studio_values = lib.convert_overrides_to_gui_data({"project": { PROJECT_SETTINGS_KEY: studio_project_settings(), PROJECT_ANATOMY_KEY: studio_project_anatomy() - }} + }}) + for input_field in self.input_fields: input_field.update_studio_values(studio_values) From e804c47214fb451f02fd988c1a5d0c74f59d17e8 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 1 Oct 2020 18:02:05 +0200 Subject: [PATCH 49/95] converting functions for overrides use new implemented conversions --- pype/tools/settings/settings/widgets/lib.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pype/tools/settings/settings/widgets/lib.py b/pype/tools/settings/settings/widgets/lib.py index e7ab00d7bd..31e4401ab0 100644 --- a/pype/tools/settings/settings/widgets/lib.py +++ b/pype/tools/settings/settings/widgets/lib.py @@ -61,6 +61,7 @@ def convert_gui_data_to_overrides(data, first=True): output = {} if first: output["__override_version__"] = OVERRIDE_VERSION + data = convert_gui_data_with_metadata(data, ("environments",)) if METADATA_KEY in data: metadata = data.pop(METADATA_KEY) @@ -79,6 +80,9 @@ def convert_overrides_to_gui_data(data, first=True): if not data or not isinstance(data, dict): return data + if first: + data = convert_data_to_gui_data(data) + output = {} if M_OVERRIDEN_KEY in data: groups = data.pop(M_OVERRIDEN_KEY) From d33de6856674304ba6008690c2906e7cf13e4b06 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 1 Oct 2020 18:02:48 +0200 Subject: [PATCH 50/95] removed `has_only_environ_children` --- .../settings/settings/widgets/item_types.py | 63 ------------------- 1 file changed, 63 deletions(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index bad1ce08fe..76b8504685 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -170,14 +170,6 @@ class SettingObject: def add_environ_field(self, input_field): self._parent.add_environ_field(input_field) - @property - def has_only_environ_children(self): - raise NotImplementedError( - "{} does not have implemented `has_only_environ_children`".format( - self - ) - ) - @property def as_widget(self): """Item is used as widget in parent item. @@ -305,8 +297,6 @@ class SettingObject: def config_value(self): """Output for saving changes or overrides.""" - if self.has_only_environ_children: - return {} return {self.key: self.item_value()} def environment_value(self): @@ -711,10 +701,6 @@ class InputObject(SettingObject): self.value_changed.emit(self) - @property - def has_only_environ_children(self): - return self.is_environ - def studio_overrides(self): if ( not (self.as_widget or self.any_parent_as_widget) @@ -2268,8 +2254,6 @@ class DictWidget(QtWidgets.QWidget, SettingObject): self.input_fields = [] - self._has_only_environ_children = None - self.checkbox_widget = None self.checkbox_key = input_data.get("checkbox_key") @@ -2593,19 +2577,6 @@ class DictWidget(QtWidgets.QWidget, SettingObject): return True return False - @property - def has_only_environ_children(self): - if self._has_only_environ_children is None: - has_only_environ_children = True - if not self.is_environ: - for input_field in self.input_fields: - if not input_field.has_only_environ_children: - has_only_environ_children = False - break - - self._has_only_environ_children = has_only_environ_children - return self._has_only_environ_children - def get_invalid(self): output = [] for input_field in self.input_fields: @@ -2674,8 +2645,6 @@ class DictInvisible(QtWidgets.QWidget, SettingObject): self.initial_attributes(input_data, parent, as_widget) - self._has_only_environ_children = None - if self._is_group: raise TypeError("DictInvisible can't be marked as group input.") @@ -2736,19 +2705,6 @@ class DictInvisible(QtWidgets.QWidget, SettingObject): return True return False - @property - def has_only_environ_children(self): - if self._has_only_environ_children is None: - has_only_environ_children = True - if not self.is_environ: - for input_field in self.input_fields: - if not input_field.has_only_environ_children: - has_only_environ_children = False - break - - self._has_only_environ_children = has_only_environ_children - return self._has_only_environ_children - @property def child_modified(self): for input_field in self.input_fields: @@ -3226,10 +3182,6 @@ class PathWidget(QtWidgets.QWidget, SettingObject): def set_as_overriden(self): self._is_overriden = True - @property - def has_only_environ_children(self): - return self.is_environ - @property def child_has_studio_override(self): return self.has_studio_override @@ -3294,8 +3246,6 @@ class DictFormWidget(QtWidgets.QWidget, SettingObject): self.initial_attributes(input_data, parent, as_widget) - self._has_only_environ_children = None - self._as_widget = False self._is_group = False @@ -3403,19 +3353,6 @@ class DictFormWidget(QtWidgets.QWidget, SettingObject): return True return False - @property - def has_only_environ_children(self): - if self._has_only_environ_children is None: - has_only_environ_children = True - if not self.is_environ: - for input_field in self.input_fields: - if not input_field.has_only_environ_children: - has_only_environ_children = False - break - - self._has_only_environ_children = has_only_environ_children - return self._has_only_environ_children - @property def child_modified(self): for input_field in self.input_fields: From 9de4efc7c35fcd91557d865810db2e4585abfabc Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 1 Oct 2020 18:50:10 +0200 Subject: [PATCH 51/95] prepared method for merging metadata under same key --- .../settings/settings/widgets/item_types.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 76b8504685..6b35246db9 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -32,6 +32,24 @@ class SettingObject: # Item will expand to full width in grid layout expand_in_grid = False + def merge_metadata(self, current_metadata, new_metadata): + for key, value in new_metadata.items(): + if key not in current_metadata: + current_metadata[key] = value + + elif key == "groups": + current_metadata[key].extend(value) + + elif key == "environments": + for group_key, subvalue in value.items(): + if group_key not in current_metadata[key]: + current_metadata[key][group_key] = [] + current_metadata[key][group_key].extend(subvalue) + + else: + raise KeyError("Unknown metadata key: \"{}\"".format(key)) + return current_metadata + def _set_default_attributes(self): """Create and reset attributes required for all item types. From 2933eab903716e43ea4c44b0d5395dd2dd46ac02 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 1 Oct 2020 18:51:20 +0200 Subject: [PATCH 52/95] dicitonaries can merge metadata keys --- .../settings/settings/widgets/item_types.py | 106 ++++++++++-------- 1 file changed, 58 insertions(+), 48 deletions(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 6b35246db9..74eab078e1 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -2609,6 +2609,33 @@ class DictWidget(QtWidgets.QWidget, SettingObject): output.update(input_field.config_value()) return output + def _override_values(self, project_overrides): + values = {} + groups = [] + for input_field in self.input_fields: + if project_overrides: + value, is_group = input_field.overrides() + else: + value, is_group = input_field.studio_overrides() + if value is NOT_SET: + continue + + if METADATA_KEY in value and METADATA_KEY in values: + new_metadata = value.pop(METADATA_KEY) + values[METADATA_KEY] = self.merge_metadata( + values[METADATA_KEY], new_metadata + ) + + values.update(value) + if is_group: + groups.extend(value.keys()) + + if groups: + if METADATA_KEY not in values: + values[METADATA_KEY] = {} + values[METADATA_KEY]["groups"] = groups + return {self.key: values}, self.is_group + def studio_overrides(self): if ( not (self.as_widget or self.any_parent_as_widget) @@ -2616,34 +2643,12 @@ class DictWidget(QtWidgets.QWidget, SettingObject): and not self.child_has_studio_override ): return NOT_SET, False - - values = {} - groups = [] - for input_field in self.input_fields: - value, is_group = input_field.studio_overrides() - if value is not NOT_SET: - values.update(value) - if is_group: - groups.extend(value.keys()) - if groups: - values[METADATA_KEY] = {"groups": groups} - return {self.key: values}, self.is_group + return self._override_values(False) def overrides(self): if not self.is_overriden and not self.child_overriden: return NOT_SET, False - - values = {} - groups = [] - for input_field in self.input_fields: - value, is_group = input_field.overrides() - if value is not NOT_SET: - values.update(value) - if is_group: - groups.extend(value.keys()) - if groups: - values[METADATA_KEY] = {"groups": groups} - return {self.key: values}, self.is_group + return self._override_values(True) class DictInvisible(QtWidgets.QWidget, SettingObject): @@ -2858,6 +2863,33 @@ class DictInvisible(QtWidgets.QWidget, SettingObject): ) self._was_overriden = bool(self._is_overriden) + def _override_values(self, project_overrides): + values = {} + groups = [] + for input_field in self.input_fields: + if project_overrides: + value, is_group = input_field.overrides() + else: + value, is_group = input_field.studio_overrides() + if value is NOT_SET: + continue + + if METADATA_KEY in value and METADATA_KEY in values: + new_metadata = value.pop(METADATA_KEY) + values[METADATA_KEY] = self.merge_metadata( + values[METADATA_KEY], new_metadata + ) + + values.update(value) + if is_group: + groups.extend(value.keys()) + + if groups: + if METADATA_KEY not in values: + values[METADATA_KEY] = {} + values[METADATA_KEY]["groups"] = groups + return {self.key: values}, self.is_group + def studio_overrides(self): if ( not (self.as_widget or self.any_parent_as_widget) @@ -2865,34 +2897,12 @@ class DictInvisible(QtWidgets.QWidget, SettingObject): and not self.child_has_studio_override ): return NOT_SET, False - - values = {} - groups = [] - for input_field in self.input_fields: - value, is_group = input_field.studio_overrides() - if value is not NOT_SET: - values.update(value) - if is_group: - groups.extend(value.keys()) - if groups: - values[METADATA_KEY] = {"groups": groups} - return {self.key: values}, self.is_group + return self._override_values(False) def overrides(self): if not self.is_overriden and not self.child_overriden: return NOT_SET, False - - values = {} - groups = [] - for input_field in self.input_fields: - value, is_group = input_field.overrides() - if value is not NOT_SET: - values.update(value) - if is_group: - groups.extend(value.keys()) - if groups: - values[METADATA_KEY] = {"groups": groups} - return {self.key: values}, self.is_group + return self._override_values(True) class PathWidget(QtWidgets.QWidget, SettingObject): From 65d51d56a80638c5e0a6c79d6a1bbc67dd42093b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 1 Oct 2020 18:51:42 +0200 Subject: [PATCH 53/95] raw-json can store environments --- pype/tools/settings/settings/widgets/item_types.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 74eab078e1..70f0506a2b 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -1246,7 +1246,15 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): def item_value(self): if self.is_invalid: return NOT_SET - return self.input_field.json_value() + + value = self.input_field.json_value() + if self.is_environ: + value[METADATA_KEY] = { + "environments": { + self.env_group_key: list(value.keys()) + } + } + return value class ListItem(QtWidgets.QWidget, SettingObject): From 03bbc6e839eb8f71df7dab7d5701a0916bc6b777 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 1 Oct 2020 19:01:16 +0200 Subject: [PATCH 54/95] raw json can return env value/keys --- .../settings/settings/widgets/item_types.py | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 70f0506a2b..1adebddff7 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -1237,24 +1237,24 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): self._is_invalid = self.input_field.has_invalid_value() return super(RawJsonWidget, self)._on_value_change(*args, **kwargs) - def environment_value(self): - output = {} - for key, value in self.item_value().items(): - output[key.upper()] = value - return output - def item_value(self): if self.is_invalid: return NOT_SET value = self.input_field.json_value() - if self.is_environ: - value[METADATA_KEY] = { - "environments": { - self.env_group_key: list(value.keys()) - } + if not self.is_environ: + return value + + output = {} + for key, value in value.items(): + output[key.upper()] = value + + output[METADATA_KEY] = { + "environments": { + self.env_group_key: list(output.keys()) } - return value + } + return output class ListItem(QtWidgets.QWidget, SettingObject): From 484a35ae528dbf6e79610cc343591316098e5fad Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 1 Oct 2020 19:15:23 +0200 Subject: [PATCH 55/95] modified way how environments are loaded --- pype/settings/lib.py | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/pype/settings/lib.py b/pype/settings/lib.py index b01c80038f..7c1adcd8a7 100644 --- a/pype/settings/lib.py +++ b/pype/settings/lib.py @@ -113,6 +113,32 @@ def load_json(fpath): return {} +def find_environments(data): + if not data or not isinstance(data, dict): + return + + output = {} + if M_ENVIRONMENT_KEY in data: + metadata = data.pop(M_ENVIRONMENT_KEY) + for env_group_key, env_keys in metadata.items(): + output[env_group_key] = {} + for key in env_keys: + output[env_group_key][key] = data[key] + + for value in data.values(): + result = find_environments(value) + if not result: + continue + + for env_group_key, env_values in result.items(): + if env_group_key not in output: + output[env_group_key] = {} + + for env_key, env_value in env_values.items(): + output[env_group_key][env_key] = env_value + return output + + def subkey_merge(_dict, value, keys): key = keys.pop(0) if not keys: @@ -274,5 +300,5 @@ def project_settings(project_name): def environments(): default_values = default_settings()[ENVIRONMENTS_KEY] - studio_values = studio_system_settings() + studio_values = find_environments(system_settings()) return apply_overrides(default_values, studio_values) From 87df2ea1019505911e908ac862afc3761719af52 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 1 Oct 2020 19:30:18 +0200 Subject: [PATCH 56/95] added validation for env group keys --- pype/tools/settings/settings/widgets/lib.py | 55 +++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/pype/tools/settings/settings/widgets/lib.py b/pype/tools/settings/settings/widgets/lib.py index 31e4401ab0..6d8694dc7a 100644 --- a/pype/tools/settings/settings/widgets/lib.py +++ b/pype/tools/settings/settings/widgets/lib.py @@ -162,6 +162,21 @@ class SchemaDuplicatedKeys(Exception): super(SchemaDuplicatedKeys, self).__init__(msg) +class SchemaDuplicatedEnvGroupKeys(Exception): + def __init__(self, invalid): + items = [] + for key_path, keys in invalid.items(): + joined_keys = ", ".join([ + "\"{}\"".format(key) for key in keys + ]) + items.append("\"{}\" ({})".format(key_path, joined_keys)) + + msg = ( + "Schema items contain duplicated environment group keys. {}" + ).format(" || ".join(items)) + super(SchemaDuplicatedEnvGroupKeys, self).__init__(msg) + + def file_keys_from_schema(schema_data): output = [] item_type = schema_data["type"] @@ -319,10 +334,50 @@ def validate_keys_are_unique(schema_data, keys=None): raise SchemaDuplicatedKeys(invalid) +def validate_environment_groups_uniquenes( + schema_data, env_groups=None, keys=None +): + is_first = False + if env_groups is None: + is_first = True + env_groups = {} + keys = [] + + my_keys = copy.deepcopy(keys) + key = schema_data.get("key") + if key: + my_keys.append(key) + + env_group_key = schema_data.get("env_group_key") + if env_group_key: + if env_group_key not in env_groups: + env_groups[env_group_key] = [] + env_groups[env_group_key].append("/".join(my_keys)) + + children = schema_data.get("children") + if not children: + return + + for child in children: + validate_environment_groups_uniquenes( + child, env_groups, copy.deepcopy(my_keys) + ) + + if is_first: + invalid = {} + for env_group_key, key_paths in env_groups.items(): + if len(key_paths) > 1: + invalid[env_group_key] = key_paths + + if invalid: + raise SchemaDuplicatedEnvGroupKeys(invalid) + + def validate_schema(schema_data): validate_all_has_ending_file(schema_data) validate_is_group_is_unique_in_hierarchy(schema_data) validate_keys_are_unique(schema_data) + validate_environment_groups_uniquenes(schema_data) def gui_schema(subfolder, main_schema_name): From d7492a13c4c828f200b2de74af2ba5a521506a7d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 1 Oct 2020 19:36:43 +0200 Subject: [PATCH 57/95] added example of usage raw json for environments --- .../gui_schemas/system_schema/1_examples.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/1_examples.json b/pype/tools/settings/settings/gui_schemas/system_schema/1_examples.json index dd0f7f20d1..06ce23321a 100644 --- a/pype/tools/settings/settings/gui_schemas/system_schema/1_examples.json +++ b/pype/tools/settings/settings/gui_schemas/system_schema/1_examples.json @@ -5,6 +5,18 @@ "is_file": true, "children": [ { + "key": "env_group_test", + "label": "EnvGroup Test", + "type": "dict", + "children": [ + { + "key": "key_to_store_in_system_settings", + "label": "Testing environment group", + "type": "raw-json", + "env_group_key": "test_group" + } + ] + }, { "key": "dict_wrapper", "type": "dict-invisible", "children": [ From fb6061e80be838e113039083b3d00a824fb85a60 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 1 Oct 2020 19:44:02 +0200 Subject: [PATCH 58/95] changed logic of environment keys loading --- pype/settings/lib.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pype/settings/lib.py b/pype/settings/lib.py index 7c1adcd8a7..96c3829388 100644 --- a/pype/settings/lib.py +++ b/pype/settings/lib.py @@ -299,6 +299,8 @@ def project_settings(project_name): def environments(): - default_values = default_settings()[ENVIRONMENTS_KEY] - studio_values = find_environments(system_settings()) - return apply_overrides(default_values, studio_values) + envs = copy.deepcopy(default_settings()[ENVIRONMENTS_KEY]) + envs_from_system_settings = find_environments(system_settings()) + for env_group_key, values in envs_from_system_settings.items(): + envs[env_group_key] = values + return envs From de6daa65ca5e746dcf6dbc8ed8b90a7426846188 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 1 Oct 2020 19:52:37 +0200 Subject: [PATCH 59/95] cleanup --- pype/tools/settings/settings/widgets/item_types.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 1adebddff7..1127d611d7 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -934,7 +934,6 @@ class NumberWidget(QtWidgets.QWidget, InputObject): class TextWidget(QtWidgets.QWidget, InputObject): default_input_value = "" value_changed = QtCore.Signal(object) - # allow_to_environment = True def __init__( self, input_data, parent, @@ -1038,7 +1037,6 @@ class PathInputWidget(QtWidgets.QWidget, InputObject): class EnumeratorWidget(QtWidgets.QWidget, InputObject): default_input_value = True value_changed = QtCore.Signal(object) - # allow_to_environment = True def __init__( self, input_data, parent, @@ -1441,7 +1439,6 @@ class ListItem(QtWidgets.QWidget, SettingObject): class ListWidget(QtWidgets.QWidget, InputObject): default_input_value = [] value_changed = QtCore.Signal(object) - # allow_to_environment = True def __init__( self, input_data, parent, @@ -2014,7 +2011,6 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): # TODO this is actually input field (do not care if is group or not) value_changed = QtCore.Signal(object) expand_in_grid = True - # allow_to_environment = True def __init__( self, input_data, parent, @@ -2921,7 +2917,6 @@ class PathWidget(QtWidgets.QWidget, SettingObject): "darwin": "MacOS", "linux": "Linux" } - # allow_to_environment = True def __init__( self, input_data, parent, From 14ce8eb4428fead21aaafa8df55d90e5b6a5d26e Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 1 Oct 2020 22:54:54 +0200 Subject: [PATCH 60/95] fix saving of environmentes to studio overrides --- pype/tools/settings/settings/widgets/lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/tools/settings/settings/widgets/lib.py b/pype/tools/settings/settings/widgets/lib.py index 6d8694dc7a..87f6554612 100644 --- a/pype/tools/settings/settings/widgets/lib.py +++ b/pype/tools/settings/settings/widgets/lib.py @@ -61,7 +61,7 @@ def convert_gui_data_to_overrides(data, first=True): output = {} if first: output["__override_version__"] = OVERRIDE_VERSION - data = convert_gui_data_with_metadata(data, ("environments",)) + data = convert_gui_data_with_metadata(data) if METADATA_KEY in data: metadata = data.pop(METADATA_KEY) From e7abb30da2dc4c8df14dd9ae173b87eca8b3e9c6 Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Thu, 1 Oct 2020 23:57:12 +0200 Subject: [PATCH 61/95] add application schemas --- .../system_settings/global/applications.json | 286 ++++++++++++++++-- .../system_settings/global/hosts.json | 34 +++ .../system_schema/0_system_gui_schema.json | 3 + .../1_applications_gui_schema.json | 151 ++------- .../system_schema/1_hosts_gui_schema.json | 139 +++++++++ .../system_schema/system_harmony_schema.json | 86 ++++++ .../system_schema/system_hiero_schema.json | 128 ++++++++ .../system_schema/system_host_exe_schema.json | 39 +++ .../system_schema/system_houdini_schema.json | 52 ++++ .../system_schema/system_maya_schema.json | 69 +++++ .../system_schema/system_nuke_schema.json | 128 ++++++++ .../system_photoshop_schema.json | 35 +++ 12 files changed, 989 insertions(+), 161 deletions(-) create mode 100644 pype/settings/defaults/system_settings/global/hosts.json create mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/1_hosts_gui_schema.json create mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/system_harmony_schema.json create mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/system_hiero_schema.json create mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/system_host_exe_schema.json create mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/system_houdini_schema.json create mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/system_maya_schema.json create mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/system_nuke_schema.json create mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/system_photoshop_schema.json diff --git a/pype/settings/defaults/system_settings/global/applications.json b/pype/settings/defaults/system_settings/global/applications.json index e85e5864d9..2cf64e396b 100644 --- a/pype/settings/defaults/system_settings/global/applications.json +++ b/pype/settings/defaults/system_settings/global/applications.json @@ -1,34 +1,256 @@ { - "blender_2.80": false, - "blender_2.81": false, - "blender_2.82": false, - "blender_2.83": true, - "celaction_local": true, - "celaction_remote": true, - "harmony_17": true, - "maya_2017": false, - "maya_2018": false, - "maya_2019": true, - "maya_2020": true, - "nuke_10.0": false, - "nuke_11.2": false, - "nuke_11.3": true, - "nuke_12.0": true, - "nukex_10.0": false, - "nukex_11.2": false, - "nukex_11.3": true, - "nukex_12.0": true, - "nukestudio_10.0": false, - "nukestudio_11.2": false, - "nukestudio_11.3": true, - "nukestudio_12.0": true, - "houdini_16": false, - "houdini_16.5": false, - "houdini_17": false, - "houdini_18": true, - "premiere_2019": false, - "premiere_2020": true, - "resolve_16": true, - "storyboardpro_7": true, - "unreal_4.24": true + "maya": { + "enabled": true, + "environment": {}, + "maya_2020": { + "enabled": true, + "common": { + "executable": { + "windows": [], + "linux": [], + "mac": [] + }, + "environment": {} + } + }, + "maya_2019": { + "enabled": true, + "common": { + "executable": { + "windows": [], + "linux": [], + "mac": [] + }, + "environment": {} + } + }, + "maya_2018": { + "enabled": true, + "common": { + "executable": { + "windows": [], + "linux": [], + "mac": [] + }, + "environment": {} + } + } + }, + "nuke": { + "enabled": true, + "environment": {}, + "nuke_12.1": { + "enabled": true, + "nukeX": true, + "common": { + "executable": { + "windows": [], + "linux": [], + "mac": [] + }, + "environment": {} + } + }, + "nuke_11.3": { + "enabled": true, + "nukeX": true, + "common": { + "executable": { + "windows": [], + "linux": [], + "mac": [] + }, + "environment": {} + } + }, + "nuke_11.2": { + "enabled": true, + "nukeX": true, + "common": { + "executable": { + "windows": [], + "linux": [], + "mac": [] + }, + "environment": {} + } + }, + "nuke_11.1": { + "enabled": true, + "nukeX": true, + "common": { + "executable": { + "windows": [], + "linux": [], + "mac": [] + }, + "environment": {} + } + }, + "nuke_10": { + "enabled": true, + "nukeX": true, + "common": { + "executable": { + "windows": [], + "linux": [], + "mac": [] + }, + "environment": {} + } + } + }, + "hiero": { + "enabled": true, + "environment": {}, + "hiero_12.1": { + "enabled": true, + "nukestudio": true, + "common": { + "executable": { + "windows": [], + "linux": [], + "mac": [] + }, + "environment": {} + } + }, + "hiero_11.3": { + "enabled": true, + "nukestudio": true, + "common": { + "executable": { + "windows": [], + "linux": [], + "mac": [] + }, + "environment": {} + } + }, + "hiero_11.2": { + "enabled": true, + "nukestudio": true, + "common": { + "executable": { + "windows": [], + "linux": [], + "mac": [] + }, + "environment": {} + } + }, + "hiero_11.1": { + "enabled": true, + "nukestudio": true, + "common": { + "executable": { + "windows": [], + "linux": [], + "mac": [] + }, + "environment": {} + } + }, + "hiero_10": { + "enabled": true, + "nukestudio": true, + "common": { + "executable": { + "windows": [], + "linux": [], + "mac": [] + }, + "environment": {} + } + } + }, + "houdini": { + "enabled": true, + "environment": {}, + "houdini_18": { + "enabled": true, + "common": { + "executable": { + "windows": [], + "linux": [], + "mac": [] + }, + "environment": {} + } + }, + "houdini_17": { + "enabled": true, + "common": { + "executable": { + "windows": [], + "linux": [], + "mac": [] + }, + "environment": {} + } + } + }, + "harmony": { + "enabled": true, + "environment_maya": {}, + "harmony_20": { + "enabled": true, + "common": { + "executable": { + "windows": [], + "linux": [], + "mac": [] + }, + "environment": {} + } + }, + "harmony_19": { + "enabled": true, + "common": { + "executable": { + "windows": [], + "linux": [], + "mac": [] + }, + "environment": {} + } + }, + "harmony_18": { + "enabled": true, + "common": { + "executable": { + "windows": [], + "linux": [], + "mac": [] + }, + "environment": {} + } + }, + "harmony_17": { + "enabled": true, + "common": { + "executable": { + "windows": [], + "linux": [], + "mac": [] + }, + "environment": {} + } + } + }, + "photoshop": { + "enabled": true, + "environment": {}, + "photoshop_2020": { + "enabled": true, + "common": { + "executable": { + "windows": [], + "linux": [], + "mac": [] + }, + "environment": {} + } + } + } } \ No newline at end of file diff --git a/pype/settings/defaults/system_settings/global/hosts.json b/pype/settings/defaults/system_settings/global/hosts.json new file mode 100644 index 0000000000..35ee708df3 --- /dev/null +++ b/pype/settings/defaults/system_settings/global/hosts.json @@ -0,0 +1,34 @@ +{ + "blender_2.80": true, + "blender_2.81": true, + "blender_2.82": true, + "blender_2.83": true, + "celaction_local": true, + "celaction_remote": true, + "harmony_17": true, + "maya_2017": true, + "maya_2018": true, + "maya_2019": true, + "maya_2020": true, + "nuke_10.0": true, + "nuke_11.2": true, + "nuke_11.3": true, + "nuke_12.0": true, + "nukex_10.0": true, + "nukex_11.2": true, + "nukex_11.3": true, + "nukex_12.0": true, + "nukestudio_10.0": true, + "nukestudio_11.2": true, + "nukestudio_11.3": true, + "nukestudio_12.0": true, + "houdini_16": true, + "houdini_16.5": true, + "houdini_17": true, + "houdini_18": true, + "premiere_2019": true, + "premiere_2020": true, + "resolve_16": true, + "storyboardpro_7": true, + "unreal_4.24": true +} \ No newline at end of file diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/0_system_gui_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/0_system_gui_schema.json index c5f229fc2f..dbae81501e 100644 --- a/pype/tools/settings/settings/gui_schemas/system_schema/0_system_gui_schema.json +++ b/pype/tools/settings/settings/gui_schemas/system_schema/0_system_gui_schema.json @@ -14,6 +14,9 @@ }, { "type": "schema", "name": "1_applications_gui_schema" + }, { + "type": "schema", + "name": "1_hosts_gui_schema" }, { "type": "schema", "name": "1_tools_gui_schema" diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/1_applications_gui_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/1_applications_gui_schema.json index 3427f98253..95e2763f35 100644 --- a/pype/tools/settings/settings/gui_schemas/system_schema/1_applications_gui_schema.json +++ b/pype/tools/settings/settings/gui_schemas/system_schema/1_applications_gui_schema.json @@ -3,137 +3,30 @@ "type": "dict", "label": "Applications", "collapsable": true, - "is_group": true, "is_file": true, - "children": [ + "children": [{ + "type": "schema", + "name": "system_maya_schema" + }, { - "type": "boolean", - "key": "blender_2.80", - "label": "Blender 2.80" - }, { - "type": "boolean", - "key": "blender_2.81", - "label": "Blender 2.81" - }, { - "type": "boolean", - "key": "blender_2.82", - "label": "Blender 2.82" - }, { - "type": "boolean", - "key": "blender_2.83", - "label": "Blender 2.83" - }, { - "type": "boolean", - "key": "celaction_local", - "label": "Celaction Local" - }, { - "type": "boolean", - "key": "celaction_remote", - "label": "Celaction Remote" - }, { - "type": "boolean", - "key": "harmony_17", - "label": "Harmony 17" - }, { - "type": "boolean", - "key": "maya_2017", - "label": "Autodest Maya 2017" - }, { - "type": "boolean", - "key": "maya_2018", - "label": "Autodest Maya 2018" - }, { - "type": "boolean", - "key": "maya_2019", - "label": "Autodest Maya 2019" - }, { - "type": "boolean", - "key": "maya_2020", - "label": "Autodest Maya 2020" - }, { - "key": "nuke_10.0", - "type": "boolean", - "label": "Nuke 10.0" - }, { - "type": "boolean", - "key": "nuke_11.2", - "label": "Nuke 11.2" - }, { - "type": "boolean", - "key": "nuke_11.3", - "label": "Nuke 11.3" - }, { - "type": "boolean", - "key": "nuke_12.0", - "label": "Nuke 12.0" - }, { - "type": "boolean", - "key": "nukex_10.0", - "label": "NukeX 10.0" - }, { - "type": "boolean", - "key": "nukex_11.2", - "label": "NukeX 11.2" - }, { - "type": "boolean", - "key": "nukex_11.3", - "label": "NukeX 11.3" - }, { - "type": "boolean", - "key": "nukex_12.0", - "label": "NukeX 12.0" - }, { - "type": "boolean", - "key": "nukestudio_10.0", - "label": "NukeStudio 10.0" - }, { - "type": "boolean", - "key": "nukestudio_11.2", - "label": "NukeStudio 11.2" - }, { - "type": "boolean", - "key": "nukestudio_11.3", - "label": "NukeStudio 11.3" - }, { - "type": "boolean", - "key": "nukestudio_12.0", - "label": "NukeStudio 12.0" - }, { - "type": "boolean", - "key": "houdini_16", - "label": "Houdini 16" - }, { - "type": "boolean", - "key": "houdini_16.5", - "label": "Houdini 16.5" - }, { - "type": "boolean", - "key": "houdini_17", - "label": "Houdini 17" - }, { - "type": "boolean", - "key": "houdini_18", - "label": "Houdini 18" - }, { - "type": "boolean", - "key": "premiere_2019", - "label": "Premiere 2019" - }, { - "type": "boolean", - "key": "premiere_2020", - "label": "Premiere 2020" - }, { - "type": "boolean", - "key": "resolve_16", - "label": "BM DaVinci Resolve 16" - }, { - "type": "boolean", - "key": "storyboardpro_7", - "label": "Storyboard Pro 7" - }, { - "type": "boolean", - "key": "unreal_4.24", - "label": "Unreal Editor 4.24" + "type": "schema", + "name": "system_nuke_schema" + }, + { + "type": "schema", + "name": "system_hiero_schema" + }, + { + "type": "schema", + "name": "system_houdini_schema" + }, + { + "type": "schema", + "name": "system_harmony_schema" + }, + { + "type": "schema", + "name": "system_photoshop_schema" } ] } diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/1_hosts_gui_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/1_hosts_gui_schema.json new file mode 100644 index 0000000000..277b9d1d8e --- /dev/null +++ b/pype/tools/settings/settings/gui_schemas/system_schema/1_hosts_gui_schema.json @@ -0,0 +1,139 @@ +{ + "key": "hosts", + "type": "dict", + "label": "Hosts", + "collapsable": true, + "is_group": true, + "is_file": true, + "children": [ + { + "type": "boolean", + "key": "blender_2.80", + "label": "Blender 2.80" + }, { + "type": "boolean", + "key": "blender_2.81", + "label": "Blender 2.81" + }, { + "type": "boolean", + "key": "blender_2.82", + "label": "Blender 2.82" + }, { + "type": "boolean", + "key": "blender_2.83", + "label": "Blender 2.83" + }, { + "type": "boolean", + "key": "celaction_local", + "label": "Celaction Local" + }, { + "type": "boolean", + "key": "celaction_remote", + "label": "Celaction Remote" + }, { + "type": "boolean", + "key": "harmony_17", + "label": "Harmony 17" + }, { + "type": "boolean", + "key": "maya_2017", + "label": "Autodest Maya 2017" + }, { + "type": "boolean", + "key": "maya_2018", + "label": "Autodest Maya 2018" + }, { + "type": "boolean", + "key": "maya_2019", + "label": "Autodest Maya 2019" + }, { + "type": "boolean", + "key": "maya_2020", + "label": "Autodest Maya 2020" + }, { + "key": "nuke_10.0", + "type": "boolean", + "label": "Nuke 10.0" + }, { + "type": "boolean", + "key": "nuke_11.2", + "label": "Nuke 11.2" + }, { + "type": "boolean", + "key": "nuke_11.3", + "label": "Nuke 11.3" + }, { + "type": "boolean", + "key": "nuke_12.0", + "label": "Nuke 12.0" + }, { + "type": "boolean", + "key": "nukex_10.0", + "label": "NukeX 10.0" + }, { + "type": "boolean", + "key": "nukex_11.2", + "label": "NukeX 11.2" + }, { + "type": "boolean", + "key": "nukex_11.3", + "label": "NukeX 11.3" + }, { + "type": "boolean", + "key": "nukex_12.0", + "label": "NukeX 12.0" + }, { + "type": "boolean", + "key": "nukestudio_10.0", + "label": "NukeStudio 10.0" + }, { + "type": "boolean", + "key": "nukestudio_11.2", + "label": "NukeStudio 11.2" + }, { + "type": "boolean", + "key": "nukestudio_11.3", + "label": "NukeStudio 11.3" + }, { + "type": "boolean", + "key": "nukestudio_12.0", + "label": "NukeStudio 12.0" + }, { + "type": "boolean", + "key": "houdini_16", + "label": "Houdini 16" + }, { + "type": "boolean", + "key": "houdini_16.5", + "label": "Houdini 16.5" + }, { + "type": "boolean", + "key": "houdini_17", + "label": "Houdini 17" + }, { + "type": "boolean", + "key": "houdini_18", + "label": "Houdini 18" + }, { + "type": "boolean", + "key": "premiere_2019", + "label": "Premiere 2019" + }, { + "type": "boolean", + "key": "premiere_2020", + "label": "Premiere 2020" + }, { + "type": "boolean", + "key": "resolve_16", + "label": "BM DaVinci Resolve 16" + }, { + "type": "boolean", + "key": "storyboardpro_7", + "label": "Storyboard Pro 7" + }, { + "type": "boolean", + "key": "unreal_4.24", + "label": "Unreal Editor 4.24" + } + ] +} diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/system_harmony_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/system_harmony_schema.json new file mode 100644 index 0000000000..4ef97bc8a2 --- /dev/null +++ b/pype/tools/settings/settings/gui_schemas/system_schema/system_harmony_schema.json @@ -0,0 +1,86 @@ +{ + "type": "dict", + "key": "harmony", + "label": "Toon Boom Harmony", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "raw-json", + "key": "environment_maya", + "label": "Environment" + }, + { + "type": "dict", + "key": "harmony_20", + "label": "20", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "schema", + "name": "system_host_exe_schema" + } + ] + }, + { + "type": "dict", + "key": "harmony_19", + "label": "19", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "schema", + "name": "system_host_exe_schema" + } + ] + }, + { + "type": "dict", + "key": "harmony_18", + "label": "18", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "schema", + "name": "system_host_exe_schema" + } + ] + }, + { + "type": "dict", + "key": "harmony_17", + "label": "17", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "schema", + "name": "system_host_exe_schema" + } + ] + } + ] +} diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/system_hiero_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/system_hiero_schema.json new file mode 100644 index 0000000000..ecbb98b281 --- /dev/null +++ b/pype/tools/settings/settings/gui_schemas/system_schema/system_hiero_schema.json @@ -0,0 +1,128 @@ +{ + "type": "dict", + "key": "hiero", + "label": "Foundry Hiero / Nuke Studio", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "raw-json", + "key": "environment", + "label": "Environment" + }, + { + "type": "dict", + "key": "hiero_12.1", + "label": "12.1", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "boolean", + "key": "nukestudio", + "label": "Nuke Studio" + }, + { + "type": "schema", + "name": "system_host_exe_schema" + } + ] + }, + { + "type": "dict", + "key": "hiero_11.3", + "label": "11.3", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "boolean", + "key": "nukestudio", + "label": "Nuke Studio" + }, + { + "type": "schema", + "name": "system_host_exe_schema" + } + ] + }, + { + "type": "dict", + "key": "hiero_11.2", + "label": "11.2", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "boolean", + "key": "nukestudio", + "label": "Nuke Studio" + }, + { + "type": "schema", + "name": "system_host_exe_schema" + } + ] + }, + { + "type": "dict", + "key": "hiero_11.1", + "label": "11.1", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "boolean", + "key": "nukestudio", + "label": "Nuke Studio" + }, + { + "type": "schema", + "name": "system_host_exe_schema" + } + ] + }, + { + "type": "dict", + "key": "hiero_10", + "label": "10", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "boolean", + "key": "nukestudio", + "label": "Nuke Studio" + }, + { + "type": "schema", + "name": "system_host_exe_schema" + } + ] + } + ] +} diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/system_host_exe_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/system_host_exe_schema.json new file mode 100644 index 0000000000..7bf40ba69e --- /dev/null +++ b/pype/tools/settings/settings/gui_schemas/system_schema/system_host_exe_schema.json @@ -0,0 +1,39 @@ +{ + "type": "dict-invisible", + "key": "common", + "children": [{ + "type": "dict-invisible", + "key": "executable", + "children": [{ + "type": "list", + "key": "windows", + "label": "Windows Executable", + "object_type": { + "type": "text", + "multiline": false + } + }, { + "type": "list", + "key": "linux", + "label": "Linux Executable", + "object_type": { + "type": "text", + "multiline": false + } + }, { + "type": "list", + "key": "mac", + "label": "Mac Executable", + "object_type": { + "type": "text", + "multiline": false + } + }] + }, + { + "type": "raw-json", + "key": "environment", + "label": "Environment" + } + ] +} diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/system_houdini_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/system_houdini_schema.json new file mode 100644 index 0000000000..a6f58da172 --- /dev/null +++ b/pype/tools/settings/settings/gui_schemas/system_schema/system_houdini_schema.json @@ -0,0 +1,52 @@ +{ + "type": "dict", + "key": "houdini", + "label": "SideFX Houdini", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "raw-json", + "key": "environment", + "label": "Environment" + }, + { + "type": "dict", + "key": "houdini_18", + "label": "18", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "schema", + "name": "system_host_exe_schema" + } + ] + }, + { + "type": "dict", + "key": "houdini_17", + "label": "17", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "schema", + "name": "system_host_exe_schema" + } + ] + } + ] +} diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/system_maya_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/system_maya_schema.json new file mode 100644 index 0000000000..5c76f65792 --- /dev/null +++ b/pype/tools/settings/settings/gui_schemas/system_schema/system_maya_schema.json @@ -0,0 +1,69 @@ +{ + "type": "dict", + "key": "maya", + "label": "Autodesk Maya", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "raw-json", + "key": "environment", + "label": "Environment" + }, + { + "type": "dict", + "key": "maya_2020", + "label": "2020", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "schema", + "name": "system_host_exe_schema" + } + ] + }, + { + "type": "dict", + "key": "maya_2019", + "label": "2019", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "schema", + "name": "system_host_exe_schema" + } + ] + }, + { + "type": "dict", + "key": "maya_2018", + "label": "2018", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "schema", + "name": "system_host_exe_schema" + } + ] + } + ] +} diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/system_nuke_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/system_nuke_schema.json new file mode 100644 index 0000000000..205a4bb11a --- /dev/null +++ b/pype/tools/settings/settings/gui_schemas/system_schema/system_nuke_schema.json @@ -0,0 +1,128 @@ +{ + "type": "dict", + "key": "nuke", + "label": "Foundry Nuke", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "raw-json", + "key": "environment", + "label": "Environment" + }, + { + "type": "dict", + "key": "nuke_12.1", + "label": "12.1", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "boolean", + "key": "nukeX", + "label": "Nuke X" + }, + { + "type": "schema", + "name": "system_host_exe_schema" + } + ] + }, + { + "type": "dict", + "key": "nuke_11.3", + "label": "11.3", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "boolean", + "key": "nukeX", + "label": "Nuke X" + }, + { + "type": "schema", + "name": "system_host_exe_schema" + } + ] + }, + { + "type": "dict", + "key": "nuke_11.2", + "label": "11.2", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "boolean", + "key": "nukeX", + "label": "Nuke X" + }, + { + "type": "schema", + "name": "system_host_exe_schema" + } + ] + }, + { + "type": "dict", + "key": "nuke_11.1", + "label": "11.1", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "boolean", + "key": "nukeX", + "label": "Nuke X" + }, + { + "type": "schema", + "name": "system_host_exe_schema" + } + ] + }, + { + "type": "dict", + "key": "nuke_10", + "label": "10", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "boolean", + "key": "nukeX", + "label": "Nuke X" + }, + { + "type": "schema", + "name": "system_host_exe_schema" + } + ] + } + ] +} diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/system_photoshop_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/system_photoshop_schema.json new file mode 100644 index 0000000000..d04bcbed09 --- /dev/null +++ b/pype/tools/settings/settings/gui_schemas/system_schema/system_photoshop_schema.json @@ -0,0 +1,35 @@ +{ + "type": "dict", + "key": "photoshop", + "label": "Adobe Photoshop", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "raw-json", + "key": "environment", + "label": "Environment" + }, + { + "type": "dict", + "key": "photoshop_2020", + "label": "2020", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "schema", + "name": "system_host_exe_schema" + } + ] + } + ] +} From a1d3b8180701faae9270a8675197a613bd8480a4 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 2 Oct 2020 14:03:52 +0200 Subject: [PATCH 62/95] renamed `1_examples.json` to `example_schema.json` --- .../system_schema/{1_examples.json => example_schema.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename pype/tools/settings/settings/gui_schemas/system_schema/{1_examples.json => example_schema.json} (100%) diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/1_examples.json b/pype/tools/settings/settings/gui_schemas/system_schema/example_schema.json similarity index 100% rename from pype/tools/settings/settings/gui_schemas/system_schema/1_examples.json rename to pype/tools/settings/settings/gui_schemas/system_schema/example_schema.json From 39cf227447f2d82d8631dbae40ec3199a4afacfb Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 2 Oct 2020 14:09:48 +0200 Subject: [PATCH 63/95] added example template --- .../system_schema/example_template.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/example_template.json diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/example_template.json b/pype/tools/settings/settings/gui_schemas/system_schema/example_template.json new file mode 100644 index 0000000000..bf09ea6716 --- /dev/null +++ b/pype/tools/settings/settings/gui_schemas/system_schema/example_template.json @@ -0,0 +1,14 @@ +[ + { + "type": "rawj-json", + "label": "{env_label}", + "key": "{env_group_key}", + "env_group_key": "{env_group_key}" + }, { + "type": "path-widget", + "key": "executable_paths", + "label": "{executable_label} - Full paths to executables", + "multiplatform": true, + "multipath": true + } +] From be135af8cee02d6c762311c04bbbec07b5799446 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 2 Oct 2020 14:17:28 +0200 Subject: [PATCH 64/95] fixed example template --- .../gui_schemas/system_schema/example_template.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/example_template.json b/pype/tools/settings/settings/gui_schemas/system_schema/example_template.json index bf09ea6716..fb629c6170 100644 --- a/pype/tools/settings/settings/gui_schemas/system_schema/example_template.json +++ b/pype/tools/settings/settings/gui_schemas/system_schema/example_template.json @@ -1,13 +1,13 @@ [ { - "type": "rawj-json", - "label": "{env_label}", - "key": "{env_group_key}", - "env_group_key": "{env_group_key}" + "type": "raw-json", + "label": "{host_label} Environments", + "key": "{host_name}_environments", + "env_group_key": "{host_name}" }, { "type": "path-widget", - "key": "executable_paths", - "label": "{executable_label} - Full paths to executables", + "key": "{host_name}_executables", + "label": "{host_label} - Full paths to executables", "multiplatform": true, "multipath": true } From 3d07421dd95acc7a16dc2efa648a0943aecc79ec Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 2 Oct 2020 14:17:43 +0200 Subject: [PATCH 65/95] added schema template to example schema --- .../system_schema/example_schema.json | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/example_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/example_schema.json index 06ce23321a..ddd4fc7235 100644 --- a/pype/tools/settings/settings/gui_schemas/system_schema/example_schema.json +++ b/pype/tools/settings/settings/gui_schemas/system_schema/example_schema.json @@ -5,6 +5,27 @@ "is_file": true, "children": [ { + "type": "dict", + "key": "schema_templates", + "label": "Schema template examples", + "children": [ + { + "type": "schema_template", + "name": "example_template", + "template_data": { + "host_label": "Maya 2019", + "host_name": "maya_2019" + } + }, { + "type": "schema_template", + "name": "example_template", + "template_data": { + "host_label": "Maya 2020", + "host_name": "maya_2020" + } + } + ] + }, { "key": "env_group_test", "label": "EnvGroup Test", "type": "dict", From 42fa4c9871ddb9b7b07eab198f39fb6884ba7835 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 2 Oct 2020 14:18:58 +0200 Subject: [PATCH 66/95] schemas are also loaded in all subfolders --- pype/tools/settings/settings/widgets/lib.py | 27 ++++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/pype/tools/settings/settings/widgets/lib.py b/pype/tools/settings/settings/widgets/lib.py index 87f6554612..69f88df954 100644 --- a/pype/tools/settings/settings/widgets/lib.py +++ b/pype/tools/settings/settings/widgets/lib.py @@ -389,19 +389,22 @@ def gui_schema(subfolder, main_schema_name): ) loaded_schemas = {} - for filename in os.listdir(dirpath): - basename, ext = os.path.splitext(filename) - if ext != ".json": - continue + for root, _, filenames in os.walk(dirpath): + for filename in filenames: + basename, ext = os.path.splitext(filename) + if ext != ".json": + continue - filepath = os.path.join(dirpath, filename) - with open(filepath, "r") as json_stream: - try: - schema_data = json.load(json_stream) - except Exception as e: - raise Exception((f"Unable to parse JSON file {json_stream}\n " - f" - {e}")) from e - loaded_schemas[basename] = schema_data + filepath = os.path.join(root, filename) + with open(filepath, "r") as json_stream: + try: + schema_data = json.load(json_stream) + except Exception as exc: + raise Exception(( + f"Unable to parse JSON file {filepath}\n{exc}" + )) from exc + + loaded_schemas[basename] = schema_data main_schema = _fill_inner_schemas( loaded_schemas[main_schema_name], From c81d491198896290c7b0589f675514b7e58fd267 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 2 Oct 2020 14:19:35 +0200 Subject: [PATCH 67/95] if schema json contain list it is stored as template --- pype/tools/settings/settings/widgets/lib.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pype/tools/settings/settings/widgets/lib.py b/pype/tools/settings/settings/widgets/lib.py index 69f88df954..377f947d83 100644 --- a/pype/tools/settings/settings/widgets/lib.py +++ b/pype/tools/settings/settings/widgets/lib.py @@ -389,6 +389,7 @@ def gui_schema(subfolder, main_schema_name): ) loaded_schemas = {} + loaded_schema_templates = {} for root, _, filenames in os.walk(dirpath): for filename in filenames: basename, ext = os.path.splitext(filename) @@ -403,8 +404,10 @@ def gui_schema(subfolder, main_schema_name): raise Exception(( f"Unable to parse JSON file {filepath}\n{exc}" )) from exc - - loaded_schemas[basename] = schema_data + if isinstance(schema_data, list): + loaded_schema_templates[basename] = schema_data + else: + loaded_schemas[basename] = schema_data main_schema = _fill_inner_schemas( loaded_schemas[main_schema_name], From dd29192ffe970587b5288043ae7994911670ecd6 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 2 Oct 2020 14:20:48 +0200 Subject: [PATCH 68/95] implemented filling data of schema template --- pype/tools/settings/settings/widgets/lib.py | 55 +++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/pype/tools/settings/settings/widgets/lib.py b/pype/tools/settings/settings/widgets/lib.py index 377f947d83..7e4d5b126c 100644 --- a/pype/tools/settings/settings/widgets/lib.py +++ b/pype/tools/settings/settings/widgets/lib.py @@ -1,4 +1,5 @@ import os +import re import json import copy from pype.settings.lib import M_OVERRIDEN_KEY, M_ENVIRONMENT_KEY @@ -15,6 +16,8 @@ METADATA_KEY = type("METADATA_KEY", (), {})() OVERRIDE_VERSION = 1 CHILD_OFFSET = 15 +key_pattern = re.compile(r"(\{.*?[^{0]*\})") + def convert_gui_data_with_metadata(data, ignored_keys=None): if not data or not isinstance(data, dict): @@ -96,6 +99,58 @@ def convert_overrides_to_gui_data(data, first=True): return output +def _fill_schema_template_data( + template, template_data, required_keys=None, missing_keys=None +): + first = False + if required_keys is None: + first = True + required_keys = set() + missing_keys = set() + + if not template: + output = template + + elif isinstance(template, list): + output = [] + for item in template: + output.append(_fill_schema_template_data( + item, template_data, required_keys, missing_keys + )) + + elif isinstance(template, dict): + output = {} + for key, value in template.items(): + output[key] = _fill_schema_template_data( + value, template_data, required_keys, missing_keys + ) + + elif isinstance(template, str): + # TODO find much better way how to handle filling template data + for replacement_string in key_pattern.findall(template): + key = str(replacement_string[1:-1]) + required_keys.add(key) + if key not in template_data: + missing_keys.add(key) + continue + + value = template_data[key] + if replacement_string == template: + # Replace the value with value from templates data + # - with this is possible to set value with different type + template = value + else: + # Only replace the key in string + template = template.replace(replacement_string, value) + output = template + + else: + output = template + + if first and missing_keys: + raise SchemaTemplateMissingKeys(missing_keys, required_keys) + + return output def _fill_inner_schemas(schema_data, schema_collection): if schema_data["type"] == "schema": raise ValueError("First item in schema data can't be schema.") From 3a53f8a9441e471d989e5be22dff2fcfb10d6d92 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 2 Oct 2020 14:21:26 +0200 Subject: [PATCH 69/95] implemented function for handling `schema_template` item --- pype/tools/settings/settings/widgets/lib.py | 39 +++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/pype/tools/settings/settings/widgets/lib.py b/pype/tools/settings/settings/widgets/lib.py index 7e4d5b126c..aec28c949c 100644 --- a/pype/tools/settings/settings/widgets/lib.py +++ b/pype/tools/settings/settings/widgets/lib.py @@ -151,6 +151,45 @@ def _fill_schema_template_data( raise SchemaTemplateMissingKeys(missing_keys, required_keys) return output + + +def _fill_schema_template(child_data, schema_collection, schema_templates): + template_name = child_data["name"] + template = schema_templates.get(template_name) + if template is None: + if template_name in schema_collection: + raise KeyError(( + "Schema \"{}\" is used as `schema_template`" + ).format(template_name)) + raise KeyError("Schema template \"{}\" was not found".format( + template_name + )) + + template_data = child_data.get("template_data") or {} + try: + filled_child = _fill_schema_template_data( + template, template_data + ) + + except SchemaTemplateMissingKeys as exc: + raise SchemaTemplateMissingKeys( + exc.missing_keys, exc.required_keys, template_name + ) + + output = [] + for item in filled_child: + filled_item = _fill_inner_schemas( + item, schema_collection, schema_templates + ) + if filled_item["type"] == "schema_template": + output.extend(_fill_schema_template( + filled_item, schema_collection, schema_templates + )) + else: + output.append(filled_item) + return output + + def _fill_inner_schemas(schema_data, schema_collection): if schema_data["type"] == "schema": raise ValueError("First item in schema data can't be schema.") From 93f489d0c36cf52ef601e17c51271a918461bf94 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 2 Oct 2020 14:21:52 +0200 Subject: [PATCH 70/95] implemented exception for missing keys --- pype/tools/settings/settings/widgets/lib.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pype/tools/settings/settings/widgets/lib.py b/pype/tools/settings/settings/widgets/lib.py index aec28c949c..a20bf0608f 100644 --- a/pype/tools/settings/settings/widgets/lib.py +++ b/pype/tools/settings/settings/widgets/lib.py @@ -215,6 +215,26 @@ def _fill_inner_schemas(schema_data, schema_collection): return schema_data +class SchemaTemplateMissingKeys(Exception): + def __init__(self, missing_keys, required_keys, template_name=None): + self.missing_keys = missing_keys + self.required_keys = required_keys + if template_name: + msg = f"Schema template \"{template_name}\" require more keys.\n" + else: + msg = "" + msg += "Required keys: {}\nMissing keys: {}".format( + self.join_keys(required_keys), + self.join_keys(missing_keys) + ) + super(SchemaTemplateMissingKeys, self).__init__(msg) + + def join_keys(self, keys): + return ", ".join([ + f"\"{key}\"" for key in keys + ]) + + class SchemaMissingFileInfo(Exception): def __init__(self, invalid): full_path_keys = [] From bb786b27db619e4107bb339921dcbb2eb3f011fe Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 2 Oct 2020 14:23:12 +0200 Subject: [PATCH 71/95] _fill_inner_schemas now can work with schema templates --- pype/tools/settings/settings/widgets/lib.py | 42 ++++++++++++++++----- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/pype/tools/settings/settings/widgets/lib.py b/pype/tools/settings/settings/widgets/lib.py index a20bf0608f..9624a0df6a 100644 --- a/pype/tools/settings/settings/widgets/lib.py +++ b/pype/tools/settings/settings/widgets/lib.py @@ -190,7 +190,7 @@ def _fill_schema_template(child_data, schema_collection, schema_templates): return output -def _fill_inner_schemas(schema_data, schema_collection): +def _fill_inner_schemas(schema_data, schema_collection, schema_templates): if schema_data["type"] == "schema": raise ValueError("First item in schema data can't be schema.") @@ -200,16 +200,37 @@ def _fill_inner_schemas(schema_data, schema_collection): new_children = [] for child in children: - if child["type"] != "schema": - new_child = _fill_inner_schemas(child, schema_collection) - new_children.append(new_child) + child_type = child["type"] + if child_type == "schema": + schema_name = child["name"] + if schema_name not in schema_collection: + if schema_name in schema_templates: + raise KeyError(( + "Schema template \"{}\" is used as `schema`" + ).format(schema_name)) + raise KeyError( + "Schema \"{}\" was not found".format(schema_name) + ) + + filled_child = _fill_inner_schemas( + schema_collection[schema_name], + schema_collection, + schema_templates + ) + + elif child_type == "schema_template": + for filled_child in _fill_schema_template( + child, schema_collection, schema_templates + ): + new_children.append(filled_child) continue - new_child = _fill_inner_schemas( - schema_collection[child["name"]], - schema_collection - ) - new_children.append(new_child) + else: + filled_child = _fill_inner_schemas( + child, schema_collection, schema_templates + ) + + new_children.append(filled_child) schema_data["children"] = new_children return schema_data @@ -525,7 +546,8 @@ def gui_schema(subfolder, main_schema_name): main_schema = _fill_inner_schemas( loaded_schemas[main_schema_name], - loaded_schemas + loaded_schemas, + loaded_schema_templates ) validate_schema(main_schema) return main_schema From 0c79c09a7e182fe23f325f6d353142ad0ac9af8c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 2 Oct 2020 14:30:41 +0200 Subject: [PATCH 72/95] added possibility of default values in template --- pype/tools/settings/settings/widgets/lib.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pype/tools/settings/settings/widgets/lib.py b/pype/tools/settings/settings/widgets/lib.py index 9624a0df6a..569e7bfbb7 100644 --- a/pype/tools/settings/settings/widgets/lib.py +++ b/pype/tools/settings/settings/widgets/lib.py @@ -108,6 +108,19 @@ def _fill_schema_template_data( required_keys = set() missing_keys = set() + _template = [] + default_values = {} + for item in template: + if isinstance(item, dict) and "__default_values__" in item: + default_values = item["__default_values__"] + else: + _template.append(item) + template = _template + + for key, value in default_values.items(): + if key not in template_data: + template_data[key] = value + if not template: output = template From af9be455d9d1a09c197efab502cc258e1bb0645d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 2 Oct 2020 14:31:02 +0200 Subject: [PATCH 73/95] added default values of templates ability to examples --- .../settings/gui_schemas/system_schema/example_schema.json | 3 ++- .../gui_schemas/system_schema/example_template.json | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/example_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/example_schema.json index ddd4fc7235..09624006f9 100644 --- a/pype/tools/settings/settings/gui_schemas/system_schema/example_schema.json +++ b/pype/tools/settings/settings/gui_schemas/system_schema/example_schema.json @@ -14,7 +14,8 @@ "name": "example_template", "template_data": { "host_label": "Maya 2019", - "host_name": "maya_2019" + "host_name": "maya_2019", + "multiplath_executables": false } }, { "type": "schema_template", diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/example_template.json b/pype/tools/settings/settings/gui_schemas/system_schema/example_template.json index fb629c6170..29d3da26c9 100644 --- a/pype/tools/settings/settings/gui_schemas/system_schema/example_template.json +++ b/pype/tools/settings/settings/gui_schemas/system_schema/example_template.json @@ -1,5 +1,9 @@ [ { + "__default_values__": { + "multiplath_executables": true + } + }, { "type": "raw-json", "label": "{host_label} Environments", "key": "{host_name}_environments", @@ -8,7 +12,7 @@ "type": "path-widget", "key": "{host_name}_executables", "label": "{host_label} - Full paths to executables", - "multiplatform": true, + "multiplatform": "{multiplath_executables}", "multipath": true } ] From d241877895cee6c55a3239b5a6f82e5cdc2b9ce6 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 2 Oct 2020 15:02:46 +0200 Subject: [PATCH 74/95] added schema_template to readme --- pype/tools/settings/settings/README.md | 82 ++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/pype/tools/settings/settings/README.md b/pype/tools/settings/settings/README.md index e8b7fcdb57..974a9c932b 100644 --- a/pype/tools/settings/settings/README.md +++ b/pype/tools/settings/settings/README.md @@ -19,6 +19,7 @@ - GUI schemas are huge json files, to be able to split whole configuration into multiple schema there's type `schema` - system configuration schemas are stored in `~/tools/settings/settings/gui_schemas/system_schema/` and project configurations in `~/tools/settings/settings/gui_schemas/projects_schema/` - each schema name is filename of json file except extension (without ".json") +- if content is dictionary content will be used as `schema` else will be used as `schema_template` ### schema - can have only key `"children"` which is list of strings, each string should represent another schema (order matters) string represebts name of the schema @@ -31,6 +32,87 @@ } ``` +### schema_template +- allows to define schema "templates" to not duplicate same content multiple times +```javascript +// EXAMPLE json file content (filename: example_template.json) +[ + { + "__default_values__": { + "multiplath_executables": true + } + }, { + "type": "raw-json", + "label": "{host_label} Environments", + "key": "{host_name}_environments", + "env_group_key": "{host_name}" + }, { + "type": "path-widget", + "key": "{host_name}_executables", + "label": "{host_label} - Full paths to executables", + "multiplatform": "{multiplath_executables}", + "multipath": true + } +] +``` +```javascript +// EXAMPLE usage of the template in schema +{ + "type": "dict", + "key": "schema_template_examples", + "label": "Schema template examples", + "children": [ + { + "type": "schema_template", + // filename of template (example_template.json) + "name": "example_template", + "template_data": { + "host_label": "Maya 2019", + "host_name": "maya_2019", + "multiplath_executables": false + } + }, { + "type": "schema_template", + "name": "example_template", + "template_data": { + "host_label": "Maya 2020", + "host_name": "maya_2020" + } + } + ] +} +``` +- item in schema mush contain `"type"` and `"name"` keys but it is also expected that `"template_data"` will be entered too +- all items in the list, except `__default_values__`, will replace `schema_template` item in schema +- template may contain another template or schema +- it is expected that schema template will have unfilled fields as in example + - unfilled fields are allowed only in values of schema dictionary +```javascript +{ + ... + // Allowed + "key": "{to_fill}" + ... + // Not allowed + "{to_fill}": "value" + ... +} +``` +- Unfilled fields can be also used for non string values, in that case value must contain only one key and value for fill must contain right type. +```javascript +{ + ... + // Allowed + "multiplatform": "{executable_multiplatform}" + ... + // Not allowed + "multiplatform": "{executable_multiplatform}_enhanced_string" + ... +} +``` +- It is possible to define default values for unfilled fields to do so one of items in list must be dictionary with key `"__default_values__"` and value as dictionary with default key: values (as in example above). + + ## Basic Dictionary inputs - these inputs wraps another inputs into {key: value} relation From 03e8f647fd2799652355ec4532ccc30b030698dd Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 2 Oct 2020 15:03:16 +0200 Subject: [PATCH 75/95] modified example key --- .../settings/gui_schemas/system_schema/example_schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/example_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/example_schema.json index 09624006f9..814fe95d0c 100644 --- a/pype/tools/settings/settings/gui_schemas/system_schema/example_schema.json +++ b/pype/tools/settings/settings/gui_schemas/system_schema/example_schema.json @@ -6,7 +6,7 @@ "children": [ { "type": "dict", - "key": "schema_templates", + "key": "schema_template_exaples", "label": "Schema template examples", "children": [ { From 7364c6c29def5d779266b451069133d28898c7ab Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 2 Oct 2020 15:09:19 +0200 Subject: [PATCH 76/95] fixed typo --- pype/tools/settings/settings/README.md | 6 +++--- .../settings/gui_schemas/system_schema/example_schema.json | 2 +- .../gui_schemas/system_schema/example_template.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pype/tools/settings/settings/README.md b/pype/tools/settings/settings/README.md index 974a9c932b..4f4e9d305a 100644 --- a/pype/tools/settings/settings/README.md +++ b/pype/tools/settings/settings/README.md @@ -39,7 +39,7 @@ [ { "__default_values__": { - "multiplath_executables": true + "multipath_executables": true } }, { "type": "raw-json", @@ -50,7 +50,7 @@ "type": "path-widget", "key": "{host_name}_executables", "label": "{host_label} - Full paths to executables", - "multiplatform": "{multiplath_executables}", + "multiplatform": "{multipath_executables}", "multipath": true } ] @@ -69,7 +69,7 @@ "template_data": { "host_label": "Maya 2019", "host_name": "maya_2019", - "multiplath_executables": false + "multipath_executables": false } }, { "type": "schema_template", diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/example_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/example_schema.json index 814fe95d0c..7612e54116 100644 --- a/pype/tools/settings/settings/gui_schemas/system_schema/example_schema.json +++ b/pype/tools/settings/settings/gui_schemas/system_schema/example_schema.json @@ -15,7 +15,7 @@ "template_data": { "host_label": "Maya 2019", "host_name": "maya_2019", - "multiplath_executables": false + "multipath_executables": false } }, { "type": "schema_template", diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/example_template.json b/pype/tools/settings/settings/gui_schemas/system_schema/example_template.json index 29d3da26c9..48a3c955b9 100644 --- a/pype/tools/settings/settings/gui_schemas/system_schema/example_template.json +++ b/pype/tools/settings/settings/gui_schemas/system_schema/example_template.json @@ -1,7 +1,7 @@ [ { "__default_values__": { - "multiplath_executables": true + "multipath_executables": true } }, { "type": "raw-json", @@ -12,7 +12,7 @@ "type": "path-widget", "key": "{host_name}_executables", "label": "{host_label} - Full paths to executables", - "multiplatform": "{multiplath_executables}", + "multiplatform": "{multipath_executables}", "multipath": true } ] From 1b07985680dded6cc8adbc0c44ef21457e72b3e8 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 2 Oct 2020 16:07:01 +0200 Subject: [PATCH 77/95] moved back what was removed during merge --- pype/tools/settings/settings/widgets/item_types.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 375dde566e..822cd93d9b 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -1242,6 +1242,7 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): class RawJsonWidget(QtWidgets.QWidget, InputObject): default_input_value = "{}" value_changed = QtCore.Signal(object) + valid_value_types = (str, dict, list, type(NOT_SET)) allow_to_environment = True def __init__( From 805964c5e5b37f6c2aedd04cbcac35b8672d9b16 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 2 Oct 2020 16:17:22 +0200 Subject: [PATCH 78/95] enhanced type check --- pype/tools/settings/settings/widgets/item_types.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 822cd93d9b..ebce465163 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -57,7 +57,7 @@ class SettingObject: return for valid_type in self.valid_value_types: - if isinstance(value, valid_type): + if type(value) is valid_type: return key = getattr(self, "key", None) @@ -281,7 +281,7 @@ class SettingObject: def is_modified(self): """Has object any changes that require saving.""" if self.any_parent_as_widget: - return self._is_modified + return self._is_modified or self.defaults_not_set if self._is_modified or self.defaults_not_set: return True From b94ca1f2d26217f4212d04507a1ef259bd3a9a6d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 2 Oct 2020 16:18:28 +0200 Subject: [PATCH 79/95] TextWidget can have only string --- pype/tools/settings/settings/widgets/item_types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index ebce465163..535e96a665 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -983,7 +983,7 @@ class NumberWidget(QtWidgets.QWidget, InputObject): class TextWidget(QtWidgets.QWidget, InputObject): default_input_value = "" value_changed = QtCore.Signal(object) - valid_value_types = (int, str) + valid_value_types = (str, ) def __init__( self, input_data, parent, From 3f088b8bebb34a85cf044a06ca883a175a7221cd Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Fri, 2 Oct 2020 17:03:38 +0200 Subject: [PATCH 80/95] add hosts schemas to settings --- .../system_settings/global/applications.json | 703 ++++++++++++++---- .../system_schema/0_system_gui_schema.json | 3 - .../1_applications_gui_schema.json | 54 +- .../system_schema/1_hosts_gui_schema.json | 139 ---- .../host_settings/system_blender_schema.json | 35 + .../system_celaction_schema.json | 39 + .../host_settings/system_fusion_schema.json | 35 + .../host_settings/system_harmony_schema.json | 51 ++ .../host_settings/system_host_template.json | 33 + .../host_settings/system_houdini_schema.json | 35 + .../host_settings/system_maya_schema.json | 43 ++ .../host_settings/system_nuke_template.json | 65 ++ .../system_photoshop_schema.json | 27 + .../host_settings/system_resolve_schema.json | 27 + .../host_settings/system_shell_schema.json | 43 ++ .../host_settings/system_unreal_schema.json | 27 + .../system_schema/system_harmony_schema.json | 86 --- .../system_schema/system_hiero_schema.json | 128 ---- .../system_schema/system_host_exe_schema.json | 39 - .../system_schema/system_houdini_schema.json | 52 -- .../system_schema/system_maya_schema.json | 69 -- .../system_schema/system_nuke_schema.json | 128 ---- .../system_photoshop_schema.json | 35 - 23 files changed, 1054 insertions(+), 842 deletions(-) delete mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/1_hosts_gui_schema.json create mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_blender_schema.json create mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_celaction_schema.json create mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_fusion_schema.json create mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_harmony_schema.json create mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_host_template.json create mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_houdini_schema.json create mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_maya_schema.json create mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_nuke_template.json create mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_photoshop_schema.json create mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_resolve_schema.json create mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_shell_schema.json create mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_unreal_schema.json delete mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/system_harmony_schema.json delete mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/system_hiero_schema.json delete mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/system_host_exe_schema.json delete mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/system_houdini_schema.json delete mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/system_maya_schema.json delete mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/system_nuke_schema.json delete mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/system_photoshop_schema.json diff --git a/pype/settings/defaults/system_settings/global/applications.json b/pype/settings/defaults/system_settings/global/applications.json index 2cf64e396b..222d9e1173 100644 --- a/pype/settings/defaults/system_settings/global/applications.json +++ b/pype/settings/defaults/system_settings/global/applications.json @@ -1,255 +1,638 @@ { "maya": { "enabled": true, - "environment": {}, + "environment": { + "__environment_keys__": { + "maya": [] + } + }, "maya_2020": { "enabled": true, - "common": { - "executable": { - "windows": [], - "linux": [], - "mac": [] - }, - "environment": {} + "maya_executables": { + "windows": "", + "darwin": "", + "linux": "" + }, + "environment": { + "__environment_keys__": { + "maya_2020": [] + } } }, "maya_2019": { "enabled": true, - "common": { - "executable": { - "windows": [], - "linux": [], - "mac": [] - }, - "environment": {} + "maya_executables": { + "windows": "", + "darwin": "", + "linux": "" + }, + "environment": { + "__environment_keys__": { + "maya_2019": [] + } } }, "maya_2018": { "enabled": true, - "common": { - "executable": { - "windows": [], - "linux": [], - "mac": [] - }, - "environment": {} + "maya_executables": { + "windows": "", + "darwin": "", + "linux": "" + }, + "environment": { + "__environment_keys__": { + "maya_2018": [] + } } } }, "nuke": { "enabled": true, - "environment": {}, - "nuke_12.1": { + "environment": { + "__environment_keys__": { + "nuke": [] + } + }, + "nuke_12.0": { "enabled": true, - "nukeX": true, - "common": { - "executable": { - "windows": [], - "linux": [], - "mac": [] - }, - "environment": {} + "nuke_executables": { + "windows": [], + "darwin": [], + "linux": [] + }, + "environment": { + "__environment_keys__": { + "nuke_12.0": [] + } } }, "nuke_11.3": { "enabled": true, - "nukeX": true, - "common": { - "executable": { - "windows": [], - "linux": [], - "mac": [] - }, - "environment": {} + "nuke_executables": { + "windows": [], + "darwin": [], + "linux": [] + }, + "environment": { + "__environment_keys__": { + "nuke_11.3": [] + } } }, "nuke_11.2": { "enabled": true, - "nukeX": true, - "common": { - "executable": { - "windows": [], - "linux": [], - "mac": [] - }, - "environment": {} + "nuke_executables": { + "windows": [], + "darwin": [], + "linux": [] + }, + "environment": { + "__environment_keys__": { + "nuke_11.2": [] + } } }, "nuke_11.1": { "enabled": true, - "nukeX": true, - "common": { - "executable": { - "windows": [], - "linux": [], - "mac": [] - }, - "environment": {} + "nuke_executables": { + "windows": [], + "darwin": [], + "linux": [] + }, + "environment": { + "__environment_keys__": { + "nuke_11.1": [] + } } }, - "nuke_10": { + "nuke_10.0": { "enabled": true, - "nukeX": true, - "common": { - "executable": { - "windows": [], - "linux": [], - "mac": [] - }, - "environment": {} + "nuke_executables": { + "windows": [], + "darwin": [], + "linux": [] + }, + "environment": { + "__environment_keys__": { + "nuke_10.0": [] + } + } + } + }, + "nukex": { + "enabled": true, + "environment": { + "__environment_keys__": { + "nukex": [] + } + }, + "nukex_12.0": { + "enabled": true, + "nukex_executables": { + "windows": [], + "darwin": [], + "linux": [] + }, + "environment": { + "__environment_keys__": { + "nukex_12.0": [] + } + } + }, + "nukex_11.3": { + "enabled": true, + "nukex_executables": { + "windows": [], + "darwin": [], + "linux": [] + }, + "environment": { + "__environment_keys__": { + "nukex_11.3": [] + } + } + }, + "nukex_11.2": { + "enabled": true, + "nukex_executables": { + "windows": [], + "darwin": [], + "linux": [] + }, + "environment": { + "__environment_keys__": { + "nukex_11.2": [] + } + } + }, + "nukex_11.1": { + "enabled": true, + "nukex_executables": { + "windows": [], + "darwin": [], + "linux": [] + }, + "environment": { + "__environment_keys__": { + "nukex_11.1": [] + } + } + }, + "nukex_10.0": { + "enabled": true, + "nukex_executables": { + "windows": [], + "darwin": [], + "linux": [] + }, + "environment": { + "__environment_keys__": { + "nukex_10.0": [] + } + } + } + }, + "nukestudio": { + "enabled": true, + "environment": { + "__environment_keys__": { + "nukestudio": [] + } + }, + "nukestudio_12.0": { + "enabled": true, + "nukestudio_executables": { + "windows": [], + "darwin": [], + "linux": [] + }, + "environment": { + "__environment_keys__": { + "nukestudio_12.0": [] + } + } + }, + "nukestudio_11.3": { + "enabled": true, + "nukestudio_executables": { + "windows": [], + "darwin": [], + "linux": [] + }, + "environment": { + "__environment_keys__": { + "nukestudio_11.3": [] + } + } + }, + "nukestudio_11.2": { + "enabled": true, + "nukestudio_executables": { + "windows": [], + "darwin": [], + "linux": [] + }, + "environment": { + "__environment_keys__": { + "nukestudio_11.2": [] + } + } + }, + "nukestudio_11.1": { + "enabled": true, + "nukestudio_executables": { + "windows": [], + "darwin": [], + "linux": [] + }, + "environment": { + "__environment_keys__": { + "nukestudio_11.1": [] + } + } + }, + "nukestudio_10.0": { + "enabled": true, + "nukestudio_executables": { + "windows": [], + "darwin": [], + "linux": [] + }, + "environment": { + "__environment_keys__": { + "nukestudio_10.0": [] + } } } }, "hiero": { "enabled": true, - "environment": {}, - "hiero_12.1": { + "environment": { + "__environment_keys__": { + "hiero": [] + } + }, + "hiero_12.0": { "enabled": true, - "nukestudio": true, - "common": { - "executable": { - "windows": [], - "linux": [], - "mac": [] - }, - "environment": {} + "hiero_executables": { + "windows": [], + "darwin": [], + "linux": [] + }, + "environment": { + "__environment_keys__": { + "hiero_12.0": [] + } } }, "hiero_11.3": { "enabled": true, - "nukestudio": true, - "common": { - "executable": { - "windows": [], - "linux": [], - "mac": [] - }, - "environment": {} + "hiero_executables": { + "windows": [], + "darwin": [], + "linux": [] + }, + "environment": { + "__environment_keys__": { + "hiero_11.3": [] + } } }, "hiero_11.2": { "enabled": true, - "nukestudio": true, - "common": { - "executable": { - "windows": [], - "linux": [], - "mac": [] - }, - "environment": {} + "hiero_executables": { + "windows": [], + "darwin": [], + "linux": [] + }, + "environment": { + "__environment_keys__": { + "hiero_11.2": [] + } } }, "hiero_11.1": { "enabled": true, - "nukestudio": true, - "common": { - "executable": { - "windows": [], - "linux": [], - "mac": [] - }, - "environment": {} + "hiero_executables": { + "windows": [], + "darwin": [], + "linux": [] + }, + "environment": { + "__environment_keys__": { + "hiero_11.1": [] + } } }, - "hiero_10": { + "hiero_10.0": { "enabled": true, - "nukestudio": true, - "common": { - "executable": { - "windows": [], - "linux": [], - "mac": [] - }, - "environment": {} + "hiero_executables": { + "windows": [], + "darwin": [], + "linux": [] + }, + "environment": { + "__environment_keys__": { + "hiero_10.0": [] + } + } + } + }, + "fusion": { + "enabled": true, + "environment": { + "__environment_keys__": { + "fusion": [] + } + }, + "fusion_16": { + "enabled": true, + "fusion_executables": { + "windows": "", + "darwin": "", + "linux": "" + }, + "environment": { + "__environment_keys__": { + "fusion_16": [] + } + } + }, + "fusion_9": { + "enabled": true, + "fusion_executables": { + "windows": "", + "darwin": "", + "linux": "" + }, + "environment": { + "__environment_keys__": { + "fusion_9": [] + } + } + } + }, + "resolve": { + "enabled": true, + "environment": { + "__environment_keys__": { + "resolve": [] + } + }, + "resolve_16": { + "enabled": true, + "resolve_executables": { + "windows": "", + "darwin": "", + "linux": "" + }, + "environment": { + "__environment_keys__": { + "resolve_16": [] + } } } }, "houdini": { "enabled": true, - "environment": {}, + "environment": { + "__environment_keys__": { + "houdini": [] + } + }, "houdini_18": { "enabled": true, - "common": { - "executable": { - "windows": [], - "linux": [], - "mac": [] - }, - "environment": {} + "houdini_executables": { + "windows": "", + "darwin": "", + "linux": "" + }, + "environment": { + "__environment_keys__": { + "houdini_18": [] + } } }, "houdini_17": { "enabled": true, - "common": { - "executable": { - "windows": [], - "linux": [], - "mac": [] - }, - "environment": {} + "houdini_executables": { + "windows": "", + "darwin": "", + "linux": "" + }, + "environment": { + "__environment_keys__": { + "houdini_17": [] + } + } + } + }, + "blender": { + "enabled": true, + "environment": { + "__environment_keys__": { + "blender": [] + } + }, + "blender_2.90": { + "enabled": true, + "blender_executables": { + "windows": "", + "darwin": "", + "linux": "" + }, + "environment": { + "__environment_keys__": { + "blender_2.90": [] + } + } + }, + "blender_2.83": { + "enabled": true, + "blender_executables": { + "windows": "", + "darwin": "", + "linux": "" + }, + "environment": { + "__environment_keys__": { + "blender_2.83": [] + } } } }, "harmony": { "enabled": true, - "environment_maya": {}, + "environment": { + "__environment_keys__": { + "harmony": [] + } + }, "harmony_20": { "enabled": true, - "common": { - "executable": { - "windows": [], - "linux": [], - "mac": [] - }, - "environment": {} + "harmony_executables": { + "windows": "", + "darwin": "", + "linux": "" + }, + "environment": { + "__environment_keys__": { + "harmony_20": [] + } } }, "harmony_19": { "enabled": true, - "common": { - "executable": { - "windows": [], - "linux": [], - "mac": [] - }, - "environment": {} + "harmony_executables": { + "windows": "", + "darwin": "", + "linux": "" + }, + "environment": { + "__environment_keys__": { + "harmony_19": [] + } } }, "harmony_18": { "enabled": true, - "common": { - "executable": { - "windows": [], - "linux": [], - "mac": [] - }, - "environment": {} + "harmony_executables": { + "windows": "", + "darwin": "", + "linux": "" + }, + "environment": { + "__environment_keys__": { + "harmony_18": [] + } } }, "harmony_17": { "enabled": true, - "common": { - "executable": { - "windows": [], - "linux": [], - "mac": [] - }, - "environment": {} + "harmony_executables": { + "windows": "", + "darwin": "", + "linux": "" + }, + "environment": { + "__environment_keys__": { + "harmony_17": [] + } } } }, "photoshop": { "enabled": true, - "environment": {}, + "environment": { + "__environment_keys__": { + "photoshop": [] + } + }, "photoshop_2020": { "enabled": true, - "common": { - "executable": { - "windows": [], - "linux": [], - "mac": [] - }, - "environment": {} + "photoshop_executables": { + "windows": "", + "darwin": "", + "linux": "" + }, + "environment": { + "__environment_keys__": { + "photoshop_2020": [] + } + } + } + }, + "celaction": { + "enabled": true, + "environment": { + "__environment_keys__": { + "celaction": [] + } + }, + "celation_Local": { + "enabled": true, + "celation_executables": "", + "environment": { + "__environment_keys__": { + "celation_Local": [] + } + } + }, + "celation_Publish": { + "enabled": true, + "celation_executables": "", + "environment": { + "__environment_keys__": { + "celation_Publish": [] + } + } + } + }, + "unreal": { + "enabled": true, + "environment": { + "__environment_keys__": { + "unreal": [] + } + }, + "unreal_4.24": { + "enabled": true, + "unreal_executables": { + "windows": "", + "darwin": "", + "linux": "" + }, + "environment": { + "__environment_keys__": { + "unreal_4.24": [] + } + } + } + }, + "shell": { + "enabled": true, + "environment": { + "__environment_keys__": { + "shell": [] + } + }, + "python_Python 3.7": { + "enabled": true, + "python_executables": { + "windows": "", + "darwin": "", + "linux": "" + }, + "environment": { + "__environment_keys__": { + "python_Python 3.7": [] + } + } + }, + "python_Python 2.7": { + "enabled": true, + "python_executables": { + "windows": "", + "darwin": "", + "linux": "" + }, + "environment": { + "__environment_keys__": { + "python_Python 2.7": [] + } + } + }, + "terminal_Terminal": { + "enabled": true, + "terminal_executables": { + "windows": "", + "darwin": "", + "linux": "" + }, + "environment": { + "__environment_keys__": { + "terminal_Terminal": [] + } } } } diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/0_system_gui_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/0_system_gui_schema.json index dbae81501e..c5f229fc2f 100644 --- a/pype/tools/settings/settings/gui_schemas/system_schema/0_system_gui_schema.json +++ b/pype/tools/settings/settings/gui_schemas/system_schema/0_system_gui_schema.json @@ -14,9 +14,6 @@ }, { "type": "schema", "name": "1_applications_gui_schema" - }, { - "type": "schema", - "name": "1_hosts_gui_schema" }, { "type": "schema", "name": "1_tools_gui_schema" diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/1_applications_gui_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/1_applications_gui_schema.json index 95e2763f35..d1fa4e79f5 100644 --- a/pype/tools/settings/settings/gui_schemas/system_schema/1_applications_gui_schema.json +++ b/pype/tools/settings/settings/gui_schemas/system_schema/1_applications_gui_schema.json @@ -9,17 +9,53 @@ "name": "system_maya_schema" }, { - "type": "schema", - "name": "system_nuke_schema" + "type": "schema_template", + "name": "system_nuke_template", + "template_data": { + "nuke_type": "nuke", + "nuke_label": "Nuke" + } + }, + { + "type": "schema_template", + "name": "system_nuke_template", + "template_data": { + "nuke_type": "nukex", + "nuke_label": "Nuke X" + } + }, + { + "type": "schema_template", + "name": "system_nuke_template", + "template_data": { + "nuke_type": "nukestudio", + "nuke_label": "Nuke Studio" + } + }, + { + "type": "schema_template", + "name": "system_nuke_template", + "template_data": { + "nuke_type": "hiero", + "nuke_label": "Hiero" + } }, { "type": "schema", - "name": "system_hiero_schema" + "name": "system_fusion_schema" + }, + { + "type": "schema", + "name": "system_resolve_schema" }, { "type": "schema", "name": "system_houdini_schema" }, + { + "type": "schema", + "name": "system_blender_schema" + }, { "type": "schema", "name": "system_harmony_schema" @@ -27,6 +63,18 @@ { "type": "schema", "name": "system_photoshop_schema" + }, + { + "type": "schema", + "name": "system_celaction_schema" + }, + { + "type": "schema", + "name": "system_unreal_schema" + }, + { + "type": "schema", + "name": "system_shell_schema" } ] } diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/1_hosts_gui_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/1_hosts_gui_schema.json deleted file mode 100644 index 277b9d1d8e..0000000000 --- a/pype/tools/settings/settings/gui_schemas/system_schema/1_hosts_gui_schema.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "key": "hosts", - "type": "dict", - "label": "Hosts", - "collapsable": true, - "is_group": true, - "is_file": true, - "children": [ - { - "type": "boolean", - "key": "blender_2.80", - "label": "Blender 2.80" - }, { - "type": "boolean", - "key": "blender_2.81", - "label": "Blender 2.81" - }, { - "type": "boolean", - "key": "blender_2.82", - "label": "Blender 2.82" - }, { - "type": "boolean", - "key": "blender_2.83", - "label": "Blender 2.83" - }, { - "type": "boolean", - "key": "celaction_local", - "label": "Celaction Local" - }, { - "type": "boolean", - "key": "celaction_remote", - "label": "Celaction Remote" - }, { - "type": "boolean", - "key": "harmony_17", - "label": "Harmony 17" - }, { - "type": "boolean", - "key": "maya_2017", - "label": "Autodest Maya 2017" - }, { - "type": "boolean", - "key": "maya_2018", - "label": "Autodest Maya 2018" - }, { - "type": "boolean", - "key": "maya_2019", - "label": "Autodest Maya 2019" - }, { - "type": "boolean", - "key": "maya_2020", - "label": "Autodest Maya 2020" - }, { - "key": "nuke_10.0", - "type": "boolean", - "label": "Nuke 10.0" - }, { - "type": "boolean", - "key": "nuke_11.2", - "label": "Nuke 11.2" - }, { - "type": "boolean", - "key": "nuke_11.3", - "label": "Nuke 11.3" - }, { - "type": "boolean", - "key": "nuke_12.0", - "label": "Nuke 12.0" - }, { - "type": "boolean", - "key": "nukex_10.0", - "label": "NukeX 10.0" - }, { - "type": "boolean", - "key": "nukex_11.2", - "label": "NukeX 11.2" - }, { - "type": "boolean", - "key": "nukex_11.3", - "label": "NukeX 11.3" - }, { - "type": "boolean", - "key": "nukex_12.0", - "label": "NukeX 12.0" - }, { - "type": "boolean", - "key": "nukestudio_10.0", - "label": "NukeStudio 10.0" - }, { - "type": "boolean", - "key": "nukestudio_11.2", - "label": "NukeStudio 11.2" - }, { - "type": "boolean", - "key": "nukestudio_11.3", - "label": "NukeStudio 11.3" - }, { - "type": "boolean", - "key": "nukestudio_12.0", - "label": "NukeStudio 12.0" - }, { - "type": "boolean", - "key": "houdini_16", - "label": "Houdini 16" - }, { - "type": "boolean", - "key": "houdini_16.5", - "label": "Houdini 16.5" - }, { - "type": "boolean", - "key": "houdini_17", - "label": "Houdini 17" - }, { - "type": "boolean", - "key": "houdini_18", - "label": "Houdini 18" - }, { - "type": "boolean", - "key": "premiere_2019", - "label": "Premiere 2019" - }, { - "type": "boolean", - "key": "premiere_2020", - "label": "Premiere 2020" - }, { - "type": "boolean", - "key": "resolve_16", - "label": "BM DaVinci Resolve 16" - }, { - "type": "boolean", - "key": "storyboardpro_7", - "label": "Storyboard Pro 7" - }, { - "type": "boolean", - "key": "unreal_4.24", - "label": "Unreal Editor 4.24" - } - ] -} diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_blender_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_blender_schema.json new file mode 100644 index 0000000000..8600d8de8a --- /dev/null +++ b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_blender_schema.json @@ -0,0 +1,35 @@ +{ + "type": "dict", + "key": "blender", + "label": "Blender", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "key": "environment", + "label": "Environment", + "type": "raw-json", + "env_group_key": "blender" + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "2.90", + "host_name": "blender" + } + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "2.83", + "host_name": "blender" + } + } + ] +} diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_celaction_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_celaction_schema.json new file mode 100644 index 0000000000..36addab00d --- /dev/null +++ b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_celaction_schema.json @@ -0,0 +1,39 @@ +{ + "type": "dict", + "key": "celaction", + "label": "CelAction2D", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "key": "environment", + "label": "Environment", + "type": "raw-json", + "env_group_key": "celaction" + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "Local", + "host_name": "celation", + "multiplatform": false, + "multipath_executables": false + } + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "Publish", + "host_name": "celation", + "multiplatform": false, + "multipath_executables": false + } + } + ] +} diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_fusion_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_fusion_schema.json new file mode 100644 index 0000000000..b3dc79ef97 --- /dev/null +++ b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_fusion_schema.json @@ -0,0 +1,35 @@ +{ + "type": "dict", + "key": "fusion", + "label": "Blackmagic Fusion", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "key": "environment", + "label": "Environment", + "type": "raw-json", + "env_group_key": "fusion" + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "16", + "host_name": "fusion" + } + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "9", + "host_name": "fusion" + } + } + ] +} diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_harmony_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_harmony_schema.json new file mode 100644 index 0000000000..10cb929fc4 --- /dev/null +++ b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_harmony_schema.json @@ -0,0 +1,51 @@ +{ + "type": "dict", + "key": "harmony", + "label": "Toon Boom Harmony", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "key": "environment", + "label": "Environment", + "type": "raw-json", + "env_group_key": "harmony" + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "20", + "host_name": "harmony" + } + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "19", + "host_name": "harmony" + } + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "18", + "host_name": "harmony" + } + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "17", + "host_name": "harmony" + } + } + ] +} diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_host_template.json b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_host_template.json new file mode 100644 index 0000000000..dd4d3c8b4b --- /dev/null +++ b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_host_template.json @@ -0,0 +1,33 @@ +[{ + "__default_values__": { + "multipath_executables": false, + "multiplatform": true + } + }, + { + "type": "dict", + "key": "{host_name}_{host_version}", + "label": "{host_version}", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "path-widget", + "key": "{host_name}_executables", + "label": "Executables", + "multiplatform": "{multiplatform}", + "multipath": "{multipath_executables}" + }, + { + "key": "environment", + "label": "Environment", + "type": "raw-json", + "env_group_key": "{host_name}_{host_version}" + } + ] + } +] diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_houdini_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_houdini_schema.json new file mode 100644 index 0000000000..36c6d9fcb2 --- /dev/null +++ b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_houdini_schema.json @@ -0,0 +1,35 @@ +{ + "type": "dict", + "key": "houdini", + "label": "SideFX Houdini", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "key": "environment", + "label": "Environment", + "type": "raw-json", + "env_group_key": "houdini" + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "18", + "host_name": "houdini" + } + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "17", + "host_name": "houdini" + } + } + ] +} diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_maya_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_maya_schema.json new file mode 100644 index 0000000000..710b62a9cc --- /dev/null +++ b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_maya_schema.json @@ -0,0 +1,43 @@ +{ + "type": "dict", + "key": "maya", + "label": "Autodesk Maya", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "key": "environment", + "label": "Environment", + "type": "raw-json", + "env_group_key": "maya" + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "2020", + "host_name": "maya" + } + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "2019", + "host_name": "maya" + } + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "2018", + "host_name": "maya" + } + } + ] +} diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_nuke_template.json b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_nuke_template.json new file mode 100644 index 0000000000..36d68dba95 --- /dev/null +++ b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_nuke_template.json @@ -0,0 +1,65 @@ +[{ + "type": "dict", + "key": "{nuke_type}", + "label": "Foundry {nuke_label}", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "key": "environment", + "label": "Environment", + "type": "raw-json", + "env_group_key": "{nuke_type}" + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "12.0", + "host_name": "{nuke_type}", + "multipath_executables": true + } + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "11.3", + "host_name": "{nuke_type}", + "multipath_executables": true + } + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "11.2", + "host_name": "{nuke_type}", + "multipath_executables": true + } + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "11.1", + "host_name": "{nuke_type}", + "multipath_executables": true + } + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "10.0", + "host_name": "{nuke_type}", + "multipath_executables": true + } + } + ] +} +] diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_photoshop_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_photoshop_schema.json new file mode 100644 index 0000000000..c1062045e7 --- /dev/null +++ b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_photoshop_schema.json @@ -0,0 +1,27 @@ +{ + "type": "dict", + "key": "photoshop", + "label": "Adobe Photoshop", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "key": "environment", + "label": "Environment", + "type": "raw-json", + "env_group_key": "photoshop" + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "2020", + "host_name": "photoshop" + } + } + ] +} diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_resolve_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_resolve_schema.json new file mode 100644 index 0000000000..364be8208d --- /dev/null +++ b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_resolve_schema.json @@ -0,0 +1,27 @@ +{ + "type": "dict", + "key": "resolve", + "label": "Blackmagic DaVinci Resolve", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "key": "environment", + "label": "Environment", + "type": "raw-json", + "env_group_key": "resolve" + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "16", + "host_name": "resolve" + } + } + ] +} diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_shell_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_shell_schema.json new file mode 100644 index 0000000000..22955abc46 --- /dev/null +++ b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_shell_schema.json @@ -0,0 +1,43 @@ +{ + "type": "dict", + "key": "shell", + "label": "Shell", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "key": "environment", + "label": "Environment", + "type": "raw-json", + "env_group_key": "shell" + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "Python 3.7", + "host_name": "python" + } + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "Python 2.7", + "host_name": "python" + } + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "Terminal", + "host_name": "terminal" + } + } + ] +} diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_unreal_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_unreal_schema.json new file mode 100644 index 0000000000..e0408f9a36 --- /dev/null +++ b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_unreal_schema.json @@ -0,0 +1,27 @@ +{ + "type": "dict", + "key": "unreal", + "label": "Unreal Editor", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "key": "environment", + "label": "Environment", + "type": "raw-json", + "env_group_key": "unreal" + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "4.24", + "host_name": "unreal" + } + } + ] +} diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/system_harmony_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/system_harmony_schema.json deleted file mode 100644 index 4ef97bc8a2..0000000000 --- a/pype/tools/settings/settings/gui_schemas/system_schema/system_harmony_schema.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "type": "dict", - "key": "harmony", - "label": "Toon Boom Harmony", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "raw-json", - "key": "environment_maya", - "label": "Environment" - }, - { - "type": "dict", - "key": "harmony_20", - "label": "20", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "schema", - "name": "system_host_exe_schema" - } - ] - }, - { - "type": "dict", - "key": "harmony_19", - "label": "19", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "schema", - "name": "system_host_exe_schema" - } - ] - }, - { - "type": "dict", - "key": "harmony_18", - "label": "18", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "schema", - "name": "system_host_exe_schema" - } - ] - }, - { - "type": "dict", - "key": "harmony_17", - "label": "17", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "schema", - "name": "system_host_exe_schema" - } - ] - } - ] -} diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/system_hiero_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/system_hiero_schema.json deleted file mode 100644 index ecbb98b281..0000000000 --- a/pype/tools/settings/settings/gui_schemas/system_schema/system_hiero_schema.json +++ /dev/null @@ -1,128 +0,0 @@ -{ - "type": "dict", - "key": "hiero", - "label": "Foundry Hiero / Nuke Studio", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "raw-json", - "key": "environment", - "label": "Environment" - }, - { - "type": "dict", - "key": "hiero_12.1", - "label": "12.1", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "boolean", - "key": "nukestudio", - "label": "Nuke Studio" - }, - { - "type": "schema", - "name": "system_host_exe_schema" - } - ] - }, - { - "type": "dict", - "key": "hiero_11.3", - "label": "11.3", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "boolean", - "key": "nukestudio", - "label": "Nuke Studio" - }, - { - "type": "schema", - "name": "system_host_exe_schema" - } - ] - }, - { - "type": "dict", - "key": "hiero_11.2", - "label": "11.2", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "boolean", - "key": "nukestudio", - "label": "Nuke Studio" - }, - { - "type": "schema", - "name": "system_host_exe_schema" - } - ] - }, - { - "type": "dict", - "key": "hiero_11.1", - "label": "11.1", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "boolean", - "key": "nukestudio", - "label": "Nuke Studio" - }, - { - "type": "schema", - "name": "system_host_exe_schema" - } - ] - }, - { - "type": "dict", - "key": "hiero_10", - "label": "10", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "boolean", - "key": "nukestudio", - "label": "Nuke Studio" - }, - { - "type": "schema", - "name": "system_host_exe_schema" - } - ] - } - ] -} diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/system_host_exe_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/system_host_exe_schema.json deleted file mode 100644 index 7bf40ba69e..0000000000 --- a/pype/tools/settings/settings/gui_schemas/system_schema/system_host_exe_schema.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "type": "dict-invisible", - "key": "common", - "children": [{ - "type": "dict-invisible", - "key": "executable", - "children": [{ - "type": "list", - "key": "windows", - "label": "Windows Executable", - "object_type": { - "type": "text", - "multiline": false - } - }, { - "type": "list", - "key": "linux", - "label": "Linux Executable", - "object_type": { - "type": "text", - "multiline": false - } - }, { - "type": "list", - "key": "mac", - "label": "Mac Executable", - "object_type": { - "type": "text", - "multiline": false - } - }] - }, - { - "type": "raw-json", - "key": "environment", - "label": "Environment" - } - ] -} diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/system_houdini_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/system_houdini_schema.json deleted file mode 100644 index a6f58da172..0000000000 --- a/pype/tools/settings/settings/gui_schemas/system_schema/system_houdini_schema.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "type": "dict", - "key": "houdini", - "label": "SideFX Houdini", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "raw-json", - "key": "environment", - "label": "Environment" - }, - { - "type": "dict", - "key": "houdini_18", - "label": "18", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "schema", - "name": "system_host_exe_schema" - } - ] - }, - { - "type": "dict", - "key": "houdini_17", - "label": "17", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "schema", - "name": "system_host_exe_schema" - } - ] - } - ] -} diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/system_maya_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/system_maya_schema.json deleted file mode 100644 index 5c76f65792..0000000000 --- a/pype/tools/settings/settings/gui_schemas/system_schema/system_maya_schema.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "type": "dict", - "key": "maya", - "label": "Autodesk Maya", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "raw-json", - "key": "environment", - "label": "Environment" - }, - { - "type": "dict", - "key": "maya_2020", - "label": "2020", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "schema", - "name": "system_host_exe_schema" - } - ] - }, - { - "type": "dict", - "key": "maya_2019", - "label": "2019", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "schema", - "name": "system_host_exe_schema" - } - ] - }, - { - "type": "dict", - "key": "maya_2018", - "label": "2018", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "schema", - "name": "system_host_exe_schema" - } - ] - } - ] -} diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/system_nuke_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/system_nuke_schema.json deleted file mode 100644 index 205a4bb11a..0000000000 --- a/pype/tools/settings/settings/gui_schemas/system_schema/system_nuke_schema.json +++ /dev/null @@ -1,128 +0,0 @@ -{ - "type": "dict", - "key": "nuke", - "label": "Foundry Nuke", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "raw-json", - "key": "environment", - "label": "Environment" - }, - { - "type": "dict", - "key": "nuke_12.1", - "label": "12.1", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "boolean", - "key": "nukeX", - "label": "Nuke X" - }, - { - "type": "schema", - "name": "system_host_exe_schema" - } - ] - }, - { - "type": "dict", - "key": "nuke_11.3", - "label": "11.3", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "boolean", - "key": "nukeX", - "label": "Nuke X" - }, - { - "type": "schema", - "name": "system_host_exe_schema" - } - ] - }, - { - "type": "dict", - "key": "nuke_11.2", - "label": "11.2", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "boolean", - "key": "nukeX", - "label": "Nuke X" - }, - { - "type": "schema", - "name": "system_host_exe_schema" - } - ] - }, - { - "type": "dict", - "key": "nuke_11.1", - "label": "11.1", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "boolean", - "key": "nukeX", - "label": "Nuke X" - }, - { - "type": "schema", - "name": "system_host_exe_schema" - } - ] - }, - { - "type": "dict", - "key": "nuke_10", - "label": "10", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "boolean", - "key": "nukeX", - "label": "Nuke X" - }, - { - "type": "schema", - "name": "system_host_exe_schema" - } - ] - } - ] -} diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/system_photoshop_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/system_photoshop_schema.json deleted file mode 100644 index d04bcbed09..0000000000 --- a/pype/tools/settings/settings/gui_schemas/system_schema/system_photoshop_schema.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "type": "dict", - "key": "photoshop", - "label": "Adobe Photoshop", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "raw-json", - "key": "environment", - "label": "Environment" - }, - { - "type": "dict", - "key": "photoshop_2020", - "label": "2020", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "schema", - "name": "system_host_exe_schema" - } - ] - } - ] -} From e64f7ad7d6945ec6a5da7faf78e990bf5006ad63 Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Fri, 2 Oct 2020 17:31:39 +0200 Subject: [PATCH 81/95] add default environments --- .../system_settings/global/applications.json | 282 ++++++++++++++++-- 1 file changed, 252 insertions(+), 30 deletions(-) diff --git a/pype/settings/defaults/system_settings/global/applications.json b/pype/settings/defaults/system_settings/global/applications.json index 222d9e1173..92d7ab0b2f 100644 --- a/pype/settings/defaults/system_settings/global/applications.json +++ b/pype/settings/defaults/system_settings/global/applications.json @@ -3,8 +3,28 @@ "enabled": true, "environment": { "__environment_keys__": { - "maya": [] - } + "maya": [ + "PYTHONPATH", + "MAYA_DISABLE_CLIC_IPM", + "MAYA_DISABLE_CIP", + "MAYA_DISABLE_CER", + "PYMEL_SKIP_MEL_INIT", + "LC_ALL", + "PYPE_LOG_NO_COLORS" + ] + }, + "PYTHONPATH": [ + "{PYPE_SETUP_PATH}/repos/avalon-core/setup/maya", + "{PYPE_SETUP_PATH}/repos/maya-look-assigner", + "{PYTHON_ENV}/python2/Lib/site-packages", + "{PYTHONPATH}" + ], + "MAYA_DISABLE_CLIC_IPM": "Yes", + "MAYA_DISABLE_CIP": "Yes", + "MAYA_DISABLE_CER": "Yes", + "PYMEL_SKIP_MEL_INIT": "Yes", + "LC_ALL": "C", + "PYPE_LOG_NO_COLORS": "Yes" }, "maya_2020": { "enabled": true, @@ -15,7 +35,20 @@ }, "environment": { "__environment_keys__": { - "maya_2020": [] + "maya_2020": [ + "MAYA_VERSION", + "MAYA_LOCATION", + "DYLD_LIBRARY_PATH" + ] + }, + "MAYA_VERSION": "2020", + "MAYA_LOCATION": { + "darwin": "/Applications/Autodesk/maya{MAYA_VERSION}/Maya.app/Contents", + "linux": "/usr/autodesk/maya{MAYA_VERSION}", + "windows": "C:/Program Files/Autodesk/Maya{MAYA_VERSION}" + }, + "DYLD_LIBRARY_PATH": { + "darwin": "{MAYA_LOCATION}/MacOS" } } }, @@ -28,7 +61,20 @@ }, "environment": { "__environment_keys__": { - "maya_2019": [] + "maya_2019": [ + "MAYA_VERSION", + "MAYA_LOCATION", + "DYLD_LIBRARY_PATH" + ] + }, + "MAYA_VERSION": "2019", + "MAYA_LOCATION": { + "darwin": "/Applications/Autodesk/maya{MAYA_VERSION}/Maya.app/Contents", + "linux": "/usr/autodesk/maya{MAYA_VERSION}", + "windows": "C:/Program Files/Autodesk/Maya{MAYA_VERSION}" + }, + "DYLD_LIBRARY_PATH": { + "darwin": "{MAYA_LOCATION}/MacOS" } } }, @@ -41,7 +87,20 @@ }, "environment": { "__environment_keys__": { - "maya_2018": [] + "maya_2018": [ + "MAYA_VERSION", + "MAYA_LOCATION", + "DYLD_LIBRARY_PATH" + ] + }, + "MAYA_VERSION": "2018", + "MAYA_LOCATION": { + "darwin": "/Applications/Autodesk/maya{MAYA_VERSION}/Maya.app/Contents", + "linux": "/usr/autodesk/maya{MAYA_VERSION}", + "windows": "C:/Program Files/Autodesk/Maya{MAYA_VERSION}" + }, + "DYLD_LIBRARY_PATH": { + "darwin": "{MAYA_LOCATION}/MacOS" } } } @@ -50,7 +109,18 @@ "enabled": true, "environment": { "__environment_keys__": { - "nuke": [] + "nuke": [ + "NUKE_PATH", + "PATH" + ] + }, + "NUKE_PATH": [ + "{PYPE_SETUP_PATH}/repos/avalon-core/setup/nuke/nuke_path", + "{PYPE_MODULE_ROOT}/setup/nuke/nuke_path", + "{PYPE_STUDIO_PLUGINS}/nuke" + ], + "PATH": { + "windows": "C:/Program Files (x86)/QuickTime/QTSystem/;{PATH}" } }, "nuke_12.0": { @@ -114,8 +184,13 @@ }, "environment": { "__environment_keys__": { - "nuke_10.0": [] - } + "nuke_10.0": [ + "PYPE_LOG_NO_COLORS", + "QT_PREFERRED_BINDING" + ] + }, + "PYPE_LOG_NO_COLORS": "Yes", + "QT_PREFERRED_BINDING": "PySide" } } }, @@ -123,7 +198,18 @@ "enabled": true, "environment": { "__environment_keys__": { - "nukex": [] + "nukex": [ + "NUKE_PATH", + "PATH" + ] + }, + "NUKE_PATH": [ + "{PYPE_SETUP_PATH}/repos/avalon-core/setup/nuke/nuke_path", + "{PYPE_MODULE_ROOT}/setup/nuke/nuke_path", + "{PYPE_STUDIO_PLUGINS}/nuke" + ], + "PATH": { + "windows": "C:/Program Files (x86)/QuickTime/QTSystem/;{PATH}" } }, "nukex_12.0": { @@ -187,8 +273,13 @@ }, "environment": { "__environment_keys__": { - "nukex_10.0": [] - } + "nukex_10.0": [ + "PYPE_LOG_NO_COLORS", + "QT_PREFERRED_BINDING" + ] + }, + "PYPE_LOG_NO_COLORS": "Yes", + "QT_PREFERRED_BINDING": "PySide" } } }, @@ -196,8 +287,23 @@ "enabled": true, "environment": { "__environment_keys__": { - "nukestudio": [] - } + "nukestudio": [ + "HIERO_PLUGIN_PATH", + "PATH", + "WORKFILES_STARTUP", + "TAG_ASSETBUILD_STARTUP", + "PYPE_LOG_NO_COLORS" + ] + }, + "HIERO_PLUGIN_PATH": [ + "{PYPE_MODULE_ROOT}/setup/nukestudio/hiero_plugin_path" + ], + "PATH": { + "windows": "C:/Program Files (x86)/QuickTime/QTSystem/;{PATH}" + }, + "WORKFILES_STARTUP": "0", + "TAG_ASSETBUILD_STARTUP": "0", + "PYPE_LOG_NO_COLORS": "True" }, "nukestudio_12.0": { "enabled": true, @@ -260,8 +366,13 @@ }, "environment": { "__environment_keys__": { - "nukestudio_10.0": [] - } + "nukestudio_10.0": [ + "PYPE_LOG_NO_COLORS", + "QT_PREFERRED_BINDING" + ] + }, + "PYPE_LOG_NO_COLORS": "Yes", + "QT_PREFERRED_BINDING": "PySide" } } }, @@ -269,8 +380,23 @@ "enabled": true, "environment": { "__environment_keys__": { - "hiero": [] - } + "hiero": [ + "HIERO_PLUGIN_PATH", + "PATH", + "WORKFILES_STARTUP", + "TAG_ASSETBUILD_STARTUP", + "PYPE_LOG_NO_COLORS" + ] + }, + "HIERO_PLUGIN_PATH": [ + "{PYPE_MODULE_ROOT}/setup/nukestudio/hiero_plugin_path" + ], + "PATH": { + "windows": "C:/Program Files (x86)/QuickTime/QTSystem/;{PATH}" + }, + "WORKFILES_STARTUP": "0", + "TAG_ASSETBUILD_STARTUP": "0", + "PYPE_LOG_NO_COLORS": "True" }, "hiero_12.0": { "enabled": true, @@ -333,8 +459,13 @@ }, "environment": { "__environment_keys__": { - "hiero_10.0": [] - } + "hiero_10.0": [ + "PYPE_LOG_NO_COLORS", + "QT_PREFERRED_BINDING" + ] + }, + "PYPE_LOG_NO_COLORS": "Yes", + "QT_PREFERRED_BINDING": "PySide" } } }, @@ -376,8 +507,57 @@ "enabled": true, "environment": { "__environment_keys__": { - "resolve": [] - } + "resolve": [ + "RESOLVE_UTILITY_SCRIPTS_SOURCE_DIR", + "RESOLVE_SCRIPT_API", + "RESOLVE_SCRIPT_LIB", + "RESOLVE_UTILITY_SCRIPTS_DIR", + "PYTHON36_RESOLVE", + "PYTHONPATH", + "PATH", + "PRE_PYTHON_SCRIPT", + "PYPE_LOG_NO_COLORS", + "RESOLVE_DEV" + ] + }, + "RESOLVE_UTILITY_SCRIPTS_SOURCE_DIR": [ + "{STUDIO_SOFT}/davinci_resolve/scripts/python" + ], + "RESOLVE_SCRIPT_API": { + "windows": "{PROGRAMDATA}/Blackmagic Design/DaVinci Resolve/Support/Developer/Scripting", + "darvin": "/Library/Application Support/Blackmagic Design/DaVinci Resolve/Developer/Scripting", + "linux": "/opt/resolve/Developer/Scripting" + }, + "RESOLVE_SCRIPT_LIB": { + "windows": "C:/Program Files/Blackmagic Design/DaVinci Resolve/fusionscript.dll", + "darvin": "/Applications/DaVinci Resolve/DaVinci Resolve.app/Contents/Libraries/Fusion/fusionscript.so", + "linux": "/opt/resolve/libs/Fusion/fusionscript.so" + }, + "RESOLVE_UTILITY_SCRIPTS_DIR": { + "windows": "{PROGRAMDATA}/Blackmagic Design/DaVinci Resolve/Fusion/Scripts/Comp", + "darvin": "/Library/Application Support/Blackmagic Design/DaVinci Resolve/Fusion/Scripts/Comp", + "linux": "/opt/resolve/Fusion/Scripts/Comp" + }, + "PYTHON36_RESOLVE": { + "windows": "{LOCALAPPDATA}/Programs/Python/Python36", + "darvin": "~/Library/Python/3.6/bin", + "linux": "/opt/Python/3.6/bin" + }, + "PYTHONPATH": [ + "{PYTHON36_RESOLVE}/Lib/site-packages", + "{VIRTUAL_ENV}/Lib/site-packages", + "{PYTHONPATH}", + "{RESOLVE_SCRIPT_API}/Modules", + "{PYTHONPATH}" + ], + "PATH": [ + "{PYTHON36_RESOLVE}", + "{PYTHON36_RESOLVE}/Scripts", + "{PATH}" + ], + "PRE_PYTHON_SCRIPT": "{PYPE_MODULE_ROOT}/pype/resolve/preload_console.py", + "PYPE_LOG_NO_COLORS": "True", + "RESOLVE_DEV": "True" }, "resolve_16": { "enabled": true, @@ -397,7 +577,20 @@ "enabled": true, "environment": { "__environment_keys__": { - "houdini": [] + "houdini": [ + "HOUDINI_PATH", + "HOUDINI_MENU_PATH" + ] + }, + "HOUDINI_PATH": { + "darwin": "{PYPE_MODULE_ROOT}/setup/houdini:&", + "linux": "{PYPE_MODULE_ROOT}/setup/houdini:&", + "windows": "{PYPE_MODULE_ROOT}/setup/houdini;&" + }, + "HOUDINI_MENU_PATH": { + "darwin": "{PYPE_MODULE_ROOT}/setup/houdini:&", + "linux": "{PYPE_MODULE_ROOT}/setup/houdini:&", + "windows": "{PYPE_MODULE_ROOT}/setup/houdini;&" } }, "houdini_18": { @@ -431,8 +624,18 @@ "enabled": true, "environment": { "__environment_keys__": { - "blender": [] - } + "blender": [ + "BLENDER_USER_SCRIPTS", + "PYTHONPATH", + "CREATE_NEW_CONSOLE" + ] + }, + "BLENDER_USER_SCRIPTS": "{PYPE_SETUP_PATH}/repos/avalon-core/setup/blender", + "PYTHONPATH": [ + "{PYPE_SETUP_PATH}/repos/avalon-core/setup/blender", + "{PYTHONPATH}" + ], + "CREATE_NEW_CONSOLE": "yes" }, "blender_2.90": { "enabled": true, @@ -465,8 +668,13 @@ "enabled": true, "environment": { "__environment_keys__": { - "harmony": [] - } + "harmony": [ + "AVALON_HARMONY_WORKFILES_ON_LAUNCH", + "PYBLISH_GUI_ALWAYS_EXEC" + ] + }, + "AVALON_HARMONY_WORKFILES_ON_LAUNCH": "1", + "PYBLISH_GUI_ALWAYS_EXEC": "1" }, "harmony_20": { "enabled": true, @@ -525,8 +733,19 @@ "enabled": true, "environment": { "__environment_keys__": { - "photoshop": [] - } + "photoshop": [ + "AVALON_PHOTOSHOP_WORKFILES_ON_LAUNCH", + "PYTHONPATH", + "PYPE_LOG_NO_COLORS", + "WEBSOCKET_URL", + "WORKFILES_SAVE_AS" + ] + }, + "AVALON_PHOTOSHOP_WORKFILES_ON_LAUNCH": "1", + "PYTHONPATH": "{PYTHONPATH}", + "PYPE_LOG_NO_COLORS": "Yes", + "WEBSOCKET_URL": "ws://localhost:8099/ws/", + "WORKFILES_SAVE_AS": "Yes" }, "photoshop_2020": { "enabled": true, @@ -546,8 +765,11 @@ "enabled": true, "environment": { "__environment_keys__": { - "celaction": [] - } + "celaction": [ + "CELACTION_TEMPLATE" + ] + }, + "CELACTION_TEMPLATE": "{PYPE_MODULE_ROOT}/pype/hosts/celaction/celaction_template_scene.scn" }, "celation_Local": { "enabled": true, From 633195d3b1f46639dff3ae3b65e5359472e6f2b5 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 2 Oct 2020 17:39:17 +0200 Subject: [PATCH 82/95] changed how is modified happens when item used as widget --- pype/tools/settings/settings/widgets/item_types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 535e96a665..90a6ea04f3 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -789,7 +789,7 @@ class InputObject(SettingObject): False, self._is_invalid, False, - self._is_modified + self.is_modified ) else: state = self.style_state( From d7de4318550f454f29d54cb63a0e63ec410bb168 Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Fri, 2 Oct 2020 17:58:56 +0200 Subject: [PATCH 83/95] add default paths --- .../system_settings/global/applications.json | 383 ++++++++---------- .../host_settings/system_host_template.json | 2 +- .../host_settings/system_nuke_template.json | 18 - 3 files changed, 179 insertions(+), 224 deletions(-) diff --git a/pype/settings/defaults/system_settings/global/applications.json b/pype/settings/defaults/system_settings/global/applications.json index 92d7ab0b2f..d0a452aaeb 100644 --- a/pype/settings/defaults/system_settings/global/applications.json +++ b/pype/settings/defaults/system_settings/global/applications.json @@ -29,9 +29,15 @@ "maya_2020": { "enabled": true, "maya_executables": { - "windows": "", - "darwin": "", - "linux": "" + "windows": [ + "C:\\Program Files\\Autodesk\\maya2020\\bin\\maya.exe" + ], + "darwin": [ + "" + ], + "linux": [ + "/usr/autodesk/maya2020/bin/maya" + ] }, "environment": { "__environment_keys__": { @@ -55,9 +61,15 @@ "maya_2019": { "enabled": true, "maya_executables": { - "windows": "", - "darwin": "", - "linux": "" + "windows": [ + "C:\\Program Files\\Autodesk\\maya2019\\bin\\maya.exe" + ], + "darwin": [ + "" + ], + "linux": [ + "/usr/autodesk/maya2019/bin/maya" + ] }, "environment": { "__environment_keys__": { @@ -81,9 +93,15 @@ "maya_2018": { "enabled": true, "maya_executables": { - "windows": "", - "darwin": "", - "linux": "" + "windows": [ + "C:\\Program Files\\Autodesk\\maya2018\\bin\\maya.exe" + ], + "darwin": [ + "" + ], + "linux": [ + "/usr/autodesk/maya2018/bin/maya" + ] }, "environment": { "__environment_keys__": { @@ -126,9 +144,13 @@ "nuke_12.0": { "enabled": true, "nuke_executables": { - "windows": [], + "windows": [ + "C:\\Program Files\\Nuke12.0v1\\Nuke12.0.exe" + ], "darwin": [], - "linux": [] + "linux": [ + "/usr/local/Nuke12.0v1/Nuke12.0" + ] }, "environment": { "__environment_keys__": { @@ -139,9 +161,15 @@ "nuke_11.3": { "enabled": true, "nuke_executables": { - "windows": [], + "windows": [ + "C:\\Program Files\\Nuke11.3v4\\Nuke11.3.exe", + "C:\\Program Files\\Nuke11.3v1\\Nuke11.3.exe" + ], "darwin": [], - "linux": [] + "linux": [ + "/usr/local/Nuke11.3v4/Nuke11.3", + "C:\\Program Files\\Nuke11.3v1\\Nuke11.3.exe" + ] }, "environment": { "__environment_keys__": { @@ -152,46 +180,23 @@ "nuke_11.2": { "enabled": true, "nuke_executables": { - "windows": [], + "windows": [ + "C:\\Program Files\\Nuke11.2v3\\Nuke11.2.exe", + "C:\\Program Files\\Nuke11.2v2\\Nuke11.2.exe", + "C:\\Program Files\\Nuke11.2v1\\Nuke11.2.exe" + ], "darwin": [], - "linux": [] + "linux": [ + "/usr/local/Nuke11.2v3/Nuke11.2", + "/usr/local/Nuke11.2v2/Nuke11.2", + "/usr/local/Nuke11.2v1/Nuke11.2" + ] }, "environment": { "__environment_keys__": { "nuke_11.2": [] } } - }, - "nuke_11.1": { - "enabled": true, - "nuke_executables": { - "windows": [], - "darwin": [], - "linux": [] - }, - "environment": { - "__environment_keys__": { - "nuke_11.1": [] - } - } - }, - "nuke_10.0": { - "enabled": true, - "nuke_executables": { - "windows": [], - "darwin": [], - "linux": [] - }, - "environment": { - "__environment_keys__": { - "nuke_10.0": [ - "PYPE_LOG_NO_COLORS", - "QT_PREFERRED_BINDING" - ] - }, - "PYPE_LOG_NO_COLORS": "Yes", - "QT_PREFERRED_BINDING": "PySide" - } } }, "nukex": { @@ -215,9 +220,13 @@ "nukex_12.0": { "enabled": true, "nukex_executables": { - "windows": [], + "windows": [ + "C:\\Program Files\\Nuke12.0v1\\Nuke12.0.exe -nukex" + ], "darwin": [], - "linux": [] + "linux": [ + "/usr/local/Nuke12.0v1/Nuke12.0 -nukex" + ] }, "environment": { "__environment_keys__": { @@ -228,9 +237,13 @@ "nukex_11.3": { "enabled": true, "nukex_executables": { - "windows": [], + "windows": [ + "C:\\Program Files\\Nuke11.3v1\\Nuke11.3.exe -nukex" + ], "darwin": [], - "linux": [] + "linux": [ + "/usr/local/Nuke11.3v1/Nuke11.3 -nukex" + ] }, "environment": { "__environment_keys__": { @@ -241,46 +254,19 @@ "nukex_11.2": { "enabled": true, "nukex_executables": { - "windows": [], + "windows": [ + "C:\\Program Files\\Nuke11.2v3\\Nuke11.2.exe -nukex" + ], "darwin": [], - "linux": [] + "linux": [ + "/usr/local/Nuke11.2v3/Nuke11.2 -nukex" + ] }, "environment": { "__environment_keys__": { "nukex_11.2": [] } } - }, - "nukex_11.1": { - "enabled": true, - "nukex_executables": { - "windows": [], - "darwin": [], - "linux": [] - }, - "environment": { - "__environment_keys__": { - "nukex_11.1": [] - } - } - }, - "nukex_10.0": { - "enabled": true, - "nukex_executables": { - "windows": [], - "darwin": [], - "linux": [] - }, - "environment": { - "__environment_keys__": { - "nukex_10.0": [ - "PYPE_LOG_NO_COLORS", - "QT_PREFERRED_BINDING" - ] - }, - "PYPE_LOG_NO_COLORS": "Yes", - "QT_PREFERRED_BINDING": "PySide" - } } }, "nukestudio": { @@ -308,9 +294,13 @@ "nukestudio_12.0": { "enabled": true, "nukestudio_executables": { - "windows": [], + "windows": [ + "C:\\Program Files\\Nuke12.0v1\\Nuke12.0.exe -studio" + ], "darwin": [], - "linux": [] + "linux": [ + "/usr/local/Nuke12.0v1/Nuke12.0 -studio" + ] }, "environment": { "__environment_keys__": { @@ -321,9 +311,13 @@ "nukestudio_11.3": { "enabled": true, "nukestudio_executables": { - "windows": [], + "windows": [ + "C:\\Program Files\\Nuke11.3v1\\Nuke11.3.exe -studio" + ], "darwin": [], - "linux": [] + "linux": [ + "/usr/local/Nuke11.3v1/Nuke11.3 -studio" + ] }, "environment": { "__environment_keys__": { @@ -334,46 +328,19 @@ "nukestudio_11.2": { "enabled": true, "nukestudio_executables": { - "windows": [], + "windows": [ + "C:\\Program Files\\Nuke11.2v3\\Nuke11.2.exe -studio" + ], "darwin": [], - "linux": [] + "linux": [ + "/usr/local/Nuke11.2v3/Nuke11.2 -studio" + ] }, "environment": { "__environment_keys__": { "nukestudio_11.2": [] } } - }, - "nukestudio_11.1": { - "enabled": true, - "nukestudio_executables": { - "windows": [], - "darwin": [], - "linux": [] - }, - "environment": { - "__environment_keys__": { - "nukestudio_11.1": [] - } - } - }, - "nukestudio_10.0": { - "enabled": true, - "nukestudio_executables": { - "windows": [], - "darwin": [], - "linux": [] - }, - "environment": { - "__environment_keys__": { - "nukestudio_10.0": [ - "PYPE_LOG_NO_COLORS", - "QT_PREFERRED_BINDING" - ] - }, - "PYPE_LOG_NO_COLORS": "Yes", - "QT_PREFERRED_BINDING": "PySide" - } } }, "hiero": { @@ -401,9 +368,13 @@ "hiero_12.0": { "enabled": true, "hiero_executables": { - "windows": [], + "windows": [ + "C:\\Program Files\\Nuke12.0v1\\Nuke12.0.exe -hiero" + ], "darwin": [], - "linux": [] + "linux": [ + "/usr/local/Nuke12.0v1/Nuke12.0 -hiero" + ] }, "environment": { "__environment_keys__": { @@ -414,9 +385,13 @@ "hiero_11.3": { "enabled": true, "hiero_executables": { - "windows": [], + "windows": [ + "C:\\Program Files\\Nuke11.3v1\\Nuke11.3.exe -hiero" + ], "darwin": [], - "linux": [] + "linux": [ + "/usr/local/Nuke11.3v1/Nuke11.3 -hiero" + ] }, "environment": { "__environment_keys__": { @@ -436,37 +411,6 @@ "hiero_11.2": [] } } - }, - "hiero_11.1": { - "enabled": true, - "hiero_executables": { - "windows": [], - "darwin": [], - "linux": [] - }, - "environment": { - "__environment_keys__": { - "hiero_11.1": [] - } - } - }, - "hiero_10.0": { - "enabled": true, - "hiero_executables": { - "windows": [], - "darwin": [], - "linux": [] - }, - "environment": { - "__environment_keys__": { - "hiero_10.0": [ - "PYPE_LOG_NO_COLORS", - "QT_PREFERRED_BINDING" - ] - }, - "PYPE_LOG_NO_COLORS": "Yes", - "QT_PREFERRED_BINDING": "PySide" - } } }, "fusion": { @@ -479,9 +423,9 @@ "fusion_16": { "enabled": true, "fusion_executables": { - "windows": "", - "darwin": "", - "linux": "" + "windows": [], + "darwin": [], + "linux": [] }, "environment": { "__environment_keys__": { @@ -492,9 +436,9 @@ "fusion_9": { "enabled": true, "fusion_executables": { - "windows": "", - "darwin": "", - "linux": "" + "windows": [], + "darwin": [], + "linux": [] }, "environment": { "__environment_keys__": { @@ -562,9 +506,11 @@ "resolve_16": { "enabled": true, "resolve_executables": { - "windows": "", - "darwin": "", - "linux": "" + "windows": [ + "C:/Program Files/Blackmagic Design/DaVinci Resolve/Resolve.exe" + ], + "darwin": [], + "linux": [] }, "environment": { "__environment_keys__": { @@ -596,9 +542,11 @@ "houdini_18": { "enabled": true, "houdini_executables": { - "windows": "", - "darwin": "", - "linux": "" + "windows": [ + "C:\\Program Files\\Side Effects Software\\Houdini 18.0.287\\bin\\houdini.exe" + ], + "darwin": [], + "linux": [] }, "environment": { "__environment_keys__": { @@ -609,9 +557,11 @@ "houdini_17": { "enabled": true, "houdini_executables": { - "windows": "", - "darwin": "", - "linux": "" + "windows": [ + "C:\\Program Files\\Side Effects Software\\Houdini 17.0.459\\bin\\houdini.exe" + ], + "darwin": [], + "linux": [] }, "environment": { "__environment_keys__": { @@ -640,9 +590,11 @@ "blender_2.90": { "enabled": true, "blender_executables": { - "windows": "", - "darwin": "", - "linux": "" + "windows": [ + "C:\\Program Files\\Blender Foundation\\Blender 2.90\\blender.exe" + ], + "darwin": [], + "linux": [] }, "environment": { "__environment_keys__": { @@ -653,9 +605,11 @@ "blender_2.83": { "enabled": true, "blender_executables": { - "windows": "", - "darwin": "", - "linux": "" + "windows": [ + "C:\\Program Files\\Blender Foundation\\Blender 2.83\\blender.exe" + ], + "darwin": [], + "linux": [] }, "environment": { "__environment_keys__": { @@ -679,9 +633,11 @@ "harmony_20": { "enabled": true, "harmony_executables": { - "windows": "", - "darwin": "", - "linux": "" + "windows": [ + "C:/Program Files (x86)/Toon Boom Animation/Toon Boom Harmony 20 Premium/win64/bin/HarmonyPremium.exe" + ], + "darwin": [], + "linux": [] }, "environment": { "__environment_keys__": { @@ -692,9 +648,11 @@ "harmony_19": { "enabled": true, "harmony_executables": { - "windows": "", - "darwin": "", - "linux": "" + "windows": [ + "C:/Program Files (x86)/Toon Boom Animation/Toon Boom Harmony 19 Premium/win64/bin/HarmonyPremium.exe" + ], + "darwin": [], + "linux": [] }, "environment": { "__environment_keys__": { @@ -705,9 +663,11 @@ "harmony_18": { "enabled": true, "harmony_executables": { - "windows": "", - "darwin": "", - "linux": "" + "windows": [ + "C:/Program Files (x86)/Toon Boom Animation/Toon Boom Harmony 17 Premium/win64/bin/HarmonyPremium.exe" + ], + "darwin": [], + "linux": [] }, "environment": { "__environment_keys__": { @@ -718,9 +678,11 @@ "harmony_17": { "enabled": true, "harmony_executables": { - "windows": "", - "darwin": "", - "linux": "" + "windows": [ + "C:/Program Files (x86)/Toon Boom Animation/Toon Boom Harmony 17 Premium/win64/bin/HarmonyPremium.exe" + ], + "darwin": [], + "linux": [] }, "environment": { "__environment_keys__": { @@ -750,9 +712,11 @@ "photoshop_2020": { "enabled": true, "photoshop_executables": { - "windows": "", - "darwin": "", - "linux": "" + "windows": [ + "C:\\Program Files\\Adobe\\Adobe Photoshop 2020\\Photoshop.exe" + ], + "darwin": [], + "linux": [] }, "environment": { "__environment_keys__": { @@ -773,7 +737,7 @@ }, "celation_Local": { "enabled": true, - "celation_executables": "", + "celation_executables": "C:\\Program Files (x86)\\CelAction\\CelAction2D.exe", "environment": { "__environment_keys__": { "celation_Local": [] @@ -782,7 +746,7 @@ }, "celation_Publish": { "enabled": true, - "celation_executables": "", + "celation_executables": "%PYPE_PYTHON_EXE% \"%PYPE_MODULE_ROOT%\\pype\\hosts\\celaction\\cli.py\" %*", "environment": { "__environment_keys__": { "celation_Publish": [] @@ -800,9 +764,11 @@ "unreal_4.24": { "enabled": true, "unreal_executables": { - "windows": "", - "darwin": "", - "linux": "" + "windows": [ + "%AVALON_CURRENT_UNREAL_ENGINE%\\Engine\\Binaries\\Win64\\UE4Editor.exe" + ], + "darwin": [], + "linux": [] }, "environment": { "__environment_keys__": { @@ -821,9 +787,12 @@ "python_Python 3.7": { "enabled": true, "python_executables": { - "windows": "", - "darwin": "", - "linux": "" + "windows": [ + "C:\\Python37\\python.exe", + "C:\\Python36\\python.exe" + ], + "darwin": [], + "linux": [] }, "environment": { "__environment_keys__": { @@ -834,9 +803,11 @@ "python_Python 2.7": { "enabled": true, "python_executables": { - "windows": "", - "darwin": "", - "linux": "" + "windows": [ + "C:\\Python27\\python.exe" + ], + "darwin": [], + "linux": [] }, "environment": { "__environment_keys__": { @@ -847,9 +818,11 @@ "terminal_Terminal": { "enabled": true, "terminal_executables": { - "windows": "", - "darwin": "", - "linux": "" + "windows": [ + "start cmd" + ], + "darwin": [], + "linux": [] }, "environment": { "__environment_keys__": { diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_host_template.json b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_host_template.json index dd4d3c8b4b..b39d6ac79d 100644 --- a/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_host_template.json +++ b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_host_template.json @@ -1,6 +1,6 @@ [{ "__default_values__": { - "multipath_executables": false, + "multipath_executables": true, "multiplatform": true } }, diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_nuke_template.json b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_nuke_template.json index 36d68dba95..22b2e0c4df 100644 --- a/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_nuke_template.json +++ b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_nuke_template.json @@ -41,24 +41,6 @@ "host_name": "{nuke_type}", "multipath_executables": true } - }, - { - "type": "schema_template", - "name": "system_host_template", - "template_data": { - "host_version": "11.1", - "host_name": "{nuke_type}", - "multipath_executables": true - } - }, - { - "type": "schema_template", - "name": "system_host_template", - "template_data": { - "host_version": "10.0", - "host_name": "{nuke_type}", - "multipath_executables": true - } } ] } From 4af1c62473a4462bda461a03f10c1632cb980b6d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 2 Oct 2020 17:59:09 +0200 Subject: [PATCH 84/95] fixed modifiable dit --- pype/tools/settings/settings/widgets/item_types.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 90a6ea04f3..706347bd21 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -2214,6 +2214,17 @@ class ModifiableDict(QtWidgets.QWidget, InputObject): self.value_changed.emit(self) + @property + def is_modified(self): + is_modified = super(ModifiableDict, self).is_modified + if is_modified: + return is_modified + + for input_field in self.input_fields: + if input_field.is_modified: + return True + return False + def hierarchical_style_update(self): for input_field in self.input_fields: input_field.hierarchical_style_update() From 1f5cfca44b9d2b426d529b0d0f5f17d8f6f815b8 Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Fri, 2 Oct 2020 18:13:52 +0200 Subject: [PATCH 85/95] convert remaining environments --- .../system_settings/global/general.json | 62 +- .../system_settings/global/modules.json | 41 +- .../system_schema/0_system_gui_schema.json | 2 +- ..._schema.json => 1_general_gui_schema.json} | 6 + .../system_schema/1_modules_gui_schema.json | 529 +++++++++--------- 5 files changed, 376 insertions(+), 264 deletions(-) rename pype/tools/settings/settings/gui_schemas/system_schema/{1_intents_gui_schema.json => 1_general_gui_schema.json} (69%) diff --git a/pype/settings/defaults/system_settings/global/general.json b/pype/settings/defaults/system_settings/global/general.json index bd501b06eb..c138f74667 100644 --- a/pype/settings/defaults/system_settings/global/general.json +++ b/pype/settings/defaults/system_settings/global/general.json @@ -1,4 +1,62 @@ { - "studio_name": "", - "studio_code": "" + "studio_name": "Studio", + "studio_code": "stu", + "environment": { + "__environment_keys__": { + "global": [ + "PYPE_APP_ROOT", + "PYPE_MODULE_ROOT", + "PYPE_PROJECT_PLUGINS", + "STUDIO_SOFT", + "FFMPEG_PATH", + "DJV_PATH", + "PATH", + "PYPE_OCIO_CONFIG", + "PYTHONPATH", + "PYPE_PROJECT_CONFIGS", + "PYPE_PYTHON_EXE", + "PYBLISH_GUI" + ] + }, + "PYPE_APP_ROOT": "{PYPE_SETUP_PATH}/pypeapp", + "PYPE_MODULE_ROOT": "{PYPE_SETUP_PATH}/repos/pype", + "PYPE_PROJECT_PLUGINS": "", + "STUDIO_SOFT": "{PYP_SETUP_ROOT}/soft", + "FFMPEG_PATH": { + "windows": "{VIRTUAL_ENV}/localized/ffmpeg_exec/windows/bin;{PYPE_SETUP_PATH}/vendor/bin/ffmpeg_exec/windows/bin", + "darwin": "{VIRTUAL_ENV}/localized/ffmpeg_exec/darwin/bin:{PYPE_SETUP_PATH}/vendor/bin/ffmpeg_exec/darwin/bin", + "linux": "{VIRTUAL_ENV}/localized/ffmpeg_exec/linux:{PYPE_SETUP_PATH}/vendor/bin/ffmpeg_exec/linux" + }, + "DJV_PATH": { + "windows": [ + "C:/Program Files/djv-1.1.0-Windows-64/bin/djv_view.exe", + "C:/Program Files/DJV/bin/djv_view.exe", + "{STUDIO_SOFT}/djv/windows/bin/djv_view.exe" + ], + "linux": [ + "usr/local/djv/djv_view", + "{STUDIO_SOFT}/djv/linux/bin/djv_view" + ], + "darwin": "Application/DJV.app/Contents/MacOS/DJV" + }, + "PATH": [ + "{PYPE_CONFIG}/launchers", + "{PYPE_APP_ROOT}", + "{FFMPEG_PATH}", + "{PATH}" + ], + "PYPE_OCIO_CONFIG": "{STUDIO_SOFT}/OpenColorIO-Configs", + "PYTHONPATH": { + "windows": "{VIRTUAL_ENV}/Lib/site-packages;{PYPE_MODULE_ROOT}/pype/tools;{PYTHONPATH}", + "linux": "{VIRTUAL_ENV}/lib/python{PYTHON_VERSION}/site-packages:{PYPE_MODULE_ROOT}/pype/tools:{PYTHONPATH}", + "darwin": "{VIRTUAL_ENV}/lib/python{PYTHON_VERSION}/site-packages:{PYPE_MODULE_ROOT}/pype/tools:{PYTHONPATH}" + }, + "PYPE_PROJECT_CONFIGS": "{PYPE_SETUP_PATH}/../studio-project-configs", + "PYPE_PYTHON_EXE": { + "windows": "{VIRTUAL_ENV}/Scripts/python.exe", + "linux": "{VIRTUAL_ENV}/Scripts/python", + "darwin": "{VIRTUAL_ENV}/bin/python" + }, + "PYBLISH_GUI": "pyblish_pype" + } } \ No newline at end of file diff --git a/pype/settings/defaults/system_settings/global/modules.json b/pype/settings/defaults/system_settings/global/modules.json index 9bd46602cf..8764ee94ca 100644 --- a/pype/settings/defaults/system_settings/global/modules.json +++ b/pype/settings/defaults/system_settings/global/modules.json @@ -2,7 +2,23 @@ "Avalon": { "AVALON_MONGO": "mongodb://localhost:2707", "AVALON_DB_DATA": "{PYPE_SETUP_PATH}/../mongo_db_data", - "AVALON_THUMBNAIL_ROOT": "{PYPE_SETUP_PATH}/../avalon_thumails" + "AVALON_THUMBNAIL_ROOT": "{PYPE_SETUP_PATH}/../avalon_thumails", + "environment": { + "__environment_keys__": { + "avalon": [ + "AVALON_CONFIG", + "AVALON_PROJECTS", + "AVALON_SCHEMA", + "AVALON_LABEL", + "AVALON_TIMEOUT" + ] + }, + "AVALON_CONFIG": "pype", + "AVALON_PROJECTS": "{PYPE_PROJECTS_PATH}", + "AVALON_SCHEMA": "{PYPE_MODULE_ROOT}/schema", + "AVALON_LABEL": "Pype", + "AVALON_TIMEOUT": "1000" + } }, "Ftrack": { "enabled": true, @@ -34,6 +50,29 @@ "test": "Test" }, "default": "-" + }, + "environment": { + "__environment_keys__": { + "ftrack": [ + "FTRACK_ACTIONS_PATH", + "FTRACK_EVENTS_PATH", + "PYTHONPATH", + "PYBLISHPLUGINPATH" + ] + }, + "FTRACK_ACTIONS_PATH": [ + "{PYPE_MODULE_ROOT}/pype/modules/ftrack/actions" + ], + "FTRACK_EVENTS_PATH": [ + "{PYPE_MODULE_ROOT}/pype/modules/ftrack/events" + ], + "PYTHONPATH": [ + "{PYPE_MODULE_ROOT}/pype/vendor", + "{PYTHONPATH}" + ], + "PYBLISHPLUGINPATH": [ + "{PYPE_MODULE_ROOT}/pype/plugins/ftrack/publish" + ] } }, "Rest Api": { diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/0_system_gui_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/0_system_gui_schema.json index c5f229fc2f..eb7d707f6a 100644 --- a/pype/tools/settings/settings/gui_schemas/system_schema/0_system_gui_schema.json +++ b/pype/tools/settings/settings/gui_schemas/system_schema/0_system_gui_schema.json @@ -7,7 +7,7 @@ "key": "global", "children": [{ "type": "schema", - "name": "1_intents_gui_schema" + "name": "1_general_gui_schema" },{ "type": "schema", "name": "1_modules_gui_schema" diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/1_intents_gui_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/1_general_gui_schema.json similarity index 69% rename from pype/tools/settings/settings/gui_schemas/system_schema/1_intents_gui_schema.json rename to pype/tools/settings/settings/gui_schemas/system_schema/1_general_gui_schema.json index 7f71da26cd..b83c336237 100644 --- a/pype/tools/settings/settings/gui_schemas/system_schema/1_intents_gui_schema.json +++ b/pype/tools/settings/settings/gui_schemas/system_schema/1_general_gui_schema.json @@ -12,5 +12,11 @@ "key": "studio_code", "type": "text", "label": "Studio Short Code" + }, + { + "key": "environment", + "label": "Environment", + "type": "raw-json", + "env_group_key": "global" } ]} diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/1_modules_gui_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/1_modules_gui_schema.json index d78c11838a..521442cc09 100644 --- a/pype/tools/settings/settings/gui_schemas/system_schema/1_modules_gui_schema.json +++ b/pype/tools/settings/settings/gui_schemas/system_schema/1_modules_gui_schema.json @@ -1,283 +1,292 @@ { - "key": "modules", - "type": "dict", - "label": "Modules", - "collapsable": true, - "is_file": true, - "children": [{ - "type": "dict", - "key": "Avalon", - "label": "Avalon", - "collapsable": true, - "children": [ - { - "type": "text", - "key": "AVALON_MONGO", - "label": "Avalon Mongo URL" - }, - { - "type": "text", - "key": "AVALON_DB_DATA", - "label": "Avalon Mongo Data Location" - }, - { - "type": "text", - "key": "AVALON_THUMBNAIL_ROOT", - "label": "Thumbnail Storage Location" - } - ] - },{ + "key": "modules", + "type": "dict", + "label": "Modules", + "collapsable": true, + "is_file": true, + "children": [{ + "type": "dict", + "key": "Avalon", + "label": "Avalon", + "collapsable": true, + "children": [{ + "type": "text", + "key": "AVALON_MONGO", + "label": "Avalon Mongo URL" + }, + { + "type": "text", + "key": "AVALON_DB_DATA", + "label": "Avalon Mongo Data Location" + }, + { + "type": "text", + "key": "AVALON_THUMBNAIL_ROOT", + "label": "Thumbnail Storage Location" + }, + { + "key": "environment", + "label": "Environment", + "type": "raw-json", + "env_group_key": "avalon" + } + ] + }, { "type": "dict", "key": "Ftrack", "label": "Ftrack", "collapsable": true, "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "text", + "key": "ftrack_server", + "label": "Server" + }, + { + "type": "label", + "label": "Additional Ftrack paths" + }, + { + "type": "list", + "key": "ftrack_actions_path", + "label": "Action paths", + "object_type": "text" + }, + { + "type": "list", + "key": "ftrack_events_path", + "label": "Event paths", + "object_type": "text" + }, + { + "type": "label", + "label": "Ftrack event server advanced settings" + }, + { + "type": "text", + "key": "FTRACK_EVENTS_MONGO_DB", + "label": "Event Mongo DB" + }, + { + "type": "text", + "key": "FTRACK_EVENTS_MONGO_COL", + "label": "Events Mongo Collection" + }, + { + "type": "dict", + "key": "sync_to_avalon", + "label": "Sync to avalon", + "children": [{ + "type": "list", + "key": "statuses_name_change", + "label": "Status name change", + "object_type": { + "type": "text", + "multiline": false + } + }] + }, + { + "type": "dict-modifiable", + "key": "status_version_to_task", + "label": "Version to Task status mapping", + "object_type": "text" + }, + { + "type": "dict-modifiable", + "key": "status_update", + "label": "Status Updates", + "object_type": { + "type": "list", + "object_type": "text" + } + }, + { + "key": "intent", + "type": "dict-invisible", + "children": [{ + "type": "dict-modifiable", + "object_type": "text", + "key": "items", + "label": "Intent Key/Label" + }, + { + "key": "default", + "type": "text", + "label": "Defautl Intent" + } + ] + }, + { + "key": "environment", + "label": "Environment", + "type": "raw-json", + "env_group_key": "ftrack" + } + ] + }, { + "type": "dict", + "key": "Rest Api", + "label": "Rest Api", + "collapsable": true, + "children": [{ + "type": "number", + "key": "default_port", + "label": "Default Port", + "minimum": 1, + "maximum": 65535 + }, + { + "type": "list", + "key": "exclude_ports", + "label": "Exclude ports", + "object_type": { + "type": "number", + "minimum": 1, + "maximum": 65535 + } + } + ] + }, { + "type": "dict", + "key": "Timers Manager", + "label": "Timers Manager", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "number", + "decimal": 2, + "key": "full_time", + "label": "Max idle time" + }, { + "type": "number", + "decimal": 2, + "key": "message_time", + "label": "When dialog will show" + } + ] + }, { + "type": "dict", + "key": "Clockify", + "label": "Clockify", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "text", + "key": "workspace_name", + "label": "Workspace name" + } + ] + }, { + "type": "dict", + "key": "Deadline", + "label": "Deadline", + "collapsable": true, + "checkbox_key": "enabled", "children": [{ "type": "boolean", "key": "enabled", "label": "Enabled" - }, - { - "type": "text", - "key": "ftrack_server", - "label": "Server" - }, - { - "type": "label", - "label": "Additional Ftrack paths" - }, - { - "type": "list", - "key": "ftrack_actions_path", - "label": "Action paths", - "object_type": "text" - }, - { - "type": "list", - "key": "ftrack_events_path", - "label": "Event paths", - "object_type": "text" - }, - { - "type": "label", - "label": "Ftrack event server advanced settings" - }, - { - "type": "text", - "key": "FTRACK_EVENTS_MONGO_DB", - "label": "Event Mongo DB" - }, - { - "type": "text", - "key": "FTRACK_EVENTS_MONGO_COL", - "label": "Events Mongo Collection" - }, - { - "type": "dict", - "key": "sync_to_avalon", - "label": "Sync to avalon", - "children": [{ - "type": "list", - "key": "statuses_name_change", - "label": "Status name change", - "object_type": { - "type": "text", - "multiline": false - } - }] - }, - { - "type": "dict-modifiable", - "key": "status_version_to_task", - "label": "Version to Task status mapping", - "object_type": "text" - }, - { - "type": "dict-modifiable", - "key": "status_update", - "label": "Status Updates", - "object_type": { - "type": "list", - "object_type": "text" - } - }, - { - "key": "intent", - "type": "dict-invisible", - "children": [ - { - "type": "dict-modifiable", - "object_type": "text", - "key": "items", - "label": "Intent Key/Label" - }, - { - "key": "default", - "type": "text", - "label": "Defautl Intent" - } - ] - } - ] - }, { - "type": "dict", - "key": "Rest Api", - "label": "Rest Api", - "collapsable": true, - "children": [{ - "type": "number", - "key": "default_port", - "label": "Default Port", - "minimum": 1, - "maximum": 65535 - }, - { - "type": "list", - "key": "exclude_ports", - "label": "Exclude ports", - "object_type": { - "type": "number", - "minimum": 1, - "maximum": 65535 - } - } - ] - }, { - "type": "dict", - "key": "Timers Manager", - "label": "Timers Manager", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "number", - "decimal": 2, - "key": "full_time", - "label": "Max idle time" }, { - "type": "number", - "decimal": 2, - "key": "message_time", - "label": "When dialog will show" - } - ] - }, { - "type": "dict", - "key": "Clockify", - "label": "Clockify", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "text", - "key": "workspace_name", - "label": "Workspace name" - } - ] - }, { - "type": "dict", - "key": "Deadline", - "label": "Deadline", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - },{ - "type": "text", - "key": "DEADLINE_REST_URL", - "label": "Deadline Resl URL" + "type": "text", + "key": "DEADLINE_REST_URL", + "label": "Deadline Resl URL" }] }, { - "type": "dict", - "key": "Muster", - "label": "Muster", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" - },{ - "type": "text", - "key": "MUSTER_REST_URL", - "label": "Muster Resl URL" - },{ - "type": "dict-modifiable", - "object_type": { - "type": "number", - "minimum": 0, - "maximum": 300 - }, - "is_group": true, - "key": "templates_mapping", - "label": "Templates mapping", - "is_file": true - }] - }, { - "type": "dict", - "key": "Logging", - "label": "Logging", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" + "type": "dict", + "key": "Muster", + "label": "Muster", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, { + "type": "text", + "key": "MUSTER_REST_URL", + "label": "Muster Resl URL" + }, { + "type": "dict-modifiable", + "object_type": { + "type": "number", + "minimum": 0, + "maximum": 300 + }, + "is_group": true, + "key": "templates_mapping", + "label": "Templates mapping", + "is_file": true }] }, { - "type": "dict", - "key": "Adobe Communicator", - "label": "Adobe Communicator", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" + "type": "dict", + "key": "Logging", + "label": "Logging", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" }] }, { - "type": "dict", - "key": "User setting", - "label": "User setting", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" + "type": "dict", + "key": "Adobe Communicator", + "label": "Adobe Communicator", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" }] }, { - "type": "dict", - "key": "Standalone Publish", - "label": "Standalone Publish", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" + "type": "dict", + "key": "User setting", + "label": "User setting", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" }] }, { - "type": "dict", - "key": "Idle Manager", - "label": "Idle Manager", - "collapsable": true, - "checkbox_key": "enabled", - "children": [{ - "type": "boolean", - "key": "enabled", - "label": "Enabled" + "type": "dict", + "key": "Standalone Publish", + "label": "Standalone Publish", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" }] - } - ] + }, { + "type": "dict", + "key": "Idle Manager", + "label": "Idle Manager", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }] + }] } From 05cbc781517dbee2b6a4fc0031a1a10332acaa96 Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Fri, 2 Oct 2020 18:31:58 +0200 Subject: [PATCH 86/95] slight visual cleanup --- .../system_settings/global/general.json | 18 ++++-- .../system_schema/1_general_gui_schema.json | 59 ++++++++++++------- .../system_schema/1_modules_gui_schema.json | 11 +++- 3 files changed, 60 insertions(+), 28 deletions(-) diff --git a/pype/settings/defaults/system_settings/global/general.json b/pype/settings/defaults/system_settings/global/general.json index c138f74667..2941ed7332 100644 --- a/pype/settings/defaults/system_settings/global/general.json +++ b/pype/settings/defaults/system_settings/global/general.json @@ -1,13 +1,21 @@ { - "studio_name": "Studio", - "studio_code": "stu", + "studio_name": "convert from \"PYPE_STUDIO_NAME\"", + "studio_code": "convert from \"PYPE_STUDIO_CODE\"", + "project_plugins": { + "windows": "convert from \"PYPE_PROJECT_PLUGINS\"", + "darwin": "", + "linux": "" + }, + "studio_soft": { + "windows": "convert from \"STUDIO_SOFT\"", + "darwin": "", + "linux": "" + }, "environment": { "__environment_keys__": { "global": [ "PYPE_APP_ROOT", "PYPE_MODULE_ROOT", - "PYPE_PROJECT_PLUGINS", - "STUDIO_SOFT", "FFMPEG_PATH", "DJV_PATH", "PATH", @@ -20,8 +28,6 @@ }, "PYPE_APP_ROOT": "{PYPE_SETUP_PATH}/pypeapp", "PYPE_MODULE_ROOT": "{PYPE_SETUP_PATH}/repos/pype", - "PYPE_PROJECT_PLUGINS": "", - "STUDIO_SOFT": "{PYP_SETUP_ROOT}/soft", "FFMPEG_PATH": { "windows": "{VIRTUAL_ENV}/localized/ffmpeg_exec/windows/bin;{PYPE_SETUP_PATH}/vendor/bin/ffmpeg_exec/windows/bin", "darwin": "{VIRTUAL_ENV}/localized/ffmpeg_exec/darwin/bin:{PYPE_SETUP_PATH}/vendor/bin/ffmpeg_exec/darwin/bin", diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/1_general_gui_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/1_general_gui_schema.json index b83c336237..15252ab39d 100644 --- a/pype/tools/settings/settings/gui_schemas/system_schema/1_general_gui_schema.json +++ b/pype/tools/settings/settings/gui_schemas/system_schema/1_general_gui_schema.json @@ -1,22 +1,39 @@ { - "key": "general", - "type": "dict", - "label": "General", - "collapsable": true, - "is_file": true, - "children": [{ - "key": "studio_name", - "type": "text", - "label": "Studio Name" - },{ - "key": "studio_code", - "type": "text", - "label": "Studio Short Code" - }, - { - "key": "environment", - "label": "Environment", - "type": "raw-json", - "env_group_key": "global" - } -]} + "key": "general", + "type": "dict", + "label": "General", + "collapsable": true, + "is_file": true, + "children": [{ + "key": "studio_name", + "type": "text", + "label": "Studio Name" + }, { + "key": "studio_code", + "type": "text", + "label": "Studio Short Code" + }, { + "type": "splitter" + }, { + "key": "project_plugins", + "type": "path-widget", + "label": "Additional Project Plugins Path", + "multiplatform": true, + "multipath": false + }, { + "key": "studio_soft", + "type": "path-widget", + "label": "Studio Software Location", + "multiplatform": true, + "multipath": false + }, { + "type": "splitter" + }, + { + "key": "environment", + "label": "Environment", + "type": "raw-json", + "env_group_key": "global" + } + ] +} diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/1_modules_gui_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/1_modules_gui_schema.json index 521442cc09..937eea4097 100644 --- a/pype/tools/settings/settings/gui_schemas/system_schema/1_modules_gui_schema.json +++ b/pype/tools/settings/settings/gui_schemas/system_schema/1_modules_gui_schema.json @@ -47,6 +47,9 @@ "key": "ftrack_server", "label": "Server" }, + { + "type": "splitter" + }, { "type": "label", "label": "Additional Ftrack paths" @@ -63,6 +66,9 @@ "label": "Event paths", "object_type": "text" }, + { + "type": "splitter" + }, { "type": "label", "label": "Ftrack event server advanced settings" @@ -118,10 +124,13 @@ { "key": "default", "type": "text", - "label": "Defautl Intent" + "label": "Default Intent" } ] }, + { + "type": "splitter" + }, { "key": "environment", "label": "Environment", From 9ed866b2bbf85d7f8449f4526a660f80a51d1d30 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 2 Oct 2020 18:35:38 +0200 Subject: [PATCH 87/95] modifiable dict fixed --- .../settings/settings/widgets/item_types.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 706347bd21..f3d51e3f1f 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -1464,6 +1464,12 @@ class ListItem(QtWidgets.QWidget, SettingObject): return self.value_input.item_value() return NOT_SET + @property + def is_modified(self): + if self._is_empty: + return False + return self.value_input.is_modified + @property def child_has_studio_override(self): return self.value_input.child_has_studio_override @@ -1708,6 +1714,17 @@ class ListWidget(QtWidgets.QWidget, InputObject): input_field.hierarchical_style_update() self.update_style() + @property + def is_modified(self): + is_modified = super(ListWidget, self).is_modified + if is_modified: + return is_modified + + for input_field in self.input_fields: + if input_field.is_modified: + return True + return False + def update_style(self): if not self.label_widget: return @@ -2027,6 +2044,8 @@ class ModifiableDictItem(QtWidgets.QWidget, SettingObject): @property def is_modified(self): + if self._is_empty: + return False return self.is_value_modified() or self.is_key_modified() def hierarchical_style_update(self): From 39891d3644e3f3a9989d998a4e6d8553fffe8a0d Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Fri, 2 Oct 2020 18:36:19 +0200 Subject: [PATCH 88/95] add DJV to applications --- .../defaults/environments/global.json | 12 -------- .../system_settings/global/applications.json | 28 +++++++++++++++++++ .../1_applications_gui_schema.json | 4 +++ .../host_settings/system_djv_schema.json | 27 ++++++++++++++++++ 4 files changed, 59 insertions(+), 12 deletions(-) create mode 100644 pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_djv_schema.json diff --git a/pype/settings/defaults/environments/global.json b/pype/settings/defaults/environments/global.json index ba467d2f5d..717e337db8 100644 --- a/pype/settings/defaults/environments/global.json +++ b/pype/settings/defaults/environments/global.json @@ -10,18 +10,6 @@ "darwin": "{VIRTUAL_ENV}/localized/ffmpeg_exec/darwin/bin:{PYPE_SETUP_PATH}/vendor/bin/ffmpeg_exec/darwin/bin", "linux": "{VIRTUAL_ENV}/localized/ffmpeg_exec/linux:{PYPE_SETUP_PATH}/vendor/bin/ffmpeg_exec/linux" }, - "DJV_PATH": { - "windows": [ - "C:/Program Files/djv-1.1.0-Windows-64/bin/djv_view.exe", - "C:/Program Files/DJV/bin/djv_view.exe", - "{STUDIO_SOFT}/djv/windows/bin/djv_view.exe" - ], - "linux": [ - "usr/local/djv/djv_view", - "{STUDIO_SOFT}/djv/linux/bin/djv_view" - ], - "darwin": "Application/DJV.app/Contents/MacOS/DJV" - }, "PATH": [ "{PYPE_CONFIG}/launchers", "{PYPE_APP_ROOT}", diff --git a/pype/settings/defaults/system_settings/global/applications.json b/pype/settings/defaults/system_settings/global/applications.json index d0a452aaeb..b85ec5369c 100644 --- a/pype/settings/defaults/system_settings/global/applications.json +++ b/pype/settings/defaults/system_settings/global/applications.json @@ -830,5 +830,33 @@ } } } + }, + "djvview": { + "enabled": true, + "environment": { + "__environment_keys__": { + "djvview": [] + } + }, + "djvview_1.1": { + "enabled": true, + "djvview_executables": { + "windows": [ + "C:/Program Files/djv-1.1.0-Windows-64/bin/djv_view.exe", + "C:/Program Files/DJV/bin/djv_view.exe" + ], + "darwin": [ + "Application/DJV.app/Contents/MacOS/DJV" + ], + "linux": [ + "usr/local/djv/djv_view" + ] + }, + "environment": { + "__environment_keys__": { + "djvview_1.1": [] + } + } + } } } \ No newline at end of file diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/1_applications_gui_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/1_applications_gui_schema.json index d1fa4e79f5..6b73fc3f8c 100644 --- a/pype/tools/settings/settings/gui_schemas/system_schema/1_applications_gui_schema.json +++ b/pype/tools/settings/settings/gui_schemas/system_schema/1_applications_gui_schema.json @@ -75,6 +75,10 @@ { "type": "schema", "name": "system_shell_schema" + }, + { + "type": "schema", + "name": "system_djv_schema" } ] } diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_djv_schema.json b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_djv_schema.json new file mode 100644 index 0000000000..704b13443d --- /dev/null +++ b/pype/tools/settings/settings/gui_schemas/system_schema/host_settings/system_djv_schema.json @@ -0,0 +1,27 @@ +{ + "type": "dict", + "key": "djvview", + "label": "DJV View", + "collapsable": true, + "checkbox_key": "enabled", + "children": [{ + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "key": "environment", + "label": "Environment", + "type": "raw-json", + "env_group_key": "djvview" + }, + { + "type": "schema_template", + "name": "system_host_template", + "template_data": { + "host_version": "1.1", + "host_name": "djvview" + } + } + ] +} From 6acdf42d8a4b2734adbab99531c68651a235760b Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Fri, 2 Oct 2020 18:46:00 +0200 Subject: [PATCH 89/95] remove obsolete variables --- .../defaults/system_settings/global/general.json | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/pype/settings/defaults/system_settings/global/general.json b/pype/settings/defaults/system_settings/global/general.json index 2941ed7332..64a70c17f8 100644 --- a/pype/settings/defaults/system_settings/global/general.json +++ b/pype/settings/defaults/system_settings/global/general.json @@ -17,9 +17,7 @@ "PYPE_APP_ROOT", "PYPE_MODULE_ROOT", "FFMPEG_PATH", - "DJV_PATH", "PATH", - "PYPE_OCIO_CONFIG", "PYTHONPATH", "PYPE_PROJECT_CONFIGS", "PYPE_PYTHON_EXE", @@ -33,25 +31,12 @@ "darwin": "{VIRTUAL_ENV}/localized/ffmpeg_exec/darwin/bin:{PYPE_SETUP_PATH}/vendor/bin/ffmpeg_exec/darwin/bin", "linux": "{VIRTUAL_ENV}/localized/ffmpeg_exec/linux:{PYPE_SETUP_PATH}/vendor/bin/ffmpeg_exec/linux" }, - "DJV_PATH": { - "windows": [ - "C:/Program Files/djv-1.1.0-Windows-64/bin/djv_view.exe", - "C:/Program Files/DJV/bin/djv_view.exe", - "{STUDIO_SOFT}/djv/windows/bin/djv_view.exe" - ], - "linux": [ - "usr/local/djv/djv_view", - "{STUDIO_SOFT}/djv/linux/bin/djv_view" - ], - "darwin": "Application/DJV.app/Contents/MacOS/DJV" - }, "PATH": [ "{PYPE_CONFIG}/launchers", "{PYPE_APP_ROOT}", "{FFMPEG_PATH}", "{PATH}" ], - "PYPE_OCIO_CONFIG": "{STUDIO_SOFT}/OpenColorIO-Configs", "PYTHONPATH": { "windows": "{VIRTUAL_ENV}/Lib/site-packages;{PYPE_MODULE_ROOT}/pype/tools;{PYTHONPATH}", "linux": "{VIRTUAL_ENV}/lib/python{PYTHON_VERSION}/site-packages:{PYPE_MODULE_ROOT}/pype/tools:{PYTHONPATH}", From 6181181097bf085f045990eba1cd102577ba820f Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Fri, 2 Oct 2020 18:55:10 +0200 Subject: [PATCH 90/95] shrink environments more --- pype/settings/defaults/system_settings/global/general.json | 6 +++--- pype/settings/defaults/system_settings/global/modules.json | 5 ----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/pype/settings/defaults/system_settings/global/general.json b/pype/settings/defaults/system_settings/global/general.json index 64a70c17f8..23e8a3ff5d 100644 --- a/pype/settings/defaults/system_settings/global/general.json +++ b/pype/settings/defaults/system_settings/global/general.json @@ -38,9 +38,9 @@ "{PATH}" ], "PYTHONPATH": { - "windows": "{VIRTUAL_ENV}/Lib/site-packages;{PYPE_MODULE_ROOT}/pype/tools;{PYTHONPATH}", - "linux": "{VIRTUAL_ENV}/lib/python{PYTHON_VERSION}/site-packages:{PYPE_MODULE_ROOT}/pype/tools:{PYTHONPATH}", - "darwin": "{VIRTUAL_ENV}/lib/python{PYTHON_VERSION}/site-packages:{PYPE_MODULE_ROOT}/pype/tools:{PYTHONPATH}" + "windows": "{VIRTUAL_ENV}/Lib/site-packages;{PYPE_MODULE_ROOT}/pype/tools;{PYPE_MODULE_ROOT}/pype/vendor;{PYTHONPATH}", + "linux": "{VIRTUAL_ENV}/lib/python{PYTHON_VERSION}/site-packages:{PYPE_MODULE_ROOT}/pype/tools:{PYPE_MODULE_ROOT}/pype/vendor:{PYTHONPATH}", + "darwin": "{VIRTUAL_ENV}/lib/python{PYTHON_VERSION}/site-packages:{PYPE_MODULE_ROOT}/pype/tools:{PYPE_MODULE_ROOT}/pype/vendor:{PYTHONPATH}" }, "PYPE_PROJECT_CONFIGS": "{PYPE_SETUP_PATH}/../studio-project-configs", "PYPE_PYTHON_EXE": { diff --git a/pype/settings/defaults/system_settings/global/modules.json b/pype/settings/defaults/system_settings/global/modules.json index 8764ee94ca..b0245f52bd 100644 --- a/pype/settings/defaults/system_settings/global/modules.json +++ b/pype/settings/defaults/system_settings/global/modules.json @@ -56,7 +56,6 @@ "ftrack": [ "FTRACK_ACTIONS_PATH", "FTRACK_EVENTS_PATH", - "PYTHONPATH", "PYBLISHPLUGINPATH" ] }, @@ -66,10 +65,6 @@ "FTRACK_EVENTS_PATH": [ "{PYPE_MODULE_ROOT}/pype/modules/ftrack/events" ], - "PYTHONPATH": [ - "{PYPE_MODULE_ROOT}/pype/vendor", - "{PYTHONPATH}" - ], "PYBLISHPLUGINPATH": [ "{PYPE_MODULE_ROOT}/pype/plugins/ftrack/publish" ] From 0c96044ed05ec7b14b003921800b654b6efd8eb5 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 2 Oct 2020 23:04:13 +0200 Subject: [PATCH 91/95] implemented new nice checkbox widget --- .../settings/settings/widgets/widgets.py | 185 ++++++++++++++++++ 1 file changed, 185 insertions(+) diff --git a/pype/tools/settings/settings/widgets/widgets.py b/pype/tools/settings/settings/widgets/widgets.py index b0bcf059a5..0d2960f86a 100644 --- a/pype/tools/settings/settings/widgets/widgets.py +++ b/pype/tools/settings/settings/widgets/widgets.py @@ -288,3 +288,188 @@ class GridLabelWidget(QtWidgets.QWidget): if self.input_field: return self.input_field.show_actions_menu(event) return super(GridLabelWidget, self).mouseReleaseEvent(event) + + +class NiceCheckboxMoveWidget(QtWidgets.QFrame): + def __init__(self, height, border_width, parent): + super(NiceCheckboxMoveWidget, self).__init__(parent=parent) + + self.checkstate = False + + self.half_size = int(height / 2) + self.full_size = self.half_size * 2 + self.border_width = border_width + self.setFixedHeight(self.full_size) + self.setFixedWidth(self.full_size) + + self.setStyleSheet(( + "background: #444444;border-style: none;" + "border-radius: {};border-width:{}px;" + ).format(self.half_size, self.border_width)) + + def update_position(self): + parent_rect = self.parent().rect() + if self.checkstate is True: + pos_x = ( + parent_rect.x() + + parent_rect.width() + - self.full_size + - self.border_width + ) + else: + pos_x = parent_rect.x() + self.border_width + + pos_y = parent_rect.y() + int( + parent_rect.height() / 2 - self.half_size + ) + self.setGeometry(pos_x, pos_y, self.width(), self.height()) + + def state_offset(self): + diff_x = ( + self.parent().rect().width() + - self.full_size + - (2 * self.border_width) + ) + return QtCore.QPoint(diff_x, 0) + + def change_position(self, checkstate): + self.checkstate = checkstate + + self.update_position() + + def resizeEvent(self, event): + super().resizeEvent(event) + self.update_position() + + +class NiceCheckbox(QtWidgets.QFrame): + stateChanged = QtCore.Signal(int) + checked_bg_color = QtGui.QColor(69, 128, 86) + unchecked_bg_color = QtGui.QColor(170, 80, 80) + + def set_bg_color(self, color): + self._bg_color = color + self.setStyleSheet(self._stylesheet_template.format( + color.red(), color.green(), color.blue() + )) + + def bg_color(self): + return self._bg_color + + bgcolor = QtCore.Property(QtGui.QColor, bg_color, set_bg_color) + + def __init__(self, checked=True, height=30, *args, **kwargs): + super(NiceCheckbox, self).__init__(*args, **kwargs) + + self._checkstate = checked + if checked: + bg_color = self.checked_bg_color + else: + bg_color = self.unchecked_bg_color + + self.half_height = int(height / 2) + height = self.half_height * 2 + tenth_height = int(height / 10) + + self.setFixedHeight(height) + self.setFixedWidth((height - tenth_height) * 2) + + move_item_size = height - (2 * tenth_height) + + self.move_item = NiceCheckboxMoveWidget( + move_item_size, tenth_height, self + ) + self.move_item.change_position(self._checkstate) + + self._stylesheet_template = ( + "border-radius: {}px;" + "border-width: {}px;" + "background: #333333;" + "border-style: solid;" + "border-color: #555555;" + ).format(self.half_height, tenth_height) + self._stylesheet_template += "background: rgb({},{},{});" + + self.set_bg_color(bg_color) + + def resizeEvent(self, event): + super(NiceCheckbox, self).resizeEvent(event) + self.move_item.update_position() + + def show(self, *args, **kwargs): + super(NiceCheckbox, self).show(*args, **kwargs) + self.move_item.update_position() + + def checkState(self): + if self._checkstate: + return QtCore.Qt.Checked + else: + return QtCore.Qt.Unchecked + + def _on_checkstate_change(self): + move_start_value = self.move_item.pos() + offset = self.move_item.state_offset() + if self._checkstate is True: + move_end_value = move_start_value + offset + else: + move_end_value = move_start_value - offset + move_animation = QtCore.QPropertyAnimation( + self.move_item, b"pos", self + ) + move_animation.setDuration(150) + move_animation.setEasingCurve(QtCore.QEasingCurve.OutQuad) + move_animation.setStartValue(move_start_value) + move_animation.setEndValue(move_end_value) + + color_animation = QtCore.QPropertyAnimation( + self, b"bgcolor" + ) + color_animation.setDuration(150) + if self._checkstate is True: + color_animation.setStartValue(self.unchecked_bg_color) + color_animation.setEndValue(self.checked_bg_color) + else: + color_animation.setStartValue(self.checked_bg_color) + color_animation.setEndValue(self.unchecked_bg_color) + + anim_group = QtCore.QParallelAnimationGroup(self) + anim_group.addAnimation(move_animation) + anim_group.addAnimation(color_animation) + + def _finished(): + self.move_item.change_position(self._checkstate) + self.stateChanged.emit(self.checkState()) + + anim_group.finished.connect(_finished) + anim_group.start() + + def isChecked(self): + return self._checkstate + + def setChecked(self, checked): + self._checkstate = checked + self._on_checkstate_change() + + def setCheckState(self, state=None): + if state is None: + checkstate = not self._checkstate + elif state == QtCore.Qt.Checked: + checkstate = True + elif state == QtCore.Qt.Unchecked: + checkstate = False + else: + return + + if checkstate == self._checkstate: + return + + self._checkstate = checkstate + + self._on_checkstate_change() + + def mouseReleaseEvent(self, event): + if event.button() == QtCore.Qt.LeftButton: + self.setCheckState() + event.accept() + return + return super(NiceCheckbox, self).mouseReleaseEvent(event) From 28eccb4d1f3d43265693d345e8c16aa622419123 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 2 Oct 2020 23:04:27 +0200 Subject: [PATCH 92/95] new checkbox widget used in boolean item --- pype/tools/settings/settings/widgets/item_types.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index f3d51e3f1f..551b91e911 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -6,7 +6,8 @@ from .widgets import ( NumberSpinBox, PathInput, GridLabelWidget, - ComboBox + ComboBox, + NiceCheckbox ) from .multiselection_combobox import MultiSelectionComboBox from .lib import NOT_SET, METADATA_KEY, TypeToKlass, CHILD_OFFSET @@ -910,7 +911,11 @@ class BooleanWidget(QtWidgets.QWidget, InputObject): layout.addWidget(label_widget, 0) self.label_widget = label_widget - self.input_field = QtWidgets.QCheckBox(self) + checkbox_height = self.style().pixelMetric( + QtWidgets.QStyle.PM_IndicatorHeight + ) + self.input_field = NiceCheckbox(height=checkbox_height, parent=self) + spacer = QtWidgets.QWidget(self) spacer.setAttribute(QtCore.Qt.WA_TranslucentBackground) From ba18d81448574305c2cc143b81d3871dee10b7d1 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 2 Oct 2020 23:11:02 +0200 Subject: [PATCH 93/95] few minor fixes --- pype/tools/settings/settings/widgets/widgets.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pype/tools/settings/settings/widgets/widgets.py b/pype/tools/settings/settings/widgets/widgets.py index 0d2960f86a..b64b1aa8ac 100644 --- a/pype/tools/settings/settings/widgets/widgets.py +++ b/pype/tools/settings/settings/widgets/widgets.py @@ -407,6 +407,8 @@ class NiceCheckbox(QtWidgets.QFrame): return QtCore.Qt.Unchecked def _on_checkstate_change(self): + self.stateChanged.emit(self.checkState()) + move_start_value = self.move_item.pos() offset = self.move_item.state_offset() if self._checkstate is True: @@ -438,7 +440,6 @@ class NiceCheckbox(QtWidgets.QFrame): def _finished(): self.move_item.change_position(self._checkstate) - self.stateChanged.emit(self.checkState()) anim_group.finished.connect(_finished) anim_group.start() @@ -447,6 +448,8 @@ class NiceCheckbox(QtWidgets.QFrame): return self._checkstate def setChecked(self, checked): + if checked == self._checkstate: + return self._checkstate = checked self._on_checkstate_change() From 91fd0066305172c340e62d91a2c41d627d17159c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 2 Oct 2020 23:32:22 +0200 Subject: [PATCH 94/95] environments metadata are added in `config_value` not in `item_value` --- pype/tools/settings/settings/widgets/item_types.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index f3d51e3f1f..7f22f804a7 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -1302,14 +1302,16 @@ class RawJsonWidget(QtWidgets.QWidget, InputObject): output = {} for key, value in value.items(): output[key.upper()] = value - - output[METADATA_KEY] = { - "environments": { - self.env_group_key: list(output.keys()) - } - } return output + def config_value(self): + value = self.item_value() + value[METADATA_KEY] = { + "environments": { + self.env_group_key: list(value.keys()) + } + } + return {self.key: value} class ListItem(QtWidgets.QWidget, SettingObject): _btn_size = 20 From baf89fa6c604574fc33c8fc5a5026a10bea6756a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 2 Oct 2020 23:33:07 +0200 Subject: [PATCH 95/95] fixed discard changes --- .../settings/settings/widgets/item_types.py | 42 +++++++++++++++---- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index 7f22f804a7..8e1ef57942 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -850,6 +850,7 @@ class InputObject(SettingObject): self._is_overriden = False return + self._state = None self._is_modified = False self._is_overriden = self._was_overriden @@ -2517,13 +2518,22 @@ class DictWidget(QtWidgets.QWidget, SettingObject): self._has_studio_override = True def discard_changes(self): - self._is_overriden = self._was_overriden self._is_modified = False + self._is_overriden = self._was_overriden + self._has_studio_override = self._had_studio_override for input_field in self.input_fields: input_field.discard_changes() self._is_modified = self.child_modified + if not self.is_overidable and self.as_widget: + if self.has_studio_override: + self._is_modified = self.studio_value != self.item_value() + else: + self._is_modified = self.default_value != self.item_value() + + self._state = None + self._is_overriden = self._was_overriden def set_as_overriden(self): if self.is_overriden: @@ -2925,11 +2935,20 @@ class DictInvisible(QtWidgets.QWidget, SettingObject): def discard_changes(self): self._is_modified = False self._is_overriden = self._was_overriden + self._has_studio_override = self._had_studio_override for input_field in self.input_fields: input_field.discard_changes() self._is_modified = self.child_modified + if not self.is_overidable and self.as_widget: + if self.has_studio_override: + self._is_modified = self.studio_value != self.item_value() + else: + self._is_modified = self.default_value != self.item_value() + + self._state = None + self._is_overriden = self._was_overriden def set_as_overriden(self): if self.is_overriden: @@ -3331,20 +3350,20 @@ class PathWidget(QtWidgets.QWidget, SettingObject): self._has_studio_override = True def discard_changes(self): + self._is_modified = False self._is_overriden = self._was_overriden self._has_studio_override = self._had_studio_override self.input_field.discard_changes() - if not self.is_overidable: + self._is_modified = self.child_modified + if not self.is_overidable and self.as_widget: if self.has_studio_override: self._is_modified = self.studio_value != self.item_value() else: self._is_modified = self.default_value != self.item_value() - self._is_overriden = False - return - self._is_modified = False + self._state = None self._is_overriden = self._was_overriden def set_as_overriden(self): @@ -3460,11 +3479,20 @@ class DictFormWidget(QtWidgets.QWidget, SettingObject): def discard_changes(self): self._is_modified = False self._is_overriden = self._was_overriden + self._has_studio_override = self._had_studio_override - for item in self.input_fields: - item.discard_changes() + for input_field in self.input_fields: + input_field.discard_changes() self._is_modified = self.child_modified + if not self.is_overidable and self.as_widget: + if self.has_studio_override: + self._is_modified = self.studio_value != self.item_value() + else: + self._is_modified = self.default_value != self.item_value() + + self._state = None + self._is_overriden = self._was_overriden def remove_overrides(self): self._is_overriden = False