[Bf-blender-cvs] [d0ba75544a5] modifier-panels-ui: Miscellaneous cleanup

Hans Goudey noreply at git.blender.org
Fri Apr 3 23:47:18 CEST 2020


Commit: d0ba75544a529b72062ed9c6e5d1272cb32e2d0e
Author: Hans Goudey
Date:   Fri Apr 3 16:17:16 2020 -0500
Branches: modifier-panels-ui
https://developer.blender.org/rBd0ba75544a529b72062ed9c6e5d1272cb32e2d0e

Miscellaneous cleanup

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

M	source/blender/editors/object/object_modifier.c
M	source/blender/editors/screen/area.c

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

diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index a9f37bccb2e..c816609c5e0 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -488,7 +488,7 @@ bool ED_object_modifier_move_to_index(ReportList *reports,
                                       const int index)
 {
   BLI_assert(md != NULL);
-  BLI_assert(index > 0);
+  BLI_assert(index >= 0);
   if (index >= BLI_listbase_count(&ob->modifiers)) {
     BKE_report(reports, RPT_WARNING, "Cannot move modifier beyond the end of the stack");
     return false;
@@ -1397,7 +1397,7 @@ static int OBJECT_OT_modifier_move_to_index_exec(bContext *C, wmOperator *op)
 {
   Object *ob = ED_object_active_context(C);
   ModifierData *md = edit_modifier_property_get(op, ob, 0);
-  int index = RNA_enum_get(op->ptr, "index");
+  int index = RNA_int_get(op->ptr, "index");
 
   if (!ED_object_modifier_move_to_index(op->reports, ob, md, index)) {
     return OPERATOR_CANCELLED;
@@ -1423,12 +1423,6 @@ static int OBJECT_OT_modifier_move_to_index_invoke(bContext *C,
 
 void OBJECT_OT_modifier_move_to_index(wmOperatorType *ot)
 {
-  static const EnumPropertyItem modifier_active_move[] = {
-      {-1, "UP", 0, "Up", ""},
-      {1, "DOWN", 0, "Down", ""},
-      {0, NULL, 0, NULL, NULL},
-  };
-
   ot->name = "Move Active Modifier to Index";
   ot->description = "Move the active modifier to an index in the stack";
   ot->idname = "OBJECT_OT_modifier_move_to_index";
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 194ef903526..237a619b454 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -2575,12 +2575,12 @@ void ED_region_panels_layout_ex(const bContext *C,
   /* set view2d view matrix  - UI_block_begin() stores it */
   UI_view2d_view_ortho(v2d);
 
-  bool has_always_recreate_panel = false;
+  bool has_recreate_panel = false;
   for (LinkNode *pt_link = panel_types_stack; pt_link; pt_link = pt_link->next) {
     PanelType *pt = pt_link->link;
 
     if (pt->flag & PANELTYPE_RECREATE) {
-      has_always_recreate_panel = true;
+      has_recreate_panel = true;
       continue;
     }
     Panel *panel = UI_panel_find_by_type(&region->panels, pt);
@@ -2593,7 +2593,7 @@ void ED_region_panels_layout_ex(const bContext *C,
     ed_panel_draw(C, sa, region, &region->panels, pt, panel, w, em, vertical);
   }
 
-  if (has_always_recreate_panel) {
+  if (has_recreate_panel) {
     for (Panel *panel = region->panels.first; panel; panel = panel->next) {
       if (panel->type != NULL) { /* Some panels don't have a type.. */
         if (panel->type->flag & PANELTYPE_RECREATE) {



More information about the Bf-blender-cvs mailing list