GPUOpen-LibrariesAndSDKs / RadeonProRenderBlenderAddon

This hardware-agnostic rendering plug-in for Blender uses accurate ray-tracing technology to produce images and animations of your scenes, and provides real-time interactive rendering and continuous adjustment of effects.
https://gpuopen.com/radeon-prorender-suite/
Apache License 2.0
480 stars 56 forks source link

Reject other renderer Material Outputs (#615) #616

Closed jombo23 closed 3 months ago

jombo23 commented 1 year ago

PURPOSE

This PR makes RPR reject material output nodes from other renderers. (see #615 )

EFFECT OF CHANGE

RPR will no longer grab ShaderNodeOutputMaterial nodes with targets set to other rendering engines. This enables users to have materials with different sets of node paths for different renderers.

TECHNICAL STEPS

The conditions for locating a material output node were changed from; node.bl_idname == 'ShaderNodeOutputMaterial' and node.is_active_output

to node.bl_idname == 'ShaderNodeOutputMaterial' and node.target == 'ALL'

so that material outputs for other renderers are ignored.

NOTES FOR REVIEWERS

I am not sure why "is_active_output" was originally on here, but from my testing, it seems irrelevant, and messes up the condition of the target renderer, as if nodes get reordered from user interaction, a node can be "inactive" but still be completely valid, and the proper path.

In my testing I have yet to come across a scenario where this breaks anything.