Keying Set UI - Icons for Paths in List
authorJoshua Leung <aligorith@gmail.com>
Fri, 1 Jul 2011 03:35:59 +0000 (03:35 +0000)
committerJoshua Leung <aligorith@gmail.com>
Fri, 1 Jul 2011 03:35:59 +0000 (03:35 +0000)
The Keying Set paths list now shows the icon of the type of ID-block
that a path item refers to. This make it easier to make snese of the
paths shown in the list.

source/blender/editors/interface/interface_templates.c

index 39abcecbb6b4cac9e6be98ea22c983c80c3076e0..c4a07a004d203d6602465c671b5e3bc47bb434e5 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "MEM_guardedalloc.h"
 
+#include "DNA_anim_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_userdef_types.h"
 
@@ -55,6 +56,7 @@
 #include "ED_render.h"
 
 #include "RNA_access.h"
+#include "RNA_enum_types.h"
 
 #include "WM_api.h"
 #include "WM_types.h"
@@ -2106,6 +2108,15 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
                //uiItemR(row, itemptr, "mute", 0, "", ICON_MUTE_IPO_OFF);
                uiBlockSetEmboss(block, UI_EMBOSS);
        }
+       else if(itemptr->type == &RNA_KeyingSetPath) {
+               KS_Path *ksp = (KS_Path*)itemptr->data;
+               
+               /* icon needs to be the type of ID which is currently active */
+               RNA_enum_icon_from_value(id_type_items, ksp->idtype, &icon);
+               
+               /* nothing else special to do... */
+               uiItemL(sub, name, icon); /* fails, backdrop LISTROW... */
+       }
        else
                uiItemL(sub, name, icon); /* fails, backdrop LISTROW... */