[Bf-blender-cvs] [301f59a8394] soc-2020-outliner: Outliner: Draw Gpencil modifiers in the tree

Nathan Craddock noreply at git.blender.org
Sat Jul 18 02:56:44 CEST 2020


Commit: 301f59a8394ede25d0388f991ab13965f2aab512
Author: Nathan Craddock
Date:   Fri Jul 17 16:00:23 2020 -0600
Branches: soc-2020-outliner
https://developer.blender.org/rB301f59a8394ede25d0388f991ab13965f2aab512

Outliner: Draw Gpencil modifiers in the tree

The outliner icon code had cases for grease pencil modifiers but the
modifiers did not actually draw.

Some icons are incorrect:
* Multiple Strokes
* Texture Mapping

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

M	source/blender/editors/space_outliner/outliner_draw.c
M	source/blender/editors/space_outliner/outliner_tree.c

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

diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index bd55c43d334..7d795acb7f8 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -2325,7 +2325,7 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te)
           GpencilModifierData *md = BLI_findlink(&ob->greasepencil_modifiers, tselem->nr);
           switch ((GpencilModifierType)md->type) {
             case eGpencilModifierType_Noise:
-              data.icon = ICON_RNDCURVE;
+              data.icon = ICON_MOD_NOISE;
               break;
             case eGpencilModifierType_Subdiv:
               data.icon = ICON_MOD_SUBSURF;
@@ -2369,6 +2369,15 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te)
             case eGpencilModifierType_Armature:
               data.icon = ICON_MOD_ARMATURE;
               break;
+            case eGpencilModifierType_Multiply:
+              data.icon = ICON_GP_MULTIFRAME_EDITING;
+              break;
+            case eGpencilModifierType_Time:
+              data.icon = ICON_MOD_TIME;
+              break;
+            case eGpencilModifierType_Texture:
+              data.icon = ICON_TEXTURE;
+              break;
 
               /* Default */
             default:
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index 40765f86865..6c12acb1f7e 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -32,6 +32,7 @@
 #include "DNA_camera_types.h"
 #include "DNA_collection_types.h"
 #include "DNA_constraint_types.h"
+#include "DNA_gpencil_modifier_types.h"
 #include "DNA_gpencil_types.h"
 #include "DNA_hair_types.h"
 #include "DNA_key_types.h"
@@ -514,6 +515,41 @@ static void outliner_add_object_contents(SpaceOutliner *soops,
     }
   }
 
+  if (!BLI_listbase_is_empty(&ob->greasepencil_modifiers)) {
+    GpencilModifierData *md;
+    TreeElement *ten_mod = outliner_add_element(soops, &te->subtree, ob, te, TSE_MODIFIER_BASE, 0);
+    int index;
+
+    ten_mod->name = IFACE_("Modifiers");
+    for (index = 0, md = ob->greasepencil_modifiers.first; md; index++, md = md->next) {
+      TreeElement *ten = outliner_add_element(
+          soops, &ten_mod->subtree, ob, ten_mod, TSE_MODIFIER, index);
+      ten->name = md->name;
+      ten->directdata = md;
+
+      if (md->type == eGpencilModifierType_Armature) {
+        outliner_add_element(soops,
+                             &ten->subtree,
+                             ((ArmatureGpencilModifierData *)md)->object,
+                             ten,
+                             TSE_LINKED_OB,
+                             0);
+      }
+      else if (md->type == eGpencilModifierType_Hook) {
+        outliner_add_element(
+            soops, &ten->subtree, ((HookGpencilModifierData *)md)->object, ten, TSE_LINKED_OB, 0);
+      }
+      else if (md->type == eGpencilModifierType_Lattice) {
+        outliner_add_element(soops,
+                             &ten->subtree,
+                             ((LatticeGpencilModifierData *)md)->object,
+                             ten,
+                             TSE_LINKED_OB,
+                             0);
+      }
+    }
+  }
+
   /* vertex groups */
   if (ob->defbase.first) {
     bDeformGroup *defgroup;



More information about the Bf-blender-cvs mailing list