[Bf-blender-cvs] [4f5c607622f] modifier-panels-ui: Resolve crash when switching to grease pencil object

Hans Goudey noreply at git.blender.org
Fri Apr 10 21:30:39 CEST 2020


Commit: 4f5c607622f344c3129fca206014cb43b30dc84b
Author: Hans Goudey
Date:   Fri Apr 10 14:30:32 2020 -0500
Branches: modifier-panels-ui
https://developer.blender.org/rB4f5c607622f344c3129fca206014cb43b30dc84b

Resolve crash when switching to grease pencil object

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

M	source/blender/modifiers/intern/MOD_ui_common.c

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

diff --git a/source/blender/modifiers/intern/MOD_ui_common.c b/source/blender/modifiers/intern/MOD_ui_common.c
index 2af9f2065cd..72ec7038305 100644
--- a/source/blender/modifiers/intern/MOD_ui_common.c
+++ b/source/blender/modifiers/intern/MOD_ui_common.c
@@ -49,12 +49,14 @@
 #include "MOD_ui_common.h" /* Self include */
 
 /**
- * HANS-TODO: Implement poll function. Should depend on the show_ui modifier property.
- *            But the modifier pointer is in the Panel, not the PanelType...
+ * Poll function so these modifier panels don't show for other object types with modifiers (only
+ * grease pencil currently).
  */
-static bool modifier_ui_poll(const bContext *UNUSED(C), PanelType *UNUSED(pt))
+static bool modifier_ui_poll(const bContext *C, PanelType *UNUSED(pt))
 {
-  return true;
+  Object *ob = CTX_data_active_object(C);
+
+  return (ob != NULL) && (ob->type != OB_GPENCIL);
 }
 
 /* -------------------------------------------------------------------- */



More information about the Bf-blender-cvs mailing list