[Bf-blender-cvs] [6b00df11055] master: Cleanup: shadow warning

Campbell Barton noreply at git.blender.org
Wed May 26 17:55:31 CEST 2021


Commit: 6b00df110552c3b54e6bfcc1247886f015d83c0c
Author: Campbell Barton
Date:   Thu May 27 01:30:52 2021 +1000
Branches: master
https://developer.blender.org/rB6b00df110552c3b54e6bfcc1247886f015d83c0c

Cleanup: shadow warning

Move reproject_type into an extern, to avoid declaring multiple times.

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

M	source/blender/editors/gpencil/gpencil_bake_animation.c
M	source/blender/editors/gpencil/gpencil_intern.h
M	source/blender/editors/gpencil/gpencil_mesh.c

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

diff --git a/source/blender/editors/gpencil/gpencil_bake_animation.c b/source/blender/editors/gpencil/gpencil_bake_animation.c
index 6063594826e..30ebc9189c5 100644
--- a/source/blender/editors/gpencil/gpencil_bake_animation.c
+++ b/source/blender/editors/gpencil/gpencil_bake_animation.c
@@ -59,6 +59,26 @@
 
 #include "gpencil_intern.h"
 
+const EnumPropertyItem rna_gpencil_reproject_type_items[] = {
+    {GP_REPROJECT_KEEP, "KEEP", 0, "No Reproject", ""},
+    {GP_REPROJECT_FRONT, "FRONT", 0, "Front", "Reproject the strokes using the X-Z plane"},
+    {GP_REPROJECT_SIDE, "SIDE", 0, "Side", "Reproject the strokes using the Y-Z plane"},
+    {GP_REPROJECT_TOP, "TOP", 0, "Top", "Reproject the strokes using the X-Y plane"},
+    {GP_REPROJECT_VIEW,
+     "VIEW",
+     0,
+     "View",
+     "Reproject the strokes to end up on the same plane, as if drawn from the current "
+     "viewpoint "
+     "using 'Cursor' Stroke Placement"},
+    {GP_REPROJECT_CURSOR,
+     "CURSOR",
+     0,
+     "Cursor",
+     "Reproject the strokes using the orientation of 3D cursor"},
+    {0, NULL, 0, NULL, NULL},
+};
+
 /* Check frame_end is always > start frame! */
 static void gpencil_bake_set_frame_end(struct Main *UNUSED(main),
                                        struct Scene *UNUSED(scene),
@@ -314,8 +334,8 @@ static int gpencil_bake_grease_pencil_animation_exec(bContext *C, wmOperator *op
           gps->mat_nr = BKE_gpencil_object_material_index_get(ob_gpencil, ma_src);
 
           /* Update point location to new object space. */
-          for (int i = 0; i < gps->totpoints; i++) {
-            bGPDspoint *pt = &gps->points[i];
+          for (int j = 0; j < gps->totpoints; j++) {
+            bGPDspoint *pt = &gps->points[j];
             mul_m4_v3(matrix, &pt->x);
             mul_m4_v3(invmat, &pt->x);
           }
@@ -419,5 +439,10 @@ void GPENCIL_OT_bake_grease_pencil_animation(wmOperatorType *ot)
   RNA_def_int(
       ot->srna, "frame_target", 1, 1, 100000, "Target Frame", "Destination frame", 1, 100000);
 
-  RNA_def_enum(ot->srna, "project_type", reproject_type, GP_REPROJECT_KEEP, "Projection Type", "");
+  RNA_def_enum(ot->srna,
+               "project_type",
+               rna_gpencil_reproject_type_items,
+               GP_REPROJECT_KEEP,
+               "Projection Type",
+               "");
 }
diff --git a/source/blender/editors/gpencil/gpencil_intern.h b/source/blender/editors/gpencil/gpencil_intern.h
index 665401e8fee..0e8fdc3c375 100644
--- a/source/blender/editors/gpencil/gpencil_intern.h
+++ b/source/blender/editors/gpencil/gpencil_intern.h
@@ -752,24 +752,6 @@ struct GP_EditableStrokes_Iter {
   (void)0
 
 /* Reused items for bake operators. */
-static const EnumPropertyItem reproject_type[] = {
-    {GP_REPROJECT_KEEP, "KEEP", 0, "No Reproject", ""},
-    {GP_REPROJECT_FRONT, "FRONT", 0, "Front", "Reproject the strokes using the X-Z plane"},
-    {GP_REPROJECT_SIDE, "SIDE", 0, "Side", "Reproject the strokes using the Y-Z plane"},
-    {GP_REPROJECT_TOP, "TOP", 0, "Top", "Reproject the strokes using the X-Y plane"},
-    {GP_REPROJECT_VIEW,
-     "VIEW",
-     0,
-     "View",
-     "Reproject the strokes to end up on the same plane, as if drawn from the current "
-     "viewpoint "
-     "using 'Cursor' Stroke Placement"},
-    {GP_REPROJECT_CURSOR,
-     "CURSOR",
-     0,
-     "Cursor",
-     "Reproject the strokes using the orientation of 3D cursor"},
-    {0, NULL, 0, NULL, NULL},
-};
+extern const EnumPropertyItem rna_gpencil_reproject_type_items[];
 
 /* ****************************************************** */
diff --git a/source/blender/editors/gpencil/gpencil_mesh.c b/source/blender/editors/gpencil/gpencil_mesh.c
index e85221fba8c..55468dffab0 100644
--- a/source/blender/editors/gpencil/gpencil_mesh.c
+++ b/source/blender/editors/gpencil/gpencil_mesh.c
@@ -472,5 +472,10 @@ void GPENCIL_OT_bake_mesh_animation(wmOperatorType *ot)
   RNA_def_int(
       ot->srna, "frame_target", 1, 1, 100000, "Target Frame", "Destination frame", 1, 100000);
 
-  RNA_def_enum(ot->srna, "project_type", reproject_type, GP_REPROJECT_VIEW, "Projection Type", "");
+  RNA_def_enum(ot->srna,
+               "project_type",
+               rna_gpencil_reproject_type_items,
+               GP_REPROJECT_VIEW,
+               "Projection Type",
+               "");
 }



More information about the Bf-blender-cvs mailing list