[Bf-blender-cvs] [e74b428d41a] soc-2020-outliner: Outliner: Draw gpencil shader effects in the tree

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


Commit: e74b428d41a011afb251d3a17c4c4ed0c220403e
Author: Nathan Craddock
Date:   Fri Jul 17 16:20:46 2020 -0600
Branches: soc-2020-outliner
https://developer.blender.org/rBe74b428d41a011afb251d3a17c4c4ed0c220403e

Outliner: Draw gpencil shader effects in the tree

Draw the gpencil visual shaders in the outliner tree. Adds new TSE
types.

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

M	source/blender/editors/space_outliner/outliner_draw.c
M	source/blender/editors/space_outliner/outliner_tree.c
M	source/blender/makesdna/DNA_outliner_types.h

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

diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 7d795acb7f8..e9a92c644fb 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -2500,6 +2500,10 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te)
         data.icon = ICON_OUTLINER_DATA_GP_LAYER;
         break;
       }
+      case TSE_EFFECT_BASE:
+      case TSE_EFFECT:
+        data.icon = ICON_SHADERFX;
+        break;
       default:
         data.icon = ICON_DOT;
         break;
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index 6c12acb1f7e..16dd5254ed2 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -47,6 +47,7 @@
 #include "DNA_pointcloud_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_sequence_types.h"
+#include "DNA_shader_fx_types.h"
 #include "DNA_simulation_types.h"
 #include "DNA_speaker_types.h"
 #include "DNA_volume_types.h"
@@ -515,6 +516,7 @@ static void outliner_add_object_contents(SpaceOutliner *soops,
     }
   }
 
+  /* Grease Pencil modifiers. */
   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);
@@ -550,6 +552,26 @@ static void outliner_add_object_contents(SpaceOutliner *soops,
     }
   }
 
+  /* Grease Pencil effects. */
+  if (!BLI_listbase_is_empty(&ob->shader_fx)) {
+    ShaderFxData *fx;
+    TreeElement *ten_fx = outliner_add_element(soops, &te->subtree, ob, te, TSE_EFFECT_BASE, 0);
+    int index;
+
+    ten_fx->name = IFACE_("Effects");
+    for (index = 0, fx = ob->shader_fx.first; fx; index++, fx = fx->next) {
+      TreeElement *ten = outliner_add_element(
+          soops, &ten_fx->subtree, ob, ten_fx, TSE_EFFECT, index);
+      ten->name = fx->name;
+      ten->directdata = fx;
+
+      if (fx->type == eShaderFxType_Swirl) {
+        outliner_add_element(
+            soops, &ten->subtree, ((SwirlShaderFxData *)fx)->object, ten, TSE_LINKED_OB, 0);
+      }
+    }
+  }
+
   /* vertex groups */
   if (ob->defbase.first) {
     bDeformGroup *defgroup;
diff --git a/source/blender/makesdna/DNA_outliner_types.h b/source/blender/makesdna/DNA_outliner_types.h
index d8a7599e4cb..490abbf9381 100644
--- a/source/blender/makesdna/DNA_outliner_types.h
+++ b/source/blender/makesdna/DNA_outliner_types.h
@@ -110,6 +110,8 @@ enum {
 #define TSE_SCENE_COLLECTION_BASE 39
 #define TSE_VIEW_COLLECTION_BASE 40
 #define TSE_SCENE_OBJECTS_BASE 41
+#define TSE_EFFECT_BASE 42
+#define TSE_EFFECT 43
 
 /* Check whether given TreeStoreElem should have a real ID in its ->id member. */
 #define TSE_IS_REAL_ID(_tse) \



More information about the Bf-blender-cvs mailing list