mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 21:32:15 +01:00
Cleanup code based on code review from @fabiaserra
This commit is contained in:
parent
faeb53362a
commit
9c5ce5e9f4
2 changed files with 13 additions and 11 deletions
|
|
@ -170,8 +170,8 @@ class CreateRenderlayer(Creator, plugin.MayaCreatorBase):
|
|||
# later by a physical maya connection instead of relying on the layer
|
||||
# name
|
||||
cmds.addAttr(render_set, longName="renderlayer", at="message")
|
||||
cmds.connectAttr(layer.name() + ".message",
|
||||
render_set + ".renderlayer", force=True)
|
||||
cmds.connectAttr("{}.message".format(layer.name()),
|
||||
"{}.renderlayer".format(render_set), force=True)
|
||||
|
||||
# Add the set to the 'CreateRender' set.
|
||||
cmds.sets(render_set, forceElement=create_render_set)
|
||||
|
|
@ -191,7 +191,8 @@ class CreateRenderlayer(Creator, plugin.MayaCreatorBase):
|
|||
instance.data["instance_node"] = instance_node
|
||||
else:
|
||||
# TODO: Keep name in sync with the actual renderlayer?
|
||||
self.log.warning("No instance node found for to be updated instance: {}".format(instance))
|
||||
self.log.warning("No instance node found for to be updated "
|
||||
"instance: {}".format(instance))
|
||||
continue
|
||||
|
||||
self.imprint_instance_node(instance_node,
|
||||
|
|
@ -253,7 +254,8 @@ class CreateRenderlayer(Creator, plugin.MayaCreatorBase):
|
|||
default=False),
|
||||
BoolDef("overrideExistingFrame",
|
||||
label="Override Existing Frame",
|
||||
tooltip="Override existing rendered frames (if they exist).",
|
||||
tooltip="Override existing rendered frames "
|
||||
"(if they exist).",
|
||||
default=True),
|
||||
|
||||
# TODO: Should these move to submit_maya_deadline plugin?
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ class CollectMayaRender(pyblish.api.InstancePlugin):
|
|||
msg = "Render layer [ {} ] is not " "renderable".format(
|
||||
layer.name()
|
||||
)
|
||||
raise RuntimeError(msg)
|
||||
self.log.warning(msg)
|
||||
|
||||
# detect if there are sets (subsets) to attach render to
|
||||
sets = cmds.sets(objset, query=True) or []
|
||||
|
|
@ -112,7 +112,7 @@ class CollectMayaRender(pyblish.api.InstancePlugin):
|
|||
layer_render_products = get_layer_render_products(layer.name())
|
||||
render_products = layer_render_products.layer_data.products
|
||||
assert render_products, "no render products generated"
|
||||
exp_files = []
|
||||
expected_files = []
|
||||
multipart = False
|
||||
for product in render_products:
|
||||
if product.multipart:
|
||||
|
|
@ -122,7 +122,7 @@ class CollectMayaRender(pyblish.api.InstancePlugin):
|
|||
product_name = "{}{}".format(
|
||||
product.camera,
|
||||
"_{}".format(product_name) if product_name else "")
|
||||
exp_files.append(
|
||||
expected_files.append(
|
||||
{
|
||||
product_name: layer_render_products.get_files(
|
||||
product)
|
||||
|
|
@ -133,10 +133,10 @@ class CollectMayaRender(pyblish.api.InstancePlugin):
|
|||
|
||||
self.log.info("multipart: {}".format(
|
||||
multipart))
|
||||
assert exp_files, "no file names were generated, this is a bug"
|
||||
assert expected_files, "no file names were generated, this is a bug"
|
||||
self.log.info(
|
||||
"expected files: {}".format(
|
||||
json.dumps(exp_files, indent=4, sort_keys=True)
|
||||
json.dumps(expected_files, indent=4, sort_keys=True)
|
||||
)
|
||||
)
|
||||
|
||||
|
|
@ -144,7 +144,7 @@ class CollectMayaRender(pyblish.api.InstancePlugin):
|
|||
# in expectedFiles. If so, raise error as we cannot attach AOV
|
||||
# (considered to be subset on its own) to another subset
|
||||
if attach_to:
|
||||
assert isinstance(exp_files, list), (
|
||||
assert isinstance(expected_files, list), (
|
||||
"attaching multiple AOVs or renderable cameras to "
|
||||
"subset is not supported"
|
||||
)
|
||||
|
|
@ -158,7 +158,7 @@ class CollectMayaRender(pyblish.api.InstancePlugin):
|
|||
# replace relative paths with absolute. Render products are
|
||||
# returned as list of dictionaries.
|
||||
publish_meta_path = None
|
||||
for aov in exp_files:
|
||||
for aov in expected_files:
|
||||
full_paths = []
|
||||
aov_first_key = list(aov.keys())[0]
|
||||
for file in aov[aov_first_key]:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue