[Addon] Renderlayer Manager

oh my bad …damn

Wow your first try! You did amazing work i think! Im busy updating this old renderlayers to passes script. It automatically makes all the nodes and collections and works also with different viewlayers and can be used for single or separate outputs

What i find really well done is that you added that UI list, this really helps make things clear for the user. Using these is a pain in the ass! hahaha i remember the first time trying to figure that out and how to use them. Still need to check online each time i need one.

Perhaps an idea! You could allow it to be checked ON/OFF per view layer. As these are rendered separate, you can make the code switch the boolean on and off. Atleast i think that should be able to do.
But on the otherhand im no so sure, if i recall correctly. When you hit render, all the viewlayers are rendered automatically. That means we would need to hack the cycles addon to make use that boolean per viewlayer

PS wouldnt it be easier to add your UIlist in the viewlayer panel? It seems you had to copy over all of the GUI to the compositor to show all of those settings. Yet normally you set these up before you render and then you go to the compositor. To me it would make more sense to show you nice uilist tool in the viewlayer panel. This would also mean you would need to do less work each time the viewlayer panel changes. It has changed a lot in the last couple of blender version and is vey different per blender version starting from 2.80. That means you must have tons of if else app version checks in your code. Im guessing here! i have not looked at your code yet :slight_smile:

PS hope you dont mind, but is okay with you if i use you idea with that panel in this addon im updating? I find it to be eally usefull and allow for much easier switching between the view layers

couple suggestions and tips, i see you using keepachangelog? Since i found this i use this on all my addons i create, it makes for a very clear file to read what has changed. You can also make links per version using the version tag
Have a look at this example, see how the version tag is also a link

EDIT > just tested it
One thing i dont find clear or could use some work. Is when you adjust the passes, the output nodes are not updated and it also isnt visually clear that the now activated passes have been applied to the outputs. In my version im running a check to see if any of the passes have changed. This makes it clear for the user he/she needs to update the output. You implementation, if understand it correct, needs the user to click create each time you change it. Perhaps you should make 2 operators and show an “update” button as soon as something changes or once it has been setup.

My method is pehaps not vey clean. Im using a poll in the panel to check all activated booleans and see if any change. As soon as one is activated or deactivated i show a warning icon and an update button

Had another look at your code im wondering, how are you able to catch the mismatching names between the render output nodes and the enabled passes?! My issue is that the props in the viewlayer dont match the names in the render output, so running a check if they are enabled always mismatches because the name is different. In you code i see you check the outputs in the node and see if its enabled, yet i wonder how you check that?!

Hey @rombout,

thanks for checking out my addon and all your comments! I hope I can answer all your questions and don’t miss one :smiley:

Yes, like you say: Blender renders all the active viewlayers as soon as you hit render and will use the current settings of the scene properties. But maybe an application handler like bpy.app.handlers.render_write can prompt the necessary changes in the scene properties inbetween?

Yes, I alwas copied all the viewlayer panel code over :smiley: And I was already struggeling with it because of your mentioned changes since 2.80. I didn’t use version checks yet, I was releasing a new version instead :sweat_smile: But this will get out of hand at some point. But the primary reason why I didn’t put it in the viewlayer panel is that my UIList is actually not switching the active viewlayer, so the active renderlayer is not always the active viewlayer and so are the active renderlayer settings in my addon not always the settings of the active viewlayer. Furthermore this would also lead to not having the addon in one place anymore because the Create Nodes button should be staying in the compositing editor. But I have to think about it, the viewlayer panel might be a better place and the UIList could also switch the active viewlayer.

Yes, of course.

Gitlab was automatically suggesting me to create this file. But I might not use its full potential. I will take a look at the version tag links. Thanks for the advice!

Yes, having a notification for changes is a good idea. Currently you have to execute Create Nodes everytime something changes. But how do you track any changes? Are you saving all the render pass booleans in a collection property and compare them all the time in the poll function?

I get all the outputs of a renderlayer node and check the enabled property of those outputs e.g. bpy.context.scene.node_tree.nodes['View Layer-RLM'].outputs[0].enabled. I don’t have to match the names with the naming of the viewlayer properties because I am using the names of these renderlayer node outputs instead.
But it’s also on my feature list that you can use your own naming convention in the future. I will try to add that as soon as I have some time :smiley:

Yes, like you say: Blender renders all the active viewlayers as soon as you hit render and will use the current settings of the scene properties. But maybe an application handler like bpy.app.handlers.render_write can prompt the necessary changes in the scene properties inbetween?

Well i see you actually have a USE button, the camera button, to toggle it on/off. That was basicaly what i was talking about and you already have that working

Yes, I alwas copied all the viewlayer panel code over :smiley: And I was already struggeling with it because of your mentioned changes since 2.80. I didn’t use version checks yet, I was releasing a new version instead :sweat_smile: But this will get out of hand at some point. But the primary reason why I didn’t put it in the viewlayer panel is that my UIList is actually not switching the active viewlayer, so the active renderlayer is not always the active viewlayer and so are the active renderlayer settings in my addon not always the settings of the active viewlayer. Furthermore this would also lead to not having the addon in one place anymore because the Create Nodes button should be staying in the compositing editor. But I have to think about it, the viewlayer panel might be a better place and the UIList could also switch the active viewlayer.

You can actually put something in the main viewlayer panel and it will always show even when you switch. So i guess adding your UIlist would allow for much easier switching. It kinda feels like the older renderlayers uilist in pre blender 2.80

Yes, having a notification for changes is a good idea. Currently you have to execute Create Nodes everytime something changes. But how do you track any changes? Are you saving all the render pass booleans in a collection property and compare them all the time in the poll function?

What i do to check is each time the node setup is created i collect all the names into a list. Then i have a poll in the panel which checks if anything is different vs this list.

I get all the outputs of a renderlayer node and check the enabled property of those outputs e.g. bpy.context.scene.node_tree.nodes['View Layer-RLM'].outputs[0].enabled . I don’t have to match the names with the naming of the viewlayer properties because I am using the names of these renderlayer node outputs instead.
But it’s also on my feature list that you can use your own naming convention in the future. I will try to add that as soon as I have some time :smiley:

I did not know that renderlayer node outputs have an enabled property. That would make it much easier indeed. Im was working on code setup by someone else, that check the viewlayer panel and checks the booleans, but those boolean names dont match the renderlayer output node names. Quite a hustle to do check then.

EDIT
had a quick look at the enable attribute. Thats so much easier now to hook up the nodes. dang! The addon o work check for all ‘use_pass’ items in the viewlayers, stores thosem in a list then runs over them and compares them to the renderlayer node output labels/names, but thats where the issue happens. Lots of the use_pass names dont match the renderlayer node output names, so we check the name using a dict. Its feels a bit overcomplicated looking at how simple your version works actually

Did some fiddling with code and got your UIlist now working in the view layer panel. It does switch now correctly which causes the correct viewlayer passes to show when you switch in that UIlist as well

1 Like

Ah sry, I thought this was an answer to hammertime’s request about setting the film transparent and render engine properties per viewlayer. Toggling renderlayer/viewlayer on and off is possible with the camera icon.

Great, I think I will add this also to my add-on if you don’t mind.

I’m pretty sure that in one of my first versions I didn’t know either and was also using a dictionary. I stumbled upon this property by accident and it made things so much easier.

Nice! I guess I will also add it there and sync the switching of the renderlayer with the active viewlayer. My idea was to keep them separated to avoid loading the viewlayers everytime you click on another renderlayer but this might be too confusing and usually your scenes are not so huge that you would see a benefit.

So when its enabled in the output, you simply make an input in the file outnode and name that to the pass, correct?

What do you mean by “to avoid loading the viewlayers” everytime?

I got this iswitching working in the view layer panel by adding this as a function in the “update” property of the IntProperty of active_render_layer_index

def update_index(self, context):
    scn = context.scene
    idx = scn.rlm.active_renderlayer_index
    view_layers = scn.view_layers
    active_renderlayer = view_layers[idx].name
    # print('active_renderlayer %s' % active_renderlayer)
    bpy.context.window.view_layer = view_layers[active_renderlayer]

Yes, I use the .name property for the output paths if .enabled is true.

If you have a complex scene with a lot of objects or heavy geo/simulation caches and you exclude these assets/caches in other viewlayers, everytime you are switching the active viewlayer back to a more complex viewlayer, Blender will load those excluded objects/caches. That’s what I wanted to avoid but it’s maybe not so important because usually the scenes are not this complex and there are other ways to fix this issue e.g. simplify, disabling viewport visibility etc.

1 Like

ah like that, well i hardly have done any render like that if im honest. I was basically getting this other addon working again. I had to learn very quick how it was used, did not know this fact. Thanks again!

Hope the update function helps you

1 Like

Okay, here we go again. Blender 3.0 got released today and there were some ui and property changes for the viewlayer settings which results in errors for my addon again. So I decided to remove those duplicated settings from my addon ui to fix this issue for future Blender releases.
While I was at it I thought I can also add the renderlayer UI list to the viewlayer panel and thanks to @rombout’s update function the active viewlayer will switch now when you change the renderlayer in the ui list.
So if you want to use the addon on Blender 3.0, you should download version 1.3 of it on Gumroad. I will also update the documentation in the coming days.

  • (hotfix) removed all duplicated viewlayer and denoiser settings from the addon ui to fix issues with Blender internal ui and property changes in new Blender releases.
    Viewlayer and denoiser settings should be edited in the viewlayer property editor from now on.
  • (feature) renderlayer UI list is now also available in the viewlayer property editor and switching the renderlayers also switches the active viewlayer
4 Likes

Nice one!

Oooffff 3.0 i guess i need to update all my addons as well. Have tried 3.0 a single time yet.
I got quite a bunch of addons, so this will take some time :frowning:

Hi,

I hope everyone had a Merry Christmas and Happy New Year :christmas_tree: :gift: :fireworks: !

While eating christmas cookies I had some time adding new features to the addon. The latest version is now v1.4. As always you can get it here Gumroad: Renderlayer Manager.

CHANGE LOG

  • [Hotfix] Changing the viewlayer or adding a new viewlayer via the default Blender UI leads to a mismatch of the active renderlayer in the addons viewlayer UI list and the actual active viewlayer in Blender. In this case the addons viewlayer UI list will be locked now and a button ‘Set Active Viewlayer’ will appear which will set the active renderlayer to the active viewlayer again.
  • [Feature] The user can set custom renderpass names in the addon preferences now
  • [Feature[ Changes in the viewlayer settings or any changes that will affect the node tree after ‘Create Nodes’ was executed will throw a notification in the UI (thanks to @rombout for the hint :wink: )
  • [Feature] Add ‘Overwrite File Formats’ per viewlayer again
  • [Feature] Add “Write Noisy Image” property again

P.S.: No, I didn’t update the documentation yet … sry :sweat:

2 Likes

Nice work man! Curious how you solved that checker for changes. Mine was a bit of a dirty check, not sure this can be done clean.

The awesome artist and youtuber Berglmir was so kind to promote and showcase my add-on in his latest tutorial about renderlayers in Blender. So if you like to see the add-on in action, check it out (as well as his other tutorials in Blender :slight_smile: ):

@rombout I am using the same method as you told me. Poll function that creates a dictionary and compares it with a dictionary that I am creating when ‘Create Nodes’ is executed or after the user opens a new scene.

2 Likes

Ah nice! I cant remember if used a dict. Nice seeing someone promote your addon, hope this helps getting it spread more.

PS i tried the new version, i did not notice any feedback when i made changes? Did i do something wrong?
I made a setup, added the node tree and then later changed some of the passes, nothing happened?

EDIT
i was testing it in bl283, i know its for newer version. It did work but i didnt see the hint. Now at home on windows 293 i do see. AWESOME work!

The great @Valics_Lehel did another cool tutorial about exporting EXRs from Blender to Photoshop including the Renderlayer Manager.
I find it really helpful if you want to do compositing in Photoshop.
So check it out to see this nice workflow and the add-on in action:

@rombout the latest version is only working in Blender 2.92 or later. If you want to use the add-on in Blender 2.83, you have to use v1.0.

2 Likes

Yes, i might make an if else check for that error i get. I really like those new options you added :slight_smile:
So handy getting the feedback

1 Like

Hi,

new update. Latest version is v1.4.1 now and has the following changes:

  • [Fix] Renaming cryptomatte passes in the add-on preferences works now properly (reported by @Valics_Lehel)
  • [Fix] Viewlayer change notifications are also working properly in files with multiple scenes now. The notification is also displayed immediately now if something changes.
  • [Feature] New button “Add Viewlayer from Collections” in the viewlayer UI list drop-down menu. Adds new viewlayer for every existing collection below the Scene Collection and names them also automatically like those collections.

I also updated the documentation finally. Just some images are still outdated …

2 Likes