From 84e3af2090e21c7db1262a7f1b7a694ef0c5c943 Mon Sep 17 00:00:00 2001 From: greisane Date: Wed, 13 Apr 2022 21:10:11 -0300 Subject: [PATCH] Also check if panel exists in other locations --- mesh/vertex_color_mapping.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mesh/vertex_color_mapping.py b/mesh/vertex_color_mapping.py index fe53128..79c7684 100644 --- a/mesh/vertex_color_mapping.py +++ b/mesh/vertex_color_mapping.py @@ -422,10 +422,12 @@ def register(settings): bpy.types.Object.vertex_color_mapping = bpy.props.CollectionProperty( type=GRET_PG_vertex_color_mapping, ) - bpy.types.DATA_PT_vertex_colors.append(vcol_panel_draw) + if hasattr(bpy.types, "DATA_PT_vertex_colors"): + bpy.types.DATA_PT_vertex_colors.append(vcol_panel_draw) def unregister(): - bpy.types.DATA_PT_vertex_colors.remove(vcol_panel_draw) + if hasattr(bpy.types, "DATA_PT_vertex_colors"): + bpy.types.DATA_PT_vertex_colors.remove(vcol_panel_draw) del bpy.types.Object.vertex_color_mapping for cls in reversed(classes):