deal with hound

This commit is contained in:
Milan Kolar 2020-12-03 21:48:27 +01:00
parent f668db2852
commit 363b70233d
9 changed files with 33 additions and 19 deletions

View file

@ -48,9 +48,12 @@ def patched_discover(superclass):
elif superclass.__name__.split(".")[-1] == "Creator":
plugin_type = "create"
print(">>> trying to find presets for {}:{} ...".format(host, plugin_type))
print(">>> Finding presets for {}:{} ...".format(host, plugin_type))
try:
settings = get_project_settings(os.environ['AVALON_PROJECT'])[host][plugin_type]
settings = (
get_project_settings(os.environ['AVALON_PROJECT'])
[host][plugin_type]
)
except KeyError:
print("*** no presets found.")
else:

View file

@ -285,8 +285,10 @@ class GlobalHostDataHook(PreLaunchHook):
"""
project_settings = get_project_settings(project_name)['global']['tools']
startup_presets = project_settings['Workfiles']['last_workfile_on_startup']
project_settings = (
get_project_settings(project_name)['global']['tools'])
startup_presets = (
project_settings['Workfiles']['last_workfile_on_startup'])
if not startup_presets:
return default_output

View file

@ -50,10 +50,18 @@ def get_asset_settings():
}
try:
skip_resolution_check = \
get_current_project_settings()["harmony"]["general"]["skip_resolution_check"]
skip_timelines_check = \
get_current_project_settings()["harmony"]["general"]["skip_timelines_check"]
skip_resolution_check = (
get_current_project_settings()
["harmony"]
["general"]
["skip_resolution_check"]
)
skip_timelines_check = (
get_current_project_settings()
["harmony"]
["general"]
["skip_timelines_check"]
)
except KeyError:
skip_resolution_check = []
skip_timelines_check = []

View file

@ -73,9 +73,9 @@ class CreateProjectFolders(BaseAction):
project_entity = self.get_project_from_entity(entities[0])
# Load settings for project
project_name = project_entity["full_name"]
get_project_settings = get_project_settings(project_name)
project_settings = get_project_settings(project_name)
project_folder_structure = (
get_project_settings["global"]["project_folder_structure"]
project_settings["global"]["project_folder_structure"]
)
if not project_folder_structure:
return {

View file

@ -200,9 +200,9 @@ class UserAssigmentEvent(BaseEvent):
project_name = task_entity["project"]["full_name"]
project_data = tmp_by_project_name.get(project_name) or {}
if "scripts_by_action" not in project_data:
get_project_settings = get_project_settings(project_name)
project_settings = get_project_settings(project_name)
_settings = (
get_project_settings["ftrack"]["events"]["user_assignment"]
project_settings["ftrack"]["events"]["user_assignment"]
)
project_data["scripts_by_action"] = _settings.get("scripts")
tmp_by_project_name[project_name] = project_data

View file

@ -52,12 +52,11 @@ class VersionToTaskStatus(BaseEvent):
project_entity = self.get_project_from_entity(task)
project_name = project_entity["full_name"]
get_project_settings = get_project_settings(project_name)
project_settings = get_project_settings(project_name)
# Load status mapping from presets
status_mapping = (
get_project_settings["ftrack"]["event"]["status_version_to_task"]
)
project_settings["ftrack"]["events"]["status_version_to_task"])
# Skip if mapping is empty
if not status_mapping:
continue

View file

@ -102,8 +102,8 @@ class ExtractCameraMayaScene(pype.api.Extractor):
def process(self, instance):
"""Plugin entry point."""
# get settings
# TODO: load all settings directly, rather than passing them through context
ext_mapping = instance.context.data["presets"]["maya"].get("ext_mapping") # noqa: E501
ext_mapping = (instance.context.data["presets"]["maya"]
.get("ext_mapping")) # noqa: E501
if ext_mapping:
self.log.info("Looking in presets for scene type ...")
# use extension mapping for first family found

View file

@ -27,7 +27,8 @@ def _get_template_id(renderer):
templates = get_system_settings()["modules"]["Muster"]["templates_mapping"]
if not templates:
raise RuntimeError(("Muster template mapping missing in pype-settings"))
raise RuntimeError(("Muster template mapping missing in "
"pype-settings"))
try:
template_id = templates[renderer]
except KeyError:

View file

@ -14,7 +14,8 @@ shelf_preset = settings['maya'].get('project_shelf')
if shelf_preset:
project = os.environ["AVALON_PROJECT"]
icon_path = os.path.join(os.environ['PYPE_PROJECT_SCRIPTS'], project, "icons")
icon_path = os.path.join(os.environ['PYPE_PROJECT_SCRIPTS'],
project, "icons")
icon_path = os.path.abspath(icon_path)
for i in shelf_preset['imports']: