Changeset View
Changeset View
Standalone View
Standalone View
node_wrangler.py
| Show First 20 Lines • Show All 1,699 Lines • ▼ Show 20 Lines | def invoke(self, context, event): | ||||
| if not emission.outputs[0].links[0].to_node == materialout: | if not emission.outputs[0].links[0].to_node == materialout: | ||||
| make_links.append((emission.outputs[0], materialout.inputs[0])) | make_links.append((emission.outputs[0], materialout.inputs[0])) | ||||
| else: | else: | ||||
| make_links.append((emission.outputs[0], materialout.inputs[0])) | make_links.append((emission.outputs[0], materialout.inputs[0])) | ||||
| # Set brightness of viewer to compensate for Film and CM exposure | # Set brightness of viewer to compensate for Film and CM exposure | ||||
| if context.scene.render.engine == 'CYCLES' and hasattr(context.scene, 'cycles'): | if context.scene.render.engine == 'CYCLES' and hasattr(context.scene, 'cycles'): | ||||
| intensity = 1/context.scene.cycles.film_exposure # Film exposure is a multiplier | intensity = 1/context.scene.cycles.film_exposure # Film exposure is a multiplier | ||||
| else: | |||||
| intensity = 1 | |||||
| intensity /= pow(2, (context.scene.view_settings.exposure)) # CM exposure is measured in stops/EVs (2^x) | intensity /= pow(2, (context.scene.view_settings.exposure)) # CM exposure is measured in stops/EVs (2^x) | ||||
| emission.inputs[1].default_value = intensity | emission.inputs[1].default_value = intensity | ||||
| else: | else: | ||||
| # Output type is 'SHADER', no Viewer needed. Delete Viewer if exists. | # Output type is 'SHADER', no Viewer needed. Delete Viewer if exists. | ||||
| make_links.append((active.outputs[out_i], materialout.inputs[1 if active.outputs[out_i].name == "Volume" else 0])) | make_links.append((active.outputs[out_i], materialout.inputs[1 if active.outputs[out_i].name == "Volume" else 0])) | ||||
| for node in nodes: | for node in nodes: | ||||
| ▲ Show 20 Lines • Show All 3,149 Lines • Show Last 20 Lines | |||||