From 502c4be56e481fc3d6c45d40d8bc3da2bf93226e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 24 Feb 2017 18:21:46 +0100 Subject: [PATCH 1/4] fix: redraw dope sheet / action editor when pose bone selection changes --- source/blender/makesrna/intern/rna_armature.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index 07d295c8bbc..891f5c43ca6 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -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) From d6b4fb6429443a3550a953b7cc131e50f1ad2875 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 17 Mar 2017 11:55:59 +0100 Subject: [PATCH 2/4] Cycles: Fix mistake in previous split kernel commits Own stupid mistake. Reported by nirved in IRC, thanks! --- .../split/kernel_holdout_emission_blurring_pathtermination_ao.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intern/cycles/kernel/split/kernel_holdout_emission_blurring_pathtermination_ao.h b/intern/cycles/kernel/split/kernel_holdout_emission_blurring_pathtermination_ao.h index e4bf513ffdc..1834a791b91 100644 --- a/intern/cycles/kernel/split/kernel_holdout_emission_blurring_pathtermination_ao.h +++ b/intern/cycles/kernel/split/kernel_holdout_emission_blurring_pathtermination_ao.h @@ -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 From ea3d7a7f58f67b5ce690a92aa0e81e4bb836170b Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 17 Mar 2017 14:47:12 +0100 Subject: [PATCH 3/4] Fix T50968: Cycles crashes when image datablock points to a directory See more details about root of the cause there: https://github.com/OpenImageIO/oiio/pull/1640 --- intern/cycles/render/image.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/intern/cycles/render/image.cpp b/intern/cycles/render/image.cpp index 8985431b68a..438b2347499 100644 --- a/intern/cycles/render/image.cpp +++ b/intern/cycles/render/image.cpp @@ -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); From 9d873fc3debe03e87eb514f51fddf29ee76983b3 Mon Sep 17 00:00:00 2001 From: raa Date: Fri, 17 Mar 2017 16:47:19 +0300 Subject: [PATCH 4/4] Various icon adjustments --- source/blender/editors/interface/interface.c | 2 + .../editors/interface/interface_layout.c | 2 +- .../editors/interface/interface_templates.c | 2 +- .../editors/interface/interface_widgets.c | 9 +++-- source/blender/editors/screen/area.c | 2 +- .../editors/space_outliner/outliner_draw.c | 38 +++++++++---------- 6 files changed, 28 insertions(+), 27 deletions(-) diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 682db20af55..0328d09ef9a 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -3913,6 +3913,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); } diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index f6347388cc4..c62fb4cadd6 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -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); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 62f12cd7967..131584dd405 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -430,7 +430,7 @@ static void template_ID( uiLayoutRow(layout, true); } 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 */ diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 4a2c13e395f..5ec0c49a8cd 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -873,15 +873,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; } diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index e6bb604d387..9cfaf3b4c1d 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1749,7 +1749,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; diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 684a1f9fd67..42d9e4356ee 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -1040,9 +1040,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; @@ -1053,8 +1050,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; if (tselem->type) { switch (tselem->type) { @@ -1389,9 +1388,9 @@ static void outliner_draw_iconrow(bContext *C, uiBlock *block, Scene *scene, Spa UI_draw_roundbox_corner_set(UI_CNR_ALL); glColor4ub(255, 255, 255, 100); 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); glEnable(GL_BLEND); /* roundbox disables */ @@ -1536,9 +1535,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); glEnable(GL_BLEND); /* roundbox disables it */ @@ -1549,16 +1548,13 @@ static void outliner_draw_tree_element( /* open/close icon, only when sublevels, except for scene */ if (te->subtree.first || (tselem->type == 0 && te->idcode == ID_SCE) || (te->flag & TE_LAZY_CLOSED)) { int icon_x; - if (tselem->type == 0 && ELEM(te->idcode, ID_OB, ID_SCE)) - icon_x = startx; - else - icon_x = startx + 5 * ufac; + icon_x = startx; // icons a bit higher if (TSELEM_OPEN(tselem, soops)) - UI_icon_draw((float)icon_x, (float)*starty + 2 * ufac, ICON_DISCLOSURE_TRI_DOWN); + UI_icon_draw((float)icon_x + 2 * ufac, (float)*starty + 1 * ufac, ICON_DISCLOSURE_TRI_DOWN); else - UI_icon_draw((float)icon_x, (float)*starty + 2 * ufac, ICON_DISCLOSURE_TRI_RIGHT); + UI_icon_draw((float)icon_x + 2 * ufac, (float)*starty + 1 * ufac, ICON_DISCLOSURE_TRI_RIGHT); } offsx += UI_UNIT_X; @@ -1568,7 +1564,7 @@ static void outliner_draw_tree_element( tselem_draw_icon(block, xmax, (float)startx + offsx, (float)*starty, tselem, te, 1.0f); - offsx += UI_UNIT_X; + offsx += UI_UNIT_X + 2 * ufac; } else offsx += 2 * ufac; @@ -1576,16 +1572,16 @@ static void outliner_draw_tree_element( if (tselem->type == 0 && ID_IS_LINKED_DATABLOCK(tselem->id)) { glPixelTransferf(GL_ALPHA_SCALE, 0.5f); if (tselem->id->tag & LIB_TAG_MISSING) { - UI_icon_draw((float)startx + offsx, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_BROKEN); + UI_icon_draw((float)startx + offsx + 2 * ufac, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_BROKEN); } else if (tselem->id->tag & LIB_TAG_INDIRECT) { - UI_icon_draw((float)startx + offsx, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_INDIRECT); + UI_icon_draw((float)startx + offsx + 2 * ufac, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_INDIRECT); } else { - UI_icon_draw((float)startx + offsx, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_DIRECT); + UI_icon_draw((float)startx + offsx + 2 * ufac, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_DIRECT); } glPixelTransferf(GL_ALPHA_SCALE, 1.0f); - offsx += UI_UNIT_X; + offsx += UI_UNIT_X + 2 * ufac; } glDisable(GL_BLEND); @@ -1757,7 +1753,7 @@ static void outliner_draw_tree(bContext *C, uiBlock *block, Scene *scene, ARegio // gray hierarchy lines UI_ThemeColorBlend(TH_BACK, TH_TEXT, 0.4f); starty = (int)ar->v2d.tot.ymax - UI_UNIT_Y / 2 - OL_Y_OFFSET; - startx = 6; + startx = UI_UNIT_X / 2 - 1.0f; outliner_draw_hierarchy(soops, &soops->tree, startx, &starty); // items themselves