mat exclude by name for palette link
1.9.2 - feat: Palette linker has a name exclusion list in preferences - Avoid linking some material that are prefered local to file - Default item in list : `line`
This commit is contained in:
@@ -50,6 +50,9 @@ class GPTB_OT_import_obj_palette(Operator):
|
||||
self.report({'ERROR'}, 'Need to have at least one GP object selected in scene')
|
||||
return {"CANCELLED"}
|
||||
|
||||
prefs = utils.get_addon_prefs()
|
||||
exclusions = [name.strip() for name in prefs.mat_link_exclude.split(',')] if prefs.mat_link_exclude else []
|
||||
|
||||
# Avoid looping on linked duplicate
|
||||
objs = []
|
||||
datas = []
|
||||
@@ -117,7 +120,9 @@ class GPTB_OT_import_obj_palette(Operator):
|
||||
for ob in objs:
|
||||
for src_ob in linked_objs:
|
||||
for src_mat in src_ob.data.materials:
|
||||
print(f'- {src_mat.name}')
|
||||
## filter mat
|
||||
if src_mat.name in exclusions:
|
||||
continue
|
||||
mat = ob.data.materials.get(src_mat.name)
|
||||
|
||||
if mat and mat.library == src_mat.library:
|
||||
|
||||
Reference in New Issue
Block a user