Conversation
… validator for renderlayer being active
LiborBatek
left a comment
There was a problem hiding this comment.
It correctly propagates the selected ViewLayer from the publish instance (in metadata.json) and ignores the unselected one which is correct behaviour.
However for some reason the rendered files end up in different staging folders than expected (marked green vs red incorrect folders on the screenshot) once moved the publish job finnishes as it has all the expected files in correct location.
Im also enclosing the publish report and metadata.json for your evaluation:
| comp_node = instance.transient_data["instance_node"] | ||
| viewlayer_nodes = lib.get_viewlayer_nodes(comp_node) | ||
| if not viewlayer_nodes: | ||
| cls.log.warning("No view layer nodes found - returning empty items") |
There was a problem hiding this comment.
Don't really think this should be a warning. It's not that problematic, right?
client/ayon_blender/api/lib.py
Outdated
| for input_node in node.inputs: | ||
| for link in input_node.links: | ||
| if link.from_node.type == "R_LAYERS": | ||
| if link.from_node.layer in viewlayers: | ||
| if input_node.name == name: | ||
| return name | ||
| return "" |
There was a problem hiding this comment.
I don't think we should assume the compositor output file node is directly connected to a renderlayers node - it may be absolutely fine to have nodes in between them.
There was a problem hiding this comment.
But isn't the compositor node only rendering those viewlayers which are connected to that?
client/ayon_blender/api/lib.py
Outdated
| for input_node in node.inputs: | ||
| for link in input_node.links: |
There was a problem hiding this comment.
We should not just assume the renderlayers node is directly connected to the compositor node - I think we should traverse upstream completely and get all R_LAYERS nodes that are upstream to be evaluated for this comp node to render, etc.
There was a problem hiding this comment.
We can improve the logic to check if the top parent of the trees is the viewlayers node.
| # from ayon_blender.api import plugin | ||
|
|
||
|
|
||
| # class ValidateRenderlayerActive(plugin.BlenderInstancePlugin): |
There was a problem hiding this comment.
This should likely be a ContextPlugin and consider all active render instances at once. The renderlayers that should be active for rendering should be the combined ones that are used somewhere as input to all enabled Compositor Output Nodes, etc.
| return [ | ||
| EnumDef( | ||
| "viewlayers", | ||
| label="View Layers to be Rendered", | ||
| multiselection=True, | ||
| items=items, | ||
| tooltip="Selected view layers to include in the render", | ||
| ) | ||
| ] |
There was a problem hiding this comment.
Is this actually something the user would 'select' per instance? Isn't the view layers that are relevant to a compositor file output node just the renderlayer nodes that are inputs to it in some way? I'm a bit confused here.
The way I understand:
- Blender has view layers, the equivalent to renderlayers.
- In Compositor, these are exposed through Renderlayer nodes which provide the outputs per View Layer.
- We track Compositor Output File nodes on render submissions, just the files that this outputs.
- To know which view layers need to be active, is just to find all view layers upstream from the Compositor File Output node to see which affect this output in any way. That's the
instance.data["viewlayers"].
I'm a bit confused why it's an attribute def if the node graph itself defines it?
|
@BigRoy I have made some traverse functions to check on composite output node. |
… all viewlayers for enabled output nodes
…positor node is disable
…positor node is disable
…3--Render-only-relevant-view-layers-for-enabled-compositor-output-file-nodes
Changelog Description
This PR is to propagate the active state of viewlayer node to align with the one from file output node. User can enable/disable file output node, it would also disable the relevant viewlayer nodes which are part of the input connections to it.
Resolve #243
Additional review information
n/a
Testing notes: