Merge branch 'master' into blender2.8
authorJulian Eisel <eiseljulian@gmail.com>
Fri, 17 Mar 2017 14:34:35 +0000 (15:34 +0100)
committerJulian Eisel <eiseljulian@gmail.com>
Fri, 17 Mar 2017 14:38:45 +0000 (15:38 +0100)
Conflicts:
source/blender/editors/space_outliner/outliner_draw.c

intern/cycles/kernel/split/kernel_holdout_emission_blurring_pathtermination_ao.h
intern/cycles/render/image.cpp
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/screen/area.c
source/blender/editors/space_outliner/outliner_draw.c
source/blender/makesrna/intern/rna_armature.c

index e4bf513ffdc89671cf6f1d71cf1d4f010f333dc8..1834a791b91cc5dcd3f64b765c260c87657ddd24 100644 (file)
@@ -263,7 +263,7 @@ ccl_device void kernel_holdout_emission_blurring_pathtermination_ao(
                                QUEUE_SHADOW_RAY_CAST_AO_RAYS,
                                enqueue_flag_AO_SHADOW_RAY_CAST,
                                kernel_split_params.queue_size,
-                               &locals->queue_atomics_bg,
+                               &locals->queue_atomics_ao,
                                kernel_split_state.queue_data,
                                kernel_split_params.queue_index);
 #endif
index 8985431b68adbc9bf83bcb2f9fcd9c505bf6551e..438b23474998a67b4748dbac6fbc8083869c9a10 100644 (file)
@@ -156,6 +156,16 @@ ImageManager::ImageDataType ImageManager::get_image_metadata(const string& filen
                }
        }
 
+       /* Perform preliminary checks, with meaningful logging. */
+       if(!path_exists(filename)) {
+               VLOG(1) << "File '" << filename << "' does not exist.";
+               return IMAGE_DATA_TYPE_BYTE4;
+       }
+       if(path_is_directory(filename)) {
+               VLOG(1) << "File '" << filename << "' is a directory, can't use as image.";
+               return IMAGE_DATA_TYPE_BYTE4;
+       }
+
        ImageInput *in = ImageInput::create(filename);
 
        if(in) {
@@ -432,6 +442,11 @@ bool ImageManager::file_load_image_generic(Image *img, ImageInput **in, int &wid
                return false;
 
        if(!img->builtin_data) {
+               /* NOTE: Error logging is done in meta data acquisition. */
+               if(!path_exists(img->filename) || path_is_directory(img->filename)) {
+                       return false;
+               }
+
                /* load image from file through OIIO */
                *in = ImageInput::create(img->filename);
 
index 0b026750900cef117939c81431bf5db2e0793093..f091e17139f6b1b6d18daf759a24b71df477e2b5 100644 (file)
@@ -3914,6 +3914,8 @@ uiBut *uiDefIconTextButO_ptr(uiBlock *block, int type, wmOperatorType *ot, int o
 uiBut *uiDefIconTextButO(uiBlock *block, int type, const char *opname, int opcontext, int icon, const char *str, int x, int y, short width, short height, const char *tip)
 {
        wmOperatorType *ot = WM_operatortype_find(opname, 0);
+       if (str[0] == '\0') 
+               return uiDefIconButO_ptr(block, type, ot, opcontext, icon, x, y, width, height, tip);
        return uiDefIconTextButO_ptr(block, type, ot, opcontext, icon, str, x, y, width, height, tip);
 }
 
index f6347388cc40a90b255d8ed3d2abe760c79db7bf..c62fb4cadd6e52d356079fe3e0162bad2eeb5cd5 100644 (file)
@@ -1274,7 +1274,7 @@ static void ui_item_rna_size(
        if (!w) {
                if (type == PROP_ENUM && icon_only) {
                        w = ui_text_icon_width(layout, "", ICON_BLANK1, 0);
-                       w += 0.5f * UI_UNIT_X;
+                       w += 0.6f * UI_UNIT_X;
                }
                else {
                        w = ui_text_icon_width(layout, name, icon, 0);
index 2f64100fa66fcc4c1a6778ce1aaf8312ca87f5c5..e4d9be3329bfd23adcfdca0eb3e3d7afcf80d59e 100644 (file)
@@ -444,7 +444,7 @@ static void template_ID(
                }
        }
        else if (flag & UI_ID_BROWSE) {
-               but = uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X * 1.5, UI_UNIT_Y,
+               but = uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X * 1.6, UI_UNIT_Y,
                                     TIP_(template_id_browse_tip(type)));
                ui_def_but_icon(but, RNA_struct_ui_icon(type), UI_HAS_ICON);
                /* default dragging of icon for id browse buttons */
index 8e3bdd2a5da506e759d6815df51a5a36493d8898..16aa16ccc5d5ffa780c4aa593ee990404b570f1e 100644 (file)
@@ -903,15 +903,18 @@ static void widget_draw_icon(
        if (icon && icon != ICON_BLANK1) {
                float ofs = 1.0f / aspect;
                
-               if (but->drawflag & UI_BUT_ICON_LEFT || ui_block_is_pie_menu(but->block)) {
+               if (but->drawflag & UI_BUT_ICON_LEFT) {
                        if (but->block->flag & UI_BLOCK_LOOP) {
                                if (but->type == UI_BTYPE_SEARCH_MENU)
                                        xs = rect->xmin + 4.0f * ofs;
                                else
-                                       xs = rect->xmin + 2.0f * ofs;
+                                       xs = rect->xmin + ofs;
                        }
                        else {
-                               xs = rect->xmin + 2.0f * ofs;
+                               if (but->dt == UI_EMBOSS_NONE || but->type == UI_BTYPE_LABEL)
+                                       xs = rect->xmin + 2.0f * ofs;
+                               else
+                                       xs = rect->xmin + 4.0f * ofs;
                        }
                        ys = (rect->ymin + rect->ymax - height) / 2.0f;
                }
index f03647352472f5a40fa55f6fd4f2c4917ea3ed95..7e1fda6d095e0dfb8a3a6d880b181c918568cdd5 100644 (file)
@@ -1795,7 +1795,7 @@ int ED_area_header_switchbutton(const bContext *C, uiBlock *block, int yco)
 
        RNA_pointer_create(&(scr->id), &RNA_Area, sa, &areaptr);
 
-       uiDefButR(block, UI_BTYPE_MENU, 0, "", xco, yco, 1.5 * U.widget_unit, U.widget_unit,
+       uiDefButR(block, UI_BTYPE_MENU, 0, "", xco, yco, 1.6 * U.widget_unit, U.widget_unit,
                  &areaptr, "type", 0, 0.0f, 0.0f, 0.0f, 0.0f, "");
 
        return xco + 1.7 * U.widget_unit;
index 6207ed8579ca547b30087b02ca9a441144eb0719..ee943db95334d85c3c8643bef8a218202c5e02dc 100644 (file)
@@ -834,9 +834,6 @@ static void tselem_draw_icon(uiBlock *block, int xmax, float x, float y, TreeSto
        struct DrawIconArg arg;
        float aspect;
        
-       /* icons tiny bit away from text */
-       x -= 0.15f * UI_UNIT_Y;
-       
        /* make function calls a bit compacter */
        arg.block = block;
        arg.id = tselem->id;
@@ -847,8 +844,10 @@ static void tselem_draw_icon(uiBlock *block, int xmax, float x, float y, TreeSto
 
        /* placement of icons, copied from interface_widgets.c */
        aspect = (0.8f * UI_UNIT_Y) / ICON_DEFAULT_HEIGHT;
-       arg.x = x = x + 4.0f * aspect;
-       arg.y = y = y + 0.1f * UI_UNIT_Y;
+       x += 2.0f * aspect;
+       y += 2.0f * aspect;
+       arg.x = x = x;
+       arg.y = y = y;
 
 #define ICON_DRAW(_icon) UI_icon_draw_alpha(x, y, _icon, alpha)
 
@@ -1256,9 +1255,9 @@ static void outliner_draw_iconrow(bContext *C, uiBlock *block, Scene *scene, Sce
                                color[3] *= alpha_fac;
 
                                UI_draw_roundbox(
-                                       (float) *offsx - 1.0f * ufac,
+                                       (float) *offsx + 1.0f * ufac,
                                        (float)ys + 1.0f * ufac,
-                                       (float)*offsx + UI_UNIT_X - 2.0f * ufac,
+                                       (float)*offsx + UI_UNIT_X - 1.0f * ufac,
                                        (float)ys + UI_UNIT_Y - ufac,
                                        (float)UI_UNIT_Y / 2.0f - ufac,
                                         color);
@@ -1382,9 +1381,9 @@ static void outliner_draw_tree_element(
                if (active != OL_DRAWSEL_NONE) {
                        UI_draw_roundbox_corner_set(UI_CNR_ALL);
                        UI_draw_roundbox(
-                               (float)startx + UI_UNIT_X,
+                               (float)startx + UI_UNIT_X + 1.0f * ufac,
                                (float)*starty + 1.0f * ufac,
-                               (float)startx + 2.0f * UI_UNIT_X - 2.0f * ufac,
+                               (float)startx + 2.0f * UI_UNIT_X - 1.0f * ufac,
                                (float)*starty + UI_UNIT_Y - 1.0f * ufac,
                                UI_UNIT_Y / 2.0f - 1.0f * ufac, color);
                        glEnable(GL_BLEND); /* roundbox disables it */
@@ -1402,10 +1401,10 @@ static void outliner_draw_tree_element(
 
                        // icons a bit higher
                        if (TSELEM_OPEN(tselem, soops))
-                               UI_icon_draw_alpha((float)icon_x, (float)*starty + 2 * ufac, ICON_DISCLOSURE_TRI_DOWN,
+                               UI_icon_draw_alpha((float)icon_x + 2 * ufac, (float)*starty + 1 * ufac, ICON_DISCLOSURE_TRI_DOWN,
                                                   alpha_fac);
                        else
-                               UI_icon_draw_alpha((float)icon_x, (float)*starty + 2 * ufac, ICON_DISCLOSURE_TRI_RIGHT,
+                               UI_icon_draw_alpha((float)icon_x + 2 * ufac, (float)*starty + 1 * ufac, ICON_DISCLOSURE_TRI_RIGHT,
                                                   alpha_fac);
                }
                offsx += UI_UNIT_X;
@@ -1414,25 +1413,25 @@ static void outliner_draw_tree_element(
                
                if (!(ELEM(tselem->type, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM))) {
                        tselem_draw_icon(block, xmax, (float)startx + offsx, (float)*starty, tselem, te, alpha_fac);
-                       offsx += UI_UNIT_X;
+                       offsx += UI_UNIT_X + 2 * ufac;
                }
                else
                        offsx += 2 * ufac;
                
                if (tselem->type == 0 && ID_IS_LINKED_DATABLOCK(tselem->id)) {
                        if (tselem->id->tag & LIB_TAG_MISSING) {
-                               UI_icon_draw_alpha((float)startx + offsx, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_BROKEN,
+                               UI_icon_draw_alpha((float)startx + offsx + 2 * ufac, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_BROKEN,
                                                   alpha_fac);
                        }
                        else if (tselem->id->tag & LIB_TAG_INDIRECT) {
-                               UI_icon_draw_alpha((float)startx + offsx, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_INDIRECT,
+                               UI_icon_draw_alpha((float)startx + offsx + 2 * ufac, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_INDIRECT,
                                                   alpha_fac);
                        }
                        else {
-                               UI_icon_draw_alpha((float)startx + offsx, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_DIRECT,
+                               UI_icon_draw_alpha((float)startx + offsx + 2 * ufac, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_DIRECT,
                                                   alpha_fac);
                        }
-                       offsx += UI_UNIT_X;
+                       offsx += UI_UNIT_X + 2 * ufac;
                }
                glDisable(GL_BLEND);
                
index 07d295c8bbc4f0eb17f25653894037e4b380e692..891f5c43ca61f4e98faea26c35117891fbbbc829 100644 (file)
@@ -187,6 +187,9 @@ static void rna_Bone_select_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Po
        }
        
        WM_main_add_notifier(NC_GEOM | ND_DATA, id);
+
+       /* spaces that show animation data of the selected bone need updating */
+       WM_main_add_notifier(NC_ANIMATION | ND_ANIMCHAN, id);
 }
 
 static char *rna_Bone_path(PointerRNA *ptr)