Skip to content

Commit

Permalink
Add R, G, and B icon overlays for vertex color and image, but only fu…
Browse files Browse the repository at this point in the history
…nctional for vertex color mask at the moment
  • Loading branch information
ucupumar committed Nov 12, 2024
1 parent 8c5cf70 commit daab1e9
Show file tree
Hide file tree
Showing 19 changed files with 19 additions and 12 deletions.
Binary file added icons/dark/b_image_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/dark/b_vertex_color_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/dark/g_image_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/dark/g_vertex_color_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/dark/r_image_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/dark/r_vertex_color_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/legacy/b_image_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/legacy/b_vertex_color_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/legacy/g_image_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/legacy/g_vertex_color_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/legacy/r_image_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/legacy/r_vertex_color_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/light/b_image_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/light/b_vertex_color_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/light/g_image_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/light/g_vertex_color_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/light/r_image_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/light/r_vertex_color_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 19 additions & 12 deletions ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
from . import lib, Modifier, MaskModifier, UDIM
from .common import *

RGBA_CHANNEL_PREFIX = {
'ALPHA' : 'alpha_',
'R' : 'r_',
'G' : 'g_',
'B' : 'b_',
}

def update_yp_ui():

# Get active yp node
Expand Down Expand Up @@ -2280,12 +2287,12 @@ def draw_layer_masks(context, layout, layer):

if mask.enable:
if mask.type == 'IMAGE':
if mask.source_input == 'ALPHA':
row.prop(mask, 'active_edit', text='', toggle=True, icon_value=lib.get_icon('alpha_image'))
if mask.source_input in {'ALPHA', 'R', 'G', 'B'}:
row.prop(mask, 'active_edit', text='', toggle=True, icon_value=lib.get_icon(RGBA_CHANNEL_PREFIX[mask.source_input]+'image'))
else: row.prop(mask, 'active_edit', text='', toggle=True, icon_value=lib.get_icon('image'))
elif mask.type == 'VCOL':
if mask.source_input == 'ALPHA':
row.prop(mask, 'active_edit', text='', toggle=True, icon_value=lib.get_icon('alpha_vertex_color'))
if mask.source_input in {'ALPHA', 'R', 'G', 'B'}:
row.prop(mask, 'active_edit', text='', toggle=True, icon_value=lib.get_icon(RGBA_CHANNEL_PREFIX[mask.source_input]+'vertex_color'))
else: row.prop(mask, 'active_edit', text='', toggle=True, icon_value=lib.get_icon('vertex_color'))
elif mask.type == 'HEMI':
row.prop(mask, 'active_edit', text='', toggle=True, icon_value=lib.get_icon('hemi'))
Expand Down Expand Up @@ -3915,13 +3922,13 @@ def draw_item(self, context, layout, data, item, icon, active_data, active_propn
#if not src.image.preview: src.image.preview_ensure()
row.label(text='', icon_value=src.image.preview.icon_id)
else:
if m.source_input == 'ALPHA':
row.label(text='', icon_value=lib.get_icon('alpha_image'))
if m.source_input in {'ALPHA', 'R', 'G', 'B'}:
row.label(text='', icon_value=lib.get_icon(RGBA_CHANNEL_PREFIX[m.source_input]+'image'))
else: row.label(text='', icon_value=lib.get_icon('image'))
elif m.type == 'VCOL':
active_vcol_mask = m
if m.source_input == 'ALPHA':
row.label(text='', icon_value=lib.get_icon('alpha_vertex_color'))
if m.source_input in {'ALPHA', 'R', 'G', 'B'}:
row.label(text='', icon_value=lib.get_icon(RGBA_CHANNEL_PREFIX[m.source_input]+'vertex_color'))
else: row.label(text='', icon_value=lib.get_icon('vertex_color'))
elif m.type == 'HEMI':
row.label(text='', icon_value=lib.get_icon('hemi'))
Expand All @@ -3944,12 +3951,12 @@ def draw_item(self, context, layout, data, item, icon, active_data, active_propn
#if not src.image.preview: src.image.preview_ensure()
row.prop(m, 'active_edit', text='', emboss=False, icon_value=src.image.preview.icon_id)
else:
if m.source_input == 'ALPHA':
row.prop(m, 'active_edit', text='', emboss=False, icon_value=lib.get_icon('alpha_image'))
if m.source_input in {'ALPHA', 'R', 'G', 'B'}:
row.prop(m, 'active_edit', text='', emboss=False, icon_value=lib.get_icon(RGBA_CHANNEL_PREFIX[m.source_input]+'image'))
else: row.prop(m, 'active_edit', text='', emboss=False, icon_value=lib.get_icon('image'))
elif m.type == 'VCOL':
if m.source_input == 'ALPHA':
row.prop(m, 'active_edit', text='', emboss=False, icon_value=lib.get_icon('alpha_vertex_color'))
if m.source_input in {'ALPHA', 'R', 'G', 'B'}:
row.prop(m, 'active_edit', text='', emboss=False, icon_value=lib.get_icon(RGBA_CHANNEL_PREFIX[m.source_input]+'vertex_color'))
else: row.prop(m, 'active_edit', text='', emboss=False, icon_value=lib.get_icon('vertex_color'))
elif m.type == 'HEMI':
row.prop(m, 'active_edit', text='', emboss=False, icon_value=lib.get_icon('hemi'))
Expand Down

0 comments on commit daab1e9

Please sign in to comment.