diff --git a/CHANGELOG.md b/CHANGELOG.md index ddc6346..44741a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +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` + 1.9.1 - fix: add error handling on palette linker when blend_path isn't valid anymore diff --git a/OP_palettes_linker.py b/OP_palettes_linker.py index c122c71..46c2093 100644 --- a/OP_palettes_linker.py +++ b/OP_palettes_linker.py @@ -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: diff --git a/__init__.py b/__init__.py index c62a53f..fb5bc0d 100755 --- a/__init__.py +++ b/__init__.py @@ -15,7 +15,7 @@ bl_info = { "name": "GP toolbox", "description": "Tool set for Grease Pencil in animation production", "author": "Samuel Bernou, Christophe Seux", -"version": (1, 9, 1), +"version": (1, 9, 2), "blender": (2, 91, 0), "location": "Sidebar (N menu) > Gpencil > Toolbox / Gpencil properties", "warning": "", @@ -190,6 +190,11 @@ class GPTB_prefs(bpy.types.AddonPreferences): default=True, ) + mat_link_exclude : StringProperty( + name="Materials Link Exclude", + description="List of material name to exclude when using palette linker (separate multiple value with comma, ex: line, rough)", + default="line,", maxlen=0) + use_env_brushes : BoolProperty( name="Use Project Brushes", description="Load the brushes path in environnement at startup (key 'BRUSHES')", @@ -381,6 +386,8 @@ class GPTB_prefs(bpy.types.AddonPreferences): subbox.prop(self, 'palette_path') subbox.prop(self, 'warn_base_palette') + subbox.prop(self, 'mat_link_exclude') + ## Brushes subbox.prop(self, 'use_env_brushes', text='Use Brushes Environnement Path') subbox.prop(self, 'brush_path')