for padding is used frame_padding from anatomy templates but kept backwards compatible "frame"

This commit is contained in:
iLLiCiTiT 2020-05-14 10:59:40 +02:00
parent 0d311d63c8
commit f30f0099fd
4 changed files with 24 additions and 6 deletions

View file

@ -177,9 +177,16 @@ def format_anatomy(data):
log.debug("__ anatomy.templates: {}".format(anatomy.templates))
try:
padding = int(anatomy.templates['render']['padding'])
# TODO: bck compatibility with old anatomy template
padding = int(
anatomy.templates["render"].get(
"frame_padding",
anatomy.templates["render"].get("padding")
)
)
except KeyError as e:
msg = ("`padding` key is not in `render` "
"or `frame_padding` on is not available in "
"Anatomy template. Please, add it there and restart "
"the pipeline (padding: \"4\"): `{}`").format(e)

View file

@ -356,8 +356,11 @@ class IntegrateMasterVersion(pyblish.api.InstancePlugin):
_anatomy_filled = anatomy.format(anatomy_data)
_template_filled = _anatomy_filled["master"]["path"]
head, tail = _template_filled.split(frame_splitter)
padding = (
anatomy.templates["render"]["padding"]
padding = int(
anatomy.templates["render"].get(
"frame_padding",
anatomy.templates["render"].get("padding")
)
)
dst_col = clique.Collection(

View file

@ -341,8 +341,11 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
index_frame_start = None
if repre.get("frameStart"):
frame_start_padding = (
anatomy.templates["render"]["padding"]
frame_start_padding = int(
anatomy.templates["render"].get(
"frame_padding",
anatomy.templates["render"].get("padding")
)
)
index_frame_start = int(repre.get("frameStart"))

View file

@ -104,7 +104,12 @@ class CollectPlatesData(api.InstancePlugin):
version_data = dict()
context = instance.context
anatomy = context.data.get("anatomy", None)
padding = int(anatomy.templates['render']['padding'])
padding = int(
anatomy.templates["render"].get(
"frame_padding",
anatomy.templates["render"].get("padding")
)
)
name = instance.data["subset"]
source_path = instance.data["sourcePath"]