Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2020-05-11 17:18:08 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-05-11 17:28:15 +0300
commitd63956d0e51c1b5a65941b918d0e055b1c14fa4b (patch)
tree1824ff8bb76f0fe2b50a33927f01a4f4ae6178ad /release
parent870e081bcda7f8fd99f73366d22bdf372c09f054 (diff)
GPencil: Replace material name with material pointer for Modifiers filter
Before, the material name was used to filter the effect of the stroke, but after the last changes in the ID code, now it's not working. After talking with @severin, we agreed to replace the material name with a pointer. Also, this fix a design issue when the materials were linked. Related to T76594 Differential Revision: https://developer.blender.org/D7681 with some minor changes
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/properties_data_modifier.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index 29fcb06ac67..b5f087fd5ee 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -1855,7 +1855,6 @@ class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel):
# the mt.type enum is (ab)used for a lookup on function names
# ...to avoid lengthy if statements
# so each type must have a function here.
-
def gpencil_masking(self, layout, ob, md, use_vertex, use_curve=False):
gpd = ob.data
layout.separator()
@@ -1884,7 +1883,15 @@ class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel):
split = col2.split(factor=0.6)
row = split.row(align=True)
- row.prop_search(md, "material", gpd, "materials", text="", icon='SHADING_TEXTURE')
+
+ valid = md.material in (slot.material for slot in ob.material_slots) or md.material is None
+ if valid:
+ icon = 'SHADING_TEXTURE'
+ else:
+ icon = 'ERROR'
+
+ row.alert = not valid
+ row.prop_search(md, "material", gpd, "materials", text="", icon=icon)
row.prop(md, "invert_materials", text="", icon='ARROW_LEFTRIGHT')
row = split.row(align=True)