[Bf-blender-cvs] [384ccd16717] fcurve-modifier-panels: Check category before adding instanced panels to layout

Hans Goudey noreply at git.blender.org
Mon Oct 19 04:45:02 CEST 2020


Commit: 384ccd16717fccd5d41baddf8724158ebf265aff
Author: Hans Goudey
Date:   Wed Aug 12 12:42:20 2020 -0400
Branches: fcurve-modifier-panels
https://developer.blender.org/rB384ccd16717fccd5d41baddf8724158ebf265aff

Check category before adding instanced panels to layout

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

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

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

diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 58fb934ebf0..38bac3afef6 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -2658,29 +2658,35 @@ void ED_region_panels_layout_ex(const bContext *C,
   if (has_instanced_panel) {
     LISTBASE_FOREACH (Panel *, panel, &region->panels) {
       if (panel->type == NULL) {
-        continue; /* Some panels don't have a type.. */
+        continue; /* Some panels don't have a type. */
       }
-      if (panel->type->flag & PNL_INSTANCED) {
-        if (panel && UI_panel_is_dragging(panel)) {
-          /* Prevent View2d.tot rectangle size changes while dragging panels. */
-          update_tot_size = false;
-        }
-
-        /* Use a unique identifier for instanced panels, otherwise an old block for a different
-         * panel of the same type might be found. */
-        char unique_panel_str[8];
-        UI_list_panel_unique_str(panel, unique_panel_str);
-        ed_panel_draw(C,
-                      area,
-                      region,
-                      &region->panels,
-                      panel->type,
-                      panel,
-                      (panel->type->flag & PNL_DRAW_BOX) ? w_box_panel : w,
-                      em,
-                      vertical,
-                      unique_panel_str);
+      if (!(panel->type->flag & PNL_INSTANCED)) {
+        continue;
       }
+      if (use_category_tabs && panel->type->category[0] &&
+          !STREQ(category, panel->type->category)) {
+        continue;
+      }
+
+      if (panel && UI_panel_is_dragging(panel)) {
+        /* Prevent View2d.tot rectangle size changes while dragging panels. */
+        update_tot_size = false;
+      }
+
+      /* Use a unique identifier for instanced panels, otherwise an old block for a different
+       * panel of the same type might be found. */
+      char unique_panel_str[8];
+      UI_list_panel_unique_str(panel, unique_panel_str);
+      ed_panel_draw(C,
+                    area,
+                    region,
+                    &region->panels,
+                    panel->type,
+                    panel,
+                    (panel->type->flag & PNL_DRAW_BOX) ? w_box_panel : w,
+                    em,
+                    vertical,
+                    unique_panel_str);
     }
   }



More information about the Bf-blender-cvs mailing list