diff options
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_outliner/outliner.c | 29 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_header.c | 6 |
2 files changed, 27 insertions, 8 deletions
diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index bbf08b6de18..6f970105f87 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -567,6 +567,11 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i ID *id= idv; int a; + if(ELEM3(type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM)) { + id= ((PointerRNA*)idv)->id.data; + if(!id) id= ((PointerRNA*)idv)->data; + } + if(id==NULL) return NULL; te= MEM_callocN(sizeof(TreeElement), "tree elem"); @@ -998,7 +1003,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i /* we do lazy build, for speed and to avoid infinite recusion */ if(ptr->data == NULL) { - te->name= "<null>"; + te->name= "(empty)"; } else if(type == TSE_RNA_STRUCT) { /* struct */ @@ -1342,6 +1347,18 @@ static void outliner_build_tree(Main *mainvar, Scene *scene, SpaceOops *soops) tselem->flag &= ~TSE_CLOSED; } } + else if(soops->outlinevis==SO_USERDEF) { + PointerRNA userdefptr; + + RNA_pointer_create(NULL, NULL, &RNA_UserPreferences, &U, &userdefptr); + + ten= outliner_add_element(soops, &soops->tree, (void*)&userdefptr, NULL, TSE_RNA_STRUCT, -1); + + if(show_opened) { + tselem= TREESTORE(ten); + tselem->flag &= ~TSE_CLOSED; + } + } else { ten= outliner_add_element(soops, &soops->tree, OBACT, NULL, 0, 0); if(ten) ten->directdata= BASACT; @@ -3179,8 +3196,10 @@ static int tselem_rna_icon(PointerRNA *ptr) return ICON_LAMP; else if(rnatype == &RNA_Group) return ICON_GROUP; - /*else if(rnatype == &RNA_Particle) - return ICON_PARTICLES;*/ + else if(rnatype == &RNA_ParticleSystem) + return ICON_PARTICLES; + else if(rnatype == &RNA_ParticleSettings) + return ICON_PARTICLES; else if(rnatype == &RNA_Material) return ICON_MATERIAL; /*else if(rnatype == &RNA_Texture) @@ -3686,7 +3705,7 @@ static void outliner_draw_tree(Scene *scene, ARegion *ar, SpaceOops *soops) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // only once - if(soops->outlinevis == SO_DATABLOCKS) { + if(ELEM(soops->outlinevis, SO_DATABLOCKS, SO_USERDEF)) { // struct marks UI_ThemeColorShadeAlpha(TH_BACK, -15, -200); //UI_ThemeColorShade(TH_BACK, -20); @@ -4260,7 +4279,7 @@ void draw_outliner(const bContext *C) block= uiBeginBlock(C, ar, "outliner buttons", UI_EMBOSS, UI_HELV); outliner_buttons(block, ar, soops, &soops->tree); - if(soops->outlinevis==SO_DATABLOCKS) { + if(ELEM(soops->outlinevis, SO_DATABLOCKS, SO_USERDEF)) { /* draw rna buttons */ outliner_rna_width(soops, &soops->tree, &sizex, 0); outliner_draw_rnacols(ar, soops, sizex); diff --git a/source/blender/editors/space_outliner/outliner_header.c b/source/blender/editors/space_outliner/outliner_header.c index e6eed0592e2..3c494dfaac4 100644 --- a/source/blender/editors/space_outliner/outliner_header.c +++ b/source/blender/editors/space_outliner/outliner_header.c @@ -201,14 +201,14 @@ void outliner_header_buttons(const bContext *C, ARegion *ar) if(soutliner->type==SO_OUTLINER) { if(G.main->library.first) - uiDefButS(block, MENU, B_REDR, "Outliner Display%t|Libraries %x7|All Scenes %x0|Current Scene %x1|Visible Layers %x2|Groups %x6|Same Types %x5|Selected %x3|Active %x4|Sequence %x10|Datablocks %x11", xco, yco, 100, 20, &soutliner->outlinevis, 0, 0, 0, 0, ""); + uiDefButS(block, MENU, B_REDR, "Outliner Display%t|Libraries %x7|All Scenes %x0|Current Scene %x1|Visible Layers %x2|Groups %x6|Same Types %x5|Selected %x3|Active %x4|Sequence %x10|Datablocks %x11|User Preferences %x12", xco, yco, 120, 20, &soutliner->outlinevis, 0, 0, 0, 0, ""); else - uiDefButS(block, MENU, B_REDR, "Outliner Display%t|All Scenes %x0|Current Scene %x1|Visible Layers %x2|Groups %x6|Same Types %x5|Selected %x3|Active %x4|Sequence %x10|Datablocks %x11", xco, yco, 100, 20, &soutliner->outlinevis, 0, 0, 0, 0, ""); + uiDefButS(block, MENU, B_REDR, "Outliner Display%t|All Scenes %x0|Current Scene %x1|Visible Layers %x2|Groups %x6|Same Types %x5|Selected %x3|Active %x4|Sequence %x10|Datablocks %x11|User Preferences %x12", xco, yco, 120, 20, &soutliner->outlinevis, 0, 0, 0, 0, ""); } /* always as last */ - UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin); + UI_view2d_totRect_set(&ar->v2d, xco+XIC+100, ar->v2d.tot.ymax-ar->v2d.tot.ymin); uiEndBlock(C, block); uiDrawBlock(C, block); |