[Bf-blender-cvs] [f1eb86c458f] master: GPencil: Rename old color operators to material

Antonio Vazquez noreply at git.blender.org
Tue Mar 17 18:29:40 CET 2020


Commit: f1eb86c458f256d983fbb553be07b509dbdd0714
Author: Antonio Vazquez
Date:   Tue Mar 17 18:29:18 2020 +0100
Branches: master
https://developer.blender.org/rBf1eb86c458f256d983fbb553be07b509dbdd0714

GPencil: Rename old color operators to material

The color was used in old version when palettes were used, but now all are materials

===================================================================

M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	release/scripts/startup/bl_ui/properties_material_gpencil.py
M	source/blender/editors/gpencil/gpencil_data.c
M	source/blender/editors/gpencil/gpencil_intern.h
M	source/blender/editors/gpencil/gpencil_ops.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index 95997b48680..64d4b6e2d4a 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -605,7 +605,7 @@ class GreasePencilMaterialsPanel:
 
             col.separator()
 
-            col.menu("GPENCIL_MT_color_context_menu", icon='DOWNARROW_HLT', text="")
+            col.menu("GPENCIL_MT_material_context_menu", icon='DOWNARROW_HLT', text="")
 
             if is_sortable:
                 col.separator()
@@ -616,8 +616,8 @@ class GreasePencilMaterialsPanel:
                 col.separator()
 
                 sub = col.column(align=True)
-                sub.operator("gpencil.color_isolate", icon='RESTRICT_VIEW_ON', text="").affect_visibility = True
-                sub.operator("gpencil.color_isolate", icon='LOCKED', text="").affect_visibility = False
+                sub.operator("gpencil.material_isolate", icon='RESTRICT_VIEW_ON', text="").affect_visibility = True
+                sub.operator("gpencil.material_isolate", icon='LOCKED', text="").affect_visibility = False
 
             if show_full_ui:
                 row = layout.row()
diff --git a/release/scripts/startup/bl_ui/properties_material_gpencil.py b/release/scripts/startup/bl_ui/properties_material_gpencil.py
index 56201b29e7f..6dff706e839 100644
--- a/release/scripts/startup/bl_ui/properties_material_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_material_gpencil.py
@@ -27,21 +27,21 @@ from bl_ui.properties_grease_pencil_common import (
 )
 
 
-class GPENCIL_MT_color_context_menu(Menu):
+class GPENCIL_MT_material_context_menu(Menu):
     bl_label = "Material Specials"
 
     def draw(self, _context):
         layout = self.layout
 
-        layout.operator("gpencil.color_reveal", icon='RESTRICT_VIEW_OFF', text="Show All")
-        layout.operator("gpencil.color_hide", icon='RESTRICT_VIEW_ON', text="Hide Others").unselected = True
+        layout.operator("gpencil.material_reveal", icon='RESTRICT_VIEW_OFF', text="Show All")
+        layout.operator("gpencil.material_hide", icon='RESTRICT_VIEW_ON', text="Hide Others").unselected = True
 
         layout.separator()
 
-        layout.operator("gpencil.color_lock_all", icon='LOCKED', text="Lock All")
-        layout.operator("gpencil.color_unlock_all", icon='UNLOCKED', text="UnLock All")
+        layout.operator("gpencil.material_lock_all", icon='LOCKED', text="Lock All")
+        layout.operator("gpencil.material_unlock_all", icon='UNLOCKED', text="UnLock All")
 
-        layout.operator("gpencil.stroke_lock_color", text="Lock Unselected")
+        layout.operator("gpencil.material_lock_unused", text="Lock Unselected")
         layout.operator("gpencil.lock_layer", text="Lock Unused")
 
         layout.separator()
@@ -261,7 +261,7 @@ class MATERIAL_PT_gpencil_material_presets(PresetPanel, Panel):
 
 classes = (
     GPENCIL_UL_matslots,
-    GPENCIL_MT_color_context_menu,
+    GPENCIL_MT_material_context_menu,
     MATERIAL_PT_gpencil_slots,
     MATERIAL_PT_gpencil_preview,
     MATERIAL_PT_gpencil_material_presets,
diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c
index e5d332a86de..13e1be329c7 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -1599,7 +1599,7 @@ void GPENCIL_OT_stroke_change_color(wmOperatorType *ot)
 
 /* ******************* Lock color of non selected Strokes colors ************************** */
 
-static int gp_stroke_lock_color_exec(bContext *C, wmOperator *UNUSED(op))
+static int gp_material_lock_unsused_exec(bContext *C, wmOperator *UNUSED(op))
 {
   bGPdata *gpd = ED_gpencil_data_get_active(C);
 
@@ -1655,15 +1655,15 @@ static int gp_stroke_lock_color_exec(bContext *C, wmOperator *UNUSED(op))
   return OPERATOR_FINISHED;
 }
 
-void GPENCIL_OT_stroke_lock_color(wmOperatorType *ot)
+void GPENCIL_OT_material_lock_unused(wmOperatorType *ot)
 {
   /* identifiers */
-  ot->name = "Lock Unused Colors";
-  ot->idname = "GPENCIL_OT_stroke_lock_color";
-  ot->description = "Lock any color not used in any selected stroke";
+  ot->name = "Lock Unused Materials";
+  ot->idname = "GPENCIL_OT_material_lock_unused";
+  ot->description = "Lock any material not used in any selected stroke";
 
   /* api callbacks */
-  ot->exec = gp_stroke_lock_color_exec;
+  ot->exec = gp_material_lock_unsused_exec;
   ot->poll = gp_active_layer_poll;
 
   /* flags */
@@ -2757,7 +2757,7 @@ int ED_gpencil_join_objects_exec(bContext *C, wmOperator *op)
 }
 
 /* Color Handle operator */
-static bool gpencil_active_color_poll(bContext *C)
+static bool gpencil_active_material_poll(bContext *C)
 {
   Object *ob = CTX_data_active_object(C);
   if (ob && ob->data && (ob->type == OB_GPENCIL)) {
@@ -2847,7 +2847,7 @@ void GPENCIL_OT_lock_layer(wmOperatorType *ot)
 
 /* ********************** Isolate gpencil_ color **************************** */
 
-static int gpencil_color_isolate_exec(bContext *C, wmOperator *op)
+static int gpencil_material_isolate_exec(bContext *C, wmOperator *op)
 {
   bGPdata *gpd = ED_gpencil_data_get_active(C);
   Object *ob = CTX_data_active_object(C);
@@ -2929,17 +2929,17 @@ static int gpencil_color_isolate_exec(bContext *C, wmOperator *op)
   return OPERATOR_FINISHED;
 }
 
-void GPENCIL_OT_color_isolate(wmOperatorType *ot)
+void GPENCIL_OT_material_isolate(wmOperatorType *ot)
 {
   /* identifiers */
-  ot->name = "Isolate Color";
-  ot->idname = "GPENCIL_OT_color_isolate";
+  ot->name = "Isolate Material";
+  ot->idname = "GPENCIL_OT_material_isolate";
   ot->description =
-      "Toggle whether the active color is the only one that is editable and/or visible";
+      "Toggle whether the active material is the only one that is editable and/or visible";
 
   /* callbacks */
-  ot->exec = gpencil_color_isolate_exec;
-  ot->poll = gpencil_active_color_poll;
+  ot->exec = gpencil_material_isolate_exec;
+  ot->poll = gpencil_active_material_poll;
 
   /* flags */
   ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -2955,7 +2955,7 @@ void GPENCIL_OT_color_isolate(wmOperatorType *ot)
 
 /* *********************** Hide colors ******************************** */
 
-static int gpencil_color_hide_exec(bContext *C, wmOperator *op)
+static int gpencil_material_hide_exec(bContext *C, wmOperator *op)
 {
   Object *ob = CTX_data_active_object(C);
   bGPdata *gpd = (bGPdata *)ob->data;
@@ -3000,16 +3000,16 @@ static int gpencil_color_hide_exec(bContext *C, wmOperator *op)
   return OPERATOR_FINISHED;
 }
 
-void GPENCIL_OT_color_hide(wmOperatorType *ot)
+void GPENCIL_OT_material_hide(wmOperatorType *ot)
 {
   /* identifiers */
-  ot->name = "Hide Color(s)";
-  ot->idname = "GPENCIL_OT_color_hide";
-  ot->description = "Hide selected/unselected Grease Pencil colors";
+  ot->name = "Hide Material(s)";
+  ot->idname = "GPENCIL_OT_material_hide";
+  ot->description = "Hide selected/unselected Grease Pencil materials";
 
   /* callbacks */
-  ot->exec = gpencil_color_hide_exec;
-  ot->poll = gpencil_active_color_poll; /* NOTE: we need an active color to play with */
+  ot->exec = gpencil_material_hide_exec;
+  ot->poll = gpencil_active_material_poll; /* NOTE: we need an active color to play with */
 
   /* flags */
   ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -3021,7 +3021,7 @@ void GPENCIL_OT_color_hide(wmOperatorType *ot)
 
 /* ********************** Show All Colors ***************************** */
 
-static int gpencil_color_reveal_exec(bContext *C, wmOperator *UNUSED(op))
+static int gpencil_material_reveal_exec(bContext *C, wmOperator *UNUSED(op))
 {
   Object *ob = CTX_data_active_object(C);
   bGPdata *gpd = (bGPdata *)ob->data;
@@ -3056,16 +3056,16 @@ static int gpencil_color_reveal_exec(bContext *C, wmOperator *UNUSED(op))
   return OPERATOR_FINISHED;
 }
 
-void GPENCIL_OT_color_reveal(wmOperatorType *ot)
+void GPENCIL_OT_material_reveal(wmOperatorType *ot)
 {
   /* identifiers */
-  ot->name = "Show All Colors";
-  ot->idname = "GPENCIL_OT_color_reveal";
-  ot->description = "Unhide all hidden Grease Pencil colors";
+  ot->name = "Show All Materials";
+  ot->idname = "GPENCIL_OT_material_reveal";
+  ot->description = "Unhide all hidden Grease Pencil materials";
 
   /* callbacks */
-  ot->exec = gpencil_color_reveal_exec;
-  ot->poll = gpencil_active_color_poll;
+  ot->exec = gpencil_material_reveal_exec;
+  ot->poll = gpencil_active_material_poll;
 
   /* flags */
   ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -3073,7 +3073,7 @@ void GPENCIL_OT_color_reveal(wmOperatorType *ot)
 
 /* ***************** Lock/Unlock All colors ************************ */
 
-static int gpencil_color_lock_all_exec(bContext *C, wmOperator *UNUSED(op))
+static int gpencil_material_lock_all_exec(bContext *C, wmOperator *UNUSED(op))
 {
 
   Object *ob = CTX_data_active_object(C);
@@ -3109,17 +3109,17 @@ static int gpencil_color_lock_all_exec(bContext *C, wmOperator *UNUSED(op))
   return OPERATOR_FINISHED;
 }
 
-void GPENCIL_OT_color_lock_all(wmOperatorType *ot)
+void GPENCIL_OT_material_lock_all(wmOperatorType *ot)
 {
   /* identifiers */
-  ot->name = "Lock All Colors";
-  ot->idname = "GPENCIL_OT_color_lock_all";
+  ot->name = "Lock All Materials";
+  ot->idname = "GPENCIL_OT_material_lock_all";
   ot->description =
-      "Lock all Grease Pencil colors to prevent them from being accidentally modified";
+      "Lock all Grease Pencil materials to prevent them from being accidentally modified";
 
   /* callbacks */
-  ot->exec = gpencil_color_lock_all_exec;
-  ot->poll = gpencil_active_color_poll;
+  ot->exec = gpencil_material_lock_all_exec;
+  ot->poll = gpencil_active_material_poll;
 
   /* flags */
   ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -3127,7 +3127,7 @@ void GPENCIL_OT_color_lock_all(wmOperatorType *ot)
 
 /* -------------------------- */
 
-static int gpencil_color_unlock_all_exec(bContext *C, wmOperator *UNUSED(op))
+static int gpencil_material_unlock_all_exec(bContext *C, wmOperator *UNUSED(op))
 {
   Object *ob = CTX_data_active_object(C);
   bGPdata *gpd = (bGPdata *)ob->dat

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list