At last... this merge should finally do the trick!
[blender.git] / source / blender / editors / space_outliner / outliner.c
index 2d544b402ece16d6b6d516464a54436476fd625d..6563a7dc7df77c8622480bbbc2dc26f232846b25 100644 (file)
@@ -949,7 +949,6 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
                
                /* NLA Data */
                if (adt->nla_tracks.first) {
-#if 0
                        TreeElement *tenla= outliner_add_element(soops, &te->subtree, adt, te, TSE_NLA, 0);
                        NlaTrack *nlt;
                        int a= 0;
@@ -957,17 +956,18 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
                        tenla->name= "NLA Tracks";
                        
                        for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) {
-                               TreeElement *tenlt= outliner_add_element(soops, &te->subtree, nlt, te, TSE_NLA_TRACK, a);
-                               bActionStrip *strip;
+                               TreeElement *tenlt= outliner_add_element(soops, &tenla->subtree, nlt, tenla, TSE_NLA_TRACK, a);
+                               NlaStrip *strip;
                                TreeElement *ten;
                                int b= 0;
                                
-                               for (strip=nlt->strips.first; strip; strip=strip->next, a++) {
-                                       ten= outliner_add_element(soops, &tenla->subtree, strip->act, tenla, TSE_NLA_ACTION, a);
+                               tenlt->name= nlt->name;
+                               
+                               for (strip=nlt->strips.first; strip; strip=strip->next, b++) {
+                                       ten= outliner_add_element(soops, &tenlt->subtree, strip->act, tenlt, TSE_NLA_ACTION, b);
                                        if(ten) ten->directdata= strip;
                                }
                        }
-#endif
                }
        }
        else if(type==TSE_SEQUENCE) {
@@ -1031,7 +1031,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
        }
        else if(ELEM3(type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM)) {
                PointerRNA pptr, propptr, *ptr= (PointerRNA*)idv;
-               PropertyRNA *prop, *iterprop, *nameprop;
+               PropertyRNA *prop, *iterprop;
                PropertyType proptype;
                PropertySubType propsubtype;
                int a, tot;
@@ -1043,12 +1043,10 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
                }
                else if(type == TSE_RNA_STRUCT) {
                        /* struct */
-                       nameprop= RNA_struct_name_property(ptr->type);
+                       te->name= RNA_struct_name_get_alloc(ptr, NULL, 0);
 
-                       if(nameprop) {
-                               te->name= RNA_property_string_get_alloc(ptr, nameprop, NULL, 0);
+                       if(te->name)
                                te->flag |= TE_FREE_NAME;
-                       }
                        else
                                te->name= (char*)RNA_struct_ui_name(ptr->type);
 
@@ -1750,7 +1748,7 @@ static int tree_element_active_texture(Scene *scene, SpaceOops *soops, TreeEleme
 
                if(set) {
                        if(sbuts) {
-                               sbuts->tabo= TAB_SHADING_TEX;   // hack from header_buttonswin.c
+                               // XXX sbuts->tabo= TAB_SHADING_TEX;    // hack from header_buttonswin.c
                                sbuts->texfrom= 1;
                        }
 // XXX                 extern_set_butspace(F6KEY, 0);  // force shading buttons texture
@@ -1764,7 +1762,7 @@ static int tree_element_active_texture(Scene *scene, SpaceOops *soops, TreeEleme
                Lamp *la= (Lamp *)tselemp->id;
                if(set) {
                        if(sbuts) {
-                               sbuts->tabo= TAB_SHADING_TEX;   // hack from header_buttonswin.c
+                               // XXX sbuts->tabo= TAB_SHADING_TEX;    // hack from header_buttonswin.c
                                sbuts->texfrom= 2;
                        }
 // XXX                 extern_set_butspace(F6KEY, 0);  // force shading buttons texture
@@ -3075,7 +3073,7 @@ static void tree_element_to_path(SpaceOops *soops, TreeElement *te, TreeStoreEle
        TreeElement *tem, *temnext, *temsub;
        TreeStoreElem *tse, *tsenext;
        PointerRNA *ptr, *nextptr;
-       PropertyRNA *prop, *nameprop;
+       PropertyRNA *prop;
        char *newpath=NULL;
        
        /* optimise tricks:
@@ -3119,17 +3117,16 @@ static void tree_element_to_path(SpaceOops *soops, TreeElement *te, TreeStoreEle
                                        newpath= RNA_path_append(*path, ptr, prop, 0, NULL);
                                }
                                else if(RNA_property_type(prop) == PROP_COLLECTION) {
+                                       char buf[128], *name;
+
                                        temnext= (TreeElement*)(ld->next->data);
                                        tsenext= TREESTORE(temnext);
                                        
                                        nextptr= &temnext->rnaptr;
-                                       nameprop= RNA_struct_name_property(nextptr->type);
+                                       name= RNA_struct_name_get_alloc(nextptr, buf, sizeof(buf));
                                        
-                                       if(nameprop) {
+                                       if(name) {
                                                /* if possible, use name as a key in the path */
-                                               char buf[128], *name;
-                                               name= RNA_property_string_get_alloc(nextptr, nameprop, buf, sizeof(buf));
-                                               
                                                newpath= RNA_path_append(*path, NULL, prop, 0, name);
                                                
                                                if(name != buf)
@@ -3521,6 +3518,8 @@ static void tselem_draw_icon(float x, float y, TreeStoreElem *tselem, TreeElemen
                                UI_icon_draw(x, y, ICON_ANIM_DATA); break; // xxx
                        case TSE_NLA:
                                UI_icon_draw(x, y, ICON_NLA); break;
+                       case TSE_NLA_TRACK:
+                               UI_icon_draw(x, y, ICON_NLA); break; // XXX
                        case TSE_NLA_ACTION:
                                UI_icon_draw(x, y, ICON_ACTION); break;
                        case TSE_DEFGROUP_BASE:
@@ -3643,7 +3642,7 @@ static void tselem_draw_icon(float x, float y, TreeStoreElem *tselem, TreeElemen
                                UI_icon_draw(x, y, ICON_OBJECT_DATA);
                                break;
                        case TSE_RNA_STRUCT:
-                               UI_icon_draw(x, y, UI_GetIconRNA(&te->rnaptr));
+                               UI_icon_draw(x, y, RNA_struct_ui_icon(te->rnaptr.type));
                                break;
                        default:
                                UI_icon_draw(x, y, ICON_DOT); break;