- add back prefix for ID lists (LF) for linked and fake user for search fields.
authorCampbell Barton <ideasman42@gmail.com>
Sat, 31 Jul 2010 01:06:08 +0000 (01:06 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 31 Jul 2010 01:06:08 +0000 (01:06 +0000)
- remove debug print for left/right name flipping & commented test from the sequencer.

source/blender/blenkernel/BKE_library.h
source/blender/blenkernel/intern/deform.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/sequencer.c
source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_templates.c

index fcf7ae8..debccaa 100644 (file)
@@ -65,6 +65,7 @@ void tag_main(struct Main *mainvar, int tag);
 
 int splitIDname(char *name, char *left, int *nr);
 void rename_id(struct ID *id, char *name);
+void name_uiprefix_id(char *name, struct ID *id);
 void test_idbutton(char *name);
 void text_idbutton(struct ID *id, char *text);
 void all_local(struct Library *lib, int untagged_only);
index 5f262c5..ccb6ebe 100644 (file)
@@ -471,7 +471,6 @@ void flip_side_name (char *name, const char *from_name, int strip_number)
 #undef IS_SEPARATOR
 
        sprintf (name, "%s%s%s%s", prefix, replace, suffix, number);
-       printf("'%s' --> '%s'\n", from_name, name);
 }
 
 float defvert_find_weight(const struct MDeformVert *dvert, int group_num)
index 716a0b7..6852a48 100644 (file)
@@ -1394,3 +1394,12 @@ void rename_id(ID *id, char *name)
        
        new_id(lb, id, name);                           
 }
+
+void name_uiprefix_id(char *name, ID *id)
+{
+       name[0] = id->lib ? 'L':' ';
+       name[1] = id->flag & LIB_FAKEUSER ? 'F':' ';
+       name[2] = ' ';
+
+       strcpy(name+3, id->name+2);
+}
index 4f3ad50..df18573 100644 (file)
@@ -1876,12 +1876,6 @@ static ImBuf * seq_render_scene_strip_impl(
                                addzbuffloatImBuf(ibuf);
                                memcpy(ibuf->zbuf_float, rres.rectz, sizeof(float)*rres.rectx*rres.recty);
                        }
-                       
-                       /* {
-                          ImBuf *imb= IMB_allocImBuf(rres.rectx, rres.recty, 32, IB_rectfloat, 0);
-                          IMB_saveiff(imb, "/tmp/foo.image", IB_rect | IB_metadata);
-                          IMB_freeImBuf(imb);
-                          } */
 
                        /* float buffers in the sequencer are not linear */
                        ibuf->profile= IB_PROFILE_LINEAR_RGB;
index c2bcc67..b6f4dcc 100644 (file)
@@ -1111,13 +1111,19 @@ static void rna_search_cb(const struct bContext *C, void *arg_but, char *str, ui
                        if(itemptr.data == but->rnapoin.id.data)
                                continue;
 
-               if(itemptr.type && RNA_struct_is_ID(itemptr.type))
-                       iconid= ui_id_icon_get((bContext*)C, itemptr.data, 1);
-        else
+               if(itemptr.type && RNA_struct_is_ID(itemptr.type)) {
+                       ID *id= itemptr.data;
+                       char name_ui[32];
+
+                       name_uiprefix_id(name_ui, id);
+                       name= BLI_strdup(name_ui);
+                       iconid= ui_id_icon_get((bContext*)C, id, 1);
+        }
+               else {
+                       name= RNA_struct_name_get_alloc(&itemptr, NULL, 0);
             iconid = 0;
-               
-               name= RNA_struct_name_get_alloc(&itemptr, NULL, 0);
-               
+               }
+
                if(name) {
                        if(BLI_strcasestr(name, str)) {
                                cis = MEM_callocN(sizeof(CollItemSearch), "CollectionItemSearch");
@@ -1126,9 +1132,9 @@ static void rna_search_cb(const struct bContext *C, void *arg_but, char *str, ui
                                cis->iconid = iconid;
                                BLI_addtail(items_list, cis);
                        }
-               MEM_freeN(name);
-               }
-               
+                       MEM_freeN(name);
+               }                       
+
                i++;
        }
        RNA_PROP_END;
index 488258d..1b600a2 100644 (file)
@@ -218,9 +218,12 @@ static void id_search_cb(const bContext *C, void *arg_template, char *str, uiSea
                                        continue;
 
                        if(BLI_strcasestr(id->name+2, str)) {
+                               char name_ui[32];
+                               name_uiprefix_id(name_ui, id);
+
                                iconid= ui_id_icon_get((bContext*)C, id, 1);
 
-                               if(!uiSearchItemAdd(items, id->name+2, id, iconid))
+                               if(!uiSearchItemAdd(items, name_ui, id, iconid))
                                        break;
                        }
                }