less flashy color on render layer node color - eye care update

1.8.7

- changed: Layer `channel_colors` have _value component_ clamped to 0.65 when transfered to compo node (eye care update)
main
pullusb 2024-10-01 17:16:44 +02:00
parent e67adcb3f7
commit d6a102b044
3 changed files with 14 additions and 4 deletions

View File

@ -14,6 +14,10 @@ Activate / deactivate layer opacity according to prefix
Activate / deactivate all masks using MA layers
-->
1.8.7
- changed: Layer `channel_colors` have _value component_ clamped to 0.65 when transfered to compo node to limit color flashyness (eye care update)
1.8.6
- changed: removed mask terms from exclude export list `MA, MASK, mask, MSK, msk` (still excluded when opacity is at 0)

View File

@ -2,7 +2,7 @@ bl_info = {
"name": "GP Render",
"description": "Organise export of gp layers through compositor output",
"author": "Samuel Bernou",
"version": (1, 8, 6),
"version": (1, 8, 7),
"blender": (3, 0, 0),
"location": "View3D",
"warning": "",

View File

@ -1,5 +1,5 @@
import bpy
from mathutils import Vector
from mathutils import Vector, Color
from . import fn
def add_rlayer(layer_name, scene=None, node_scene=None, location=None, color=None, node_name=None, width=400):
@ -317,6 +317,12 @@ def connect_render_layer(rlayer, ng=None, out=None, frame=None,
return ng, out
def clamp_color_value(color, clamp_value=0.65) -> Color:
'''Return Color instance with clamped value component'''
color = Color(color)
color.v = min(color.v, clamp_value)
return color
def get_set_viewlayer_from_gp(ob, l, scene=None, node_scene=None,
base_path=None, file_slot=None, layer_slot=None):
'''setup ouptut from passed gp obj > layer
@ -434,7 +440,7 @@ def get_set_viewlayer_from_gp(ob, l, scene=None, node_scene=None,
# use same color as layer
if fn.has_channel_color(l):
cp.use_custom_color = True
cp.color = l.channel_color
cp.color = clamp_color_value(l.channel_color)
connect_render_layer(cp, frame=frame,
base_path=base_path, file_slot=file_slot, layer_slot=layer_slot)
@ -455,7 +461,7 @@ def get_set_viewlayer_from_gp(ob, l, scene=None, node_scene=None,
if fn.has_channel_color(l):
cp.use_custom_color = True
cp.color = l.channel_color
cp.color = clamp_color_value(l.channel_color)
frame = next((f for f in nodes if f.type == 'FRAME' and f.label == ob.name), None)
rl_nodes = frame_dic[frame.label] # get nodes from