Commit: 222a199f9990532a7e1648cfbddb07aadad2b0bc
Author: Bastien Montagne
Date:   Wed Jul 15 17:39:32 2015 +0200
Branches: missing-libs
https://developer.blender.org/rB222a199f9990532a7e1648cfbddb07aadad2b0bc

Add outliner's visualization for broken libs, and also tag lib ID itself as 
missing.

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

M       source/blender/blenloader/intern/readfile.c
M       source/blender/editors/space_outliner/outliner_draw.c

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

diff --git a/source/blender/blenloader/intern/readfile.c 
b/source/blender/blenloader/intern/readfile.c
index f315e04..5a2ed50 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -9731,6 +9731,7 @@ static void read_libraries(FileData *basefd, ListBase 
*mainlist)
                                        }
                                        else {
                                                mainptr->curlib->filedata = 
NULL;
+                                               mainptr->curlib->id.flag |= 
LIB_MISSING;
                                        }
                                        
                                        if (fd == NULL) {
diff --git a/source/blender/editors/space_outliner/outliner_draw.c 
b/source/blender/editors/space_outliner/outliner_draw.c
index 420b73c..ad9c079 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -1315,7 +1315,16 @@ static void tselem_draw_icon(uiBlock *block, int xmax, 
float x, float y, TreeSto
                        case ID_GR:
                                tselem_draw_icon_uibut(&arg, ICON_GROUP); break;
                        case ID_LI:
-                               tselem_draw_icon_uibut(&arg, 
ICON_LIBRARY_DATA_DIRECT); break;
+                               if (tselem->id->flag & LIB_MISSING) {
+                                       tselem_draw_icon_uibut(&arg, 
ICON_LIBRARY_DATA_BROKEN);
+                               }
+                               else if (((Library *)tselem->id)->parent) {
+                                       tselem_draw_icon_uibut(&arg, 
ICON_LIBRARY_DATA_INDIRECT);
+                               }
+                               else {
+                                       tselem_draw_icon_uibut(&arg, 
ICON_LIBRARY_DATA_DIRECT);
+                               }
+                               break;
                        case ID_LS:
                                tselem_draw_icon_uibut(&arg, ICON_LINE_DATA); 
break;
                        case ID_GD:
@@ -1550,10 +1559,15 @@ static void outliner_draw_tree_element(
                
                if (tselem->type == 0 && tselem->id->lib) {
                        glPixelTransferf(GL_ALPHA_SCALE, 0.5f);
-                       if (tselem->id->flag & LIB_INDIRECT)
+                       if (tselem->id->flag & LIB_MISSING) {
+                               UI_icon_draw((float)startx + offsx, 
(float)*starty + 2 * ufac, ICON_LIBRARY_DATA_BROKEN);
+                       }
+                       else if (tselem->id->flag & LIB_INDIRECT) {
                                UI_icon_draw((float)startx + offsx, 
(float)*starty + 2 * ufac, ICON_LIBRARY_DATA_INDIRECT);
-                       else
+                       }
+                       else {
                                UI_icon_draw((float)startx + offsx, 
(float)*starty + 2 * ufac, ICON_LIBRARY_DATA_DIRECT);
+                       }
                        glPixelTransferf(GL_ALPHA_SCALE, 1.0f);
                        offsx += UI_UNIT_X;
                }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to