Page MenuHome

node_shader_utils: add possibility to override image colorspace
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Jul 3 2019, 6:38 PM.

Details

Summary

since the move from 'cycles_shader_compat' (2.79) to
'PrincipledBSDFWrapper' (2.8) we lost the ability to (automatically) set
the colorspace for imported textures. This was useful for e.g.
normalmaps to always assume 'Non-Color' data.

This adds the possibility to overide and uses this for normalmaps...

Fixes T66368

Diff Detail

Repository
rB Blender

Event Timeline

Brecht Van Lommel (brecht) requested changes to this revision.Jul 3 2019, 7:01 PM

Set image.colorspace_settings.is_data = True/False, the non-color data colorspace is not guaranteed to be named "Non-Color".

This revision now requires changes to proceed.Jul 3 2019, 7:01 PM

use colorspace setting 'is_data' instead of the 'Non-Color' name
(I've kept behaviour to only override when explicitly asked for)

This revision is now accepted and ready to land.Jul 3 2019, 7:26 PM

besides picky note below, LGTM.

release/scripts/modules/bpy_extras/node_shader_utils.py
538

Would rather use ellipsis (colorspace_is_data=...), then, it's better suited for that kind of usages than None.

646

… and then ellipsis here too, instead of None, of course :)