Merge branch 'develop' into feature/OP-3842_Change-publish-template-settings-location

This commit is contained in:
Jakub Trllo 2022-09-06 17:25:53 +02:00
commit 965a1d8f61
81 changed files with 1729 additions and 1158 deletions

View file

@ -17,6 +17,8 @@ from .publish_plugins import (
RepairAction,
RepairContextAction,
Extractor,
)
from .lib import (
@ -60,6 +62,8 @@ __all__ = (
"RepairAction",
"RepairContextAction",
"Extractor",
"get_publish_template_name",
"DiscoverResult",

View file

@ -8,7 +8,8 @@ from openpype.lib import BoolDef
from .lib import (
load_help_content_from_plugin,
get_errored_instances_from_context,
get_errored_plugins_from_context
get_errored_plugins_from_context,
get_instance_staging_dir,
)
@ -241,3 +242,25 @@ class RepairContextAction(pyblish.api.Action):
if plugin in errored_plugins:
self.log.info("Attempting fix ...")
plugin.repair(context)
class Extractor(pyblish.api.InstancePlugin):
"""Extractor base class.
The extractor base class implements a "staging_dir" function used to
generate a temporary directory for an instance to extract to.
This temporary directory is generated through `tempfile.mkdtemp()`
"""
order = 2.0
def staging_dir(self, instance):
"""Provide a temporary directory in which to store extracted files
Upon calling this method the staging directory is stored inside
the instance.data['stagingDir']
"""
return get_instance_staging_dir(instance)

View file

@ -5,13 +5,15 @@ import six
import logging
from functools import reduce
from openpype.client import get_asset_by_name
from openpype.client import (
get_asset_by_name,
get_linked_assets,
)
from openpype.settings import get_project_settings
from openpype.lib import (
StringTemplate,
Logger,
filter_profiles,
get_linked_assets,
)
from openpype.pipeline import legacy_io, Anatomy
from openpype.pipeline.load import (
@ -177,7 +179,7 @@ class AbstractTemplateLoader:
build_info["profiles"],
{
"task_types": task_type,
"tasks": task_name
"task_names": task_name
}
)

View file

@ -1,3 +1,4 @@
import os
from importlib import import_module
from openpype.lib import classes_from_module
from openpype.host import HostBase
@ -30,7 +31,7 @@ def build_workfile_template(*args):
template_loader.populate_template()
def update_workfile_template(args):
def update_workfile_template(*args):
template_loader = build_template_loader()
template_loader.update_missing_containers()
@ -42,7 +43,10 @@ def build_template_loader():
if isinstance(host, HostBase):
host_name = host.name
else:
host_name = host.__name__.partition('.')[2]
host_name = os.environ.get("AVALON_APP")
if not host_name:
host_name = host.__name__.split(".")[-2]
module_path = _module_path_format.format(host=host_name)
module = import_module(module_path)
if not module:

View file

@ -8,10 +8,10 @@ from openpype.client import (
get_subsets,
get_last_versions,
get_representations,
get_linked_assets,
)
from openpype.settings import get_project_settings
from openpype.lib import (
get_linked_assets,
filter_profiles,
Logger,
)