Merge branch 'develop' into substance_integration

This commit is contained in:
Roy Nieterau 2023-04-19 10:18:37 +02:00 committed by GitHub
commit 3c56b89606
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
67 changed files with 3104 additions and 442 deletions

View file

@ -670,8 +670,7 @@ class IntegrateAsset(pyblish.api.InstancePlugin):
# - template_data (Dict[str, Any]): source data used to fill template
# - to add required data to 'repre_context' not used for
# formatting
# - anatomy_filled (Dict[str, Any]): filled anatomy of last file
# - to fill 'publishDir' on instance.data -> not ideal
path_template_obj = anatomy.templates_obj[template_name]["path"]
# Treat template with 'orignalBasename' in special way
if "{originalBasename}" in template:
@ -705,8 +704,7 @@ class IntegrateAsset(pyblish.api.InstancePlugin):
template_data["originalBasename"], _ = os.path.splitext(
src_file_name)
anatomy_filled = anatomy.format(template_data)
dst = anatomy_filled[template_name]["path"]
dst = path_template_obj.format_strict(template_data)
src = os.path.join(stagingdir, src_file_name)
transfers.append((src, dst))
if repre_context is None:
@ -766,8 +764,9 @@ class IntegrateAsset(pyblish.api.InstancePlugin):
template_data["udim"] = index
else:
template_data["frame"] = index
anatomy_filled = anatomy.format(template_data)
template_filled = anatomy_filled[template_name]["path"]
template_filled = path_template_obj.format_strict(
template_data
)
dst_filepaths.append(template_filled)
if repre_context is None:
self.log.debug(
@ -803,8 +802,7 @@ class IntegrateAsset(pyblish.api.InstancePlugin):
if is_udim:
template_data["udim"] = repre["udim"][0]
# Construct destination filepath from template
anatomy_filled = anatomy.format(template_data)
template_filled = anatomy_filled[template_name]["path"]
template_filled = path_template_obj.format_strict(template_data)
repre_context = template_filled.used_values
dst = os.path.normpath(template_filled)
@ -815,11 +813,9 @@ class IntegrateAsset(pyblish.api.InstancePlugin):
# todo: Are we sure the assumption each representation
# ends up in the same folder is valid?
if not instance.data.get("publishDir"):
instance.data["publishDir"] = (
anatomy_filled
[template_name]
["folder"]
)
template_obj = anatomy.templates_obj[template_name]["folder"]
template_filled = template_obj.format_strict(template_data)
instance.data["publishDir"] = template_filled
for key in self.db_representation_context_keys:
# Also add these values to the context even if not used by the