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

The AOVs from render layer nodes always connected to the Output File Node #82

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from

Conversation

moonyuet
Copy link
Member

@moonyuet moonyuet commented Dec 5, 2024

Changelog Description

This PR is to make sure the AOVs from render layer nodes always connected to the Output File Node.
Resolve #37

Additional review information

n/a

Testing notes:

  1. Add some render settings in Ayon server
  2. Create Render Instance with your camera
  3. Publish

@moonyuet moonyuet added the type: bug Something isn't working label Dec 5, 2024
@moonyuet moonyuet requested review from BigRoy and LiborBatek December 5, 2024 13:49
@moonyuet moonyuet self-assigned this Dec 5, 2024
Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does work when single Viewlayer present (render layer but in Blender terms)

the graph is correct when just one layer present>
Screenshot 2024-12-05 155438

but create Render fails and doesnt connect to file output node for the second Viewlayer as seen below (it fails and wrongly connects to file output node)...

Screenshot 2024-12-05 155636

@LiborBatek
Copy link
Member

LiborBatek commented Dec 5, 2024

Ideally it should be behaving like this mockup I created manually:

Screenshot 2024-12-05 160404

and it does follow ayon-blender addon settings:
in my case:
image

@moonyuet moonyuet requested a review from LiborBatek December 9, 2024 16:06
@LiborBatek
Copy link
Member

LiborBatek commented Dec 9, 2024

@moonyuet it still does not work and to me it seems that it does not take the ViewLayers present into account at the collecting phase as it should propagate AOVs set in the blender addon settings and turn those on automatically but this just happens on the default first ViewLayer and not any other present e.g, Layer2 in my case...

Ideally we should first collect any ViewLayers,create Render Layers node first for respective Viewlayer (as there is just single node when using compositor for very first time) , then check if AOVs set according to addons setting and lastly connect those to the file output node.

Im really not aware how much of this we already have in place (in terms of code) and which parts we miss completely atm...

Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its getting better and better... now we have correct subpaths for each ViewLayer and also layer name included within filename which is good and desirable!

Now there are 2 more issues found:

  1. When having set some AOVs in the AYON addons settings, those are just propagated to the very first ViewLayer and not any other
    Screenshot 2024-12-12 143402

  2. when user does not create Scene node manually to introduce new additional ViewLayer.001 in Composite tree, AYON does not pick it up and just ignores the fact there is additional viewlayer(s) within the scene and uses just the default ViewLayer and use this for File Output node...

Screenshot 2024-12-12 143332

So if setting all manually I am able to get the desired node tree with proper outputs for any ViewLayer present in the scene... like on the following scrn:

image

And lastly (for consideration) is the limitation comming with the way we prepare AOVs via Addons settings...

as now if user have some AOVs turned on within his blender scene and triggers creation of Render instance it follows the addons settings so if no any matching AOVs present it will just remove any present AOVs - basically destroying all present AOV setups...

Screenshot 2024-12-12 144611

@LiborBatek
Copy link
Member

LiborBatek commented Dec 12, 2024

So here is example when Ayon addons settings have empty AOVs fields (to create):

image

Before:

Screenshot 2024-12-12 145003

After triggering Create > Render

Screenshot 2024-12-12 145025

We should probably think about approach that when no AOVs preconfigured, it wont force remove any existing AOV s during creation of Render instance... not destroying any user config within workfile.

@moonyuet moonyuet requested a review from LiborBatek December 16, 2024 06:26
@LiborBatek
Copy link
Member

LiborBatek commented Dec 16, 2024

My findings so far:

When defining AOVs in addons settings just the AovName(CyclesOnly) been picked up.... as seen on my following 2 scrns. The good thing is, when have it empty (aka no AOVs configured) it wont delete any scene AOVs set by user, which is great!

Screenshot 2024-12-16 141511

Screenshot 2024-12-16 141516

Another finding, when add additional ViewLayer and hit create for Render publish instance, Blender freeze and could not be operated then...seems like some crash happening (no any log tho).

Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I have made another testing round with following findings:

  1. now all AOVs got propagated from addons settings into blender once hitting create>Render

  2. unfortunatelly it also removes any existing AOVs during creation - big no no.

  3. Blender freezes if more then one Scene node present when hitting create>Render instance (only when present tho see img below)

Screenshot 2024-12-17 153002

if just single Scene node present and more than one ViewLayer present it doesnt freeze and sort of works...

Screenshot 2024-12-17 153014

there is a however issue that it multiplies even the already present Scene node which is not desirable as it mixes up connections to File Output node and results into duplicate outputs...
B3d_RenderCreation

We should check if any Scene nodes already exists in the scene...to not create redundant ones...as seen here:
Screenshot 2024-12-17 152847

@moonyuet moonyuet requested a review from LiborBatek December 18, 2024 11:38
Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now all works really well and been tested in different conditions...

single / multiple ViewLayers, present / absent AOVs and full / empty AOVs preset in Addons Settings - seem all working nicely!

If any issue then there is one questionable thing regarding the Compositing aov...as there always exists just single node tree and output.

Screenshot 2024-12-18 141257

Right now there is created input for composite for each ViewLayer which results into multiplied inputs and also empty ones (as only the first ViewLayer got connected)

We should introduce some logic and create/hook just the very first ViewLayer I guesss (it happens atm but there are also redundant other composite inputs which results into blank images and we shouldnt ideally create those at all)...cant think now if any occasion that might not be working with it...

@moonyuet moonyuet requested a review from LiborBatek December 19, 2024 09:48
Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After another testing round now there is just single Composite input into File Output node which is correct!

Also no any freeze of Blender happening if scene compositor pre occupied with multiple Scene nodes...also good!

There is only one flaw regarding the Composite AOV and that is created as an output for non default ViewLayer but for ViewLayer.001 minor flaw but we should use that default viewLayer instead...

Screenshot 2024-12-19 123203

Other than that all good!

@moonyuet moonyuet requested a review from LiborBatek December 19, 2024 16:18
Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now gives me following error after hit Create > Render

Traceback (most recent call last):
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\core_1.0.12+dev\ayon_core\pipeline\create\context.py", line 2126, in _create_with_unified_error
    result = creator.create(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\blender_0.2.7+dev\ayon_blender\plugins\create\create_render.py", line 28, in create
    prepare_rendering(collection)
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\blender_0.2.7+dev\ayon_blender\api\render_lib.py", line 422, in prepare_rendering
    aov_file_product = set_node_tree(
                       ^^^^^^^^^^^^^^
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\blender_0.2.7+dev\ayon_blender\api\render_lib.py", line 308, in set_node_tree
    output.base_path = render_product if multi_exr else str(output_path)
    ^^^^^^^^^^^^^^^^
TypeError: bpy_struct: item.attr = val: CompositorNodeOutputFile.base_path expected a string type, not list

@moonyuet moonyuet requested a review from LiborBatek December 23, 2024 11:55
Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now all seems correct and Render instance got created without any issues, also all inputs got connected into File Output node and only main aka default ViewLayer got outputted its Composite so all good on this front too..

Screenshot 2024-12-30 112158

there is one thing worth noting and that is Repair action for Output folder mess up the node tree and disconnects some inputs... probably not directly related but need to be resolved otherwise the setup will be broken as soon as triggering the repair action by user.

Resulting into following (note the File Output and disconnected inputs):

Screenshot 2024-12-30 112726

@moonyuet moonyuet requested a review from LiborBatek January 1, 2025 06:07
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

Successfully merging this pull request may close these issues.

AY-6601_Blender: AOVs and single channel format missing rendered frames
2 participants