Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redshift render: invalid detection of output files when using light groups #173

Open
1 task done
BigRoy opened this issue Nov 11, 2024 · 0 comments
Open
1 task done
Labels
type: bug Something isn't working

Comments

@BigRoy
Copy link
Contributor

BigRoy commented Nov 11, 2024

Is there an existing issue for this?

  • I have searched the existing issues and added correct labels.

Description

Current Behavior

Before submitting a render we 'collect' what files we're expecting the renderer to output. However, with Redshift when rendering to separate AOVs we are currently not detecting all the layers that Redshift generates. When e.g. all light groups are enabled and the globalAov attribute is set to "remainder" we miss the:

  • layer.1001.exr <- the main layer is always included
  • layer_AOVNAME_other.exr <- the "remainder" layer

Expected Behavior

All layers should be correctly detected.

For more details also see the Redshift forum topic that explains a bit how Redshift outputs the images in this case.

Since this is behind a login, here's a quick copy of an example from there:

AOV = BeautyAux
lightgroups = key, rim, fill
output for lightgroups disabled:

  • mylayer.exr
  • mylayer.BeautyAux.exr

output for lightgroups enabled, option "all"

  • mylayer.exr
  • mylayer.BeautyAux_key.exr
  • mylayer.BeautxAux_rim.exr
  • mylayer.BeautyAux_fill.exr

output for lightgroups enabled, option "remainder" (all other lights that are not in a lightgroup)

  • mylayer.exr
  • mylayer.BeautyAux_key.exr
  • mylayer.BeautyAux_rim.exr
  • mylayer.BeautyAux_fill.exr
  • mylayer.BeautyAux_other.exr

"remainder" is i think the better choice, since then it doesnt miss any lights, that arent in a lightgroup.
for all other AOVs that support light groups, you will get also the whole AOV itsself, i.e.

  • mylayer.exr
  • mylayer.DiffuseLighting.exr
  • mylayer.DiffuseLighting_key.exr
  • mylayer.DiffuseLighting_rim.exr
  • mylayer.DiffuseLighting_fill.exr
    ...

also in maya, if lights are hidden (even they are not in a render layer) but in a lightgroup, they will be put in the output, if "all light groups" is enabled.
the only workaround for that, is i think to manual select the wanted groups in the AOV lightgroup selection list.

Steps To Reproduce:

  1. Set up redshift render with separated AOVs (not multi-channel EXR)
  2. Set up a Beauty (Aux) AOV
  3. Set up some lights with light groups enabled.
  4. Set it to "All light groups"
  5. Set the AOV's global AOV to "Remainder" in its light group settings

Additional context:

Version

ayon-core 1.0.6
ayon-maya 0.4.0
Redshift 2025.1.1
Windows 10

Our current logic is here:

# Get Redshift Extension from image format
image_format = self._get_attr("redshiftOptions.imageFormat") # integer
ext = mel.eval("redshiftGetImageExtension(%i)" % image_format)
use_ref_aovs = self.render_instance.data.get(
"useReferencedAovs", False) or False
aovs = cmds.ls(type="RedshiftAOV")
if not use_ref_aovs:
ref_aovs = cmds.ls(type="RedshiftAOV", referencedNodes=True)
aovs = list(set(aovs) - set(ref_aovs))
products = []
global_aov_enabled = bool(
self._get_attr("redshiftOptions.aovGlobalEnableMode", as_string=False)
)
colorspace = lib.get_color_management_output_transform()
if not global_aov_enabled:
# only beauty output
for camera in cameras:
products.insert(0,
RenderProduct(productName="",
ext=ext,
multipart=self.multipart,
camera=camera,
colorspace=colorspace))
return products
light_groups_enabled = False
has_beauty_aov = False
for aov in aovs:
enabled = self._get_attr(aov, "enabled")
if not enabled:
continue
aov_type = self._get_attr(aov, "aovType")
if self.multipart and aov_type not in self.unmerged_aovs:
continue
# Any AOVs that still get processed, like Cryptomatte
# by themselves are not multipart files.
# Redshift skips rendering of masterlayer without AOV suffix
# when a Beauty AOV is rendered. It overrides the main layer.
if aov_type == "Beauty":
has_beauty_aov = True
aov_name = self._get_attr(aov, "name")
# Support light Groups
light_groups = []
if self._get_attr(aov, "supportsLightGroups"):
all_light_groups = self._get_attr(aov, "allLightGroups")
if all_light_groups:
# All light groups is enabled
light_groups = self._get_redshift_light_groups()
else:
value = self._get_attr(aov, "lightGroupList")
# note: string value can return None when never set
if value:
selected_light_groups = value.strip().split()
light_groups = selected_light_groups
for light_group in light_groups:
aov_light_group_name = "{}_{}".format(aov_name,
light_group)
for camera in cameras:
product = RenderProduct(
productName=aov_light_group_name,
aov=aov_name,
ext=ext,
multipart=False,
camera=camera,
driver=aov,
colorspace=colorspace)
products.append(product)
if light_groups:
light_groups_enabled = True
# Redshift AOV Light Select always renders the global AOV
# even when light groups are present so we don't need to
# exclude it when light groups are active
for camera in cameras:
product = RenderProduct(productName=aov_name,
aov=aov_name,
ext=ext,
multipart=False,
camera=camera,
driver=aov,
colorspace=colorspace)
products.append(product)
# When a Beauty AOV is added manually, it will be rendered as
# 'Beauty_other' in file name and "standard" beauty will have
# 'Beauty' in its name. When disabled, standard output will be
# without `Beauty`. Except when using light groups.
if light_groups_enabled:
return products
beauty_name = "BeautyAux" if has_beauty_aov else ""
for camera in cameras:
products.insert(0,
RenderProduct(productName=beauty_name,
ext=ext,
multipart=self.multipart,
camera=camera,
colorspace=colorspace))
return products

@BigRoy BigRoy added the type: bug Something isn't working label Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant