Node Wrangler: add back exposure compensation for Preview Node #105136

Closed
Damien Picard wants to merge 4 commits from pioverfour/blender-addons:dp_nw_exposure_compensation into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Showing only changes of commit 6268ab0ce8 - Show all commits

View File

@ -565,12 +565,14 @@ class NWPreviewNode(Operator, NWBase):
@staticmethod @staticmethod
def get_scene_intensity(context): def get_scene_intensity(context):
"""Calculate intensity compensation based on scene exposure""" """Calculate intensity compensation based on scene exposure"""
intensity = 1.0 # CM exposure is measured in stops/EVs (2^x)
intensity = 1.0 / (2.0 ** context.scene.view_settings.exposure)
if context.scene.render.engine == 'CYCLES' and hasattr(context.scene, 'cycles'): if context.scene.render.engine == 'CYCLES' and hasattr(context.scene, 'cycles'):
if context.scene.cycles.film_exposure == 0.0:
# Avoid divide by zero error
return 1.0
# Film exposure is a multiplier # Film exposure is a multiplier
intensity /= context.scene.cycles.film_exposure intensity /= context.scene.cycles.film_exposure
# CM exposure is measured in stops/EVs (2^x)
intensity /= 2.0 ** context.scene.view_settings.exposure
return intensity return intensity
@staticmethod @staticmethod