[Bf-blender-cvs] [1e1d1f15e87] master: UI: Enable the outliner to use the correct icon for each curve subtype

Ethan Hall noreply at git.blender.org
Wed Mar 2 15:52:35 CET 2022


Commit: 1e1d1f15e8750642c29e4d04e09462cc4e4d2baa
Author: Ethan Hall
Date:   Wed Mar 2 15:33:48 2022 +0100
Branches: master
https://developer.blender.org/rB1e1d1f15e8750642c29e4d04e09462cc4e4d2baa

UI: Enable the outliner to use the correct icon for each curve subtype

This patch enables enables the outliner to use the correct icon for each
of the curve subtypes (Curve/Surface/Font).

Differential Revision: https://developer.blender.org/D14093

Reviewed by: Julian Eisel

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

M	source/blender/editors/space_outliner/outliner_draw.cc

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

diff --git a/source/blender/editors/space_outliner/outliner_draw.cc b/source/blender/editors/space_outliner/outliner_draw.cc
index 2da416c8671..423f11e0641 100644
--- a/source/blender/editors/space_outliner/outliner_draw.cc
+++ b/source/blender/editors/space_outliner/outliner_draw.cc
@@ -28,6 +28,7 @@
 
 #include "BKE_armature.h"
 #include "BKE_context.h"
+#include "BKE_curve.h"
 #include "BKE_deform.h"
 #include "BKE_gpencil.h"
 #include "BKE_idtype.h"
@@ -2655,9 +2656,23 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te)
         case ID_ME:
           data.icon = ICON_OUTLINER_DATA_MESH;
           break;
-        case ID_CU_LEGACY:
-          data.icon = ICON_OUTLINER_DATA_CURVE;
+        case ID_CU_LEGACY: {
+          const Curve *cu = (Curve *)tselem->id;
+          const short obtype = BKE_curve_type_get(cu);
+
+          switch (obtype) {
+            case OB_FONT:
+              data.icon = ICON_OUTLINER_DATA_FONT;
+              break;
+            case OB_SURF:
+              data.icon = ICON_OUTLINER_DATA_SURFACE;
+              break;
+            default:
+              data.icon = ICON_OUTLINER_DATA_CURVE;
+              break;
+          }
           break;
+        }
         case ID_MB:
           data.icon = ICON_OUTLINER_DATA_META;
           break;



More information about the Bf-blender-cvs mailing list