Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSriharsha Kotcharlakot <k.venkatsriharsha@gmail.com>2020-09-15 18:51:14 +0300
committerSriharsha Kotcharlakot <k.venkatsriharsha@gmail.com>2020-09-15 18:51:14 +0300
commit77087d32047eef0730750a2bd2ad19f23082e36b (patch)
tree4af22b8d138f2587399d52f40141de233c7e1338
parentba39073755673bb61c4c96bc4b557c4622ca28c8 (diff)
parentf59ce4d55c04a61a10d9e9567b53ee652972b60a (diff)
Merge branch 'master' into soc-2020-fluid-toolssoc-2020-fluid-tools
-rw-r--r--build_files/build_environment/cmake/pugixml.cmake4
-rw-r--r--intern/cycles/CMakeLists.txt2
-rw-r--r--intern/cycles/device/device_multi.cpp7
-rw-r--r--release/datafiles/userdef/userdef_default_theme.c1
-rw-r--r--release/scripts/presets/interface_theme/blender_light.xml4
-rw-r--r--release/scripts/startup/bl_ui/space_properties.py9
-rw-r--r--source/blender/blenloader/intern/versioning_userdef.c2
-rw-r--r--source/blender/draw/CMakeLists.txt2
-rw-r--r--source/blender/draw/engines/image/image_engine.c10
-rw-r--r--source/blender/editors/interface/interface.c39
-rw-r--r--source/blender/editors/interface/interface_intern.h1
-rw-r--r--source/blender/editors/interface/interface_layout.c126
-rw-r--r--source/blender/editors/interface/interface_widgets.c2
-rw-r--r--source/blender/editors/space_buttons/buttons_context.c55
-rw-r--r--source/blender/editors/space_buttons/buttons_intern.h4
-rw-r--r--source/blender/editors/space_buttons/space_buttons.c17
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c2
-rw-r--r--source/blender/editors/util/CMakeLists.txt1
-rw-r--r--source/blender/functions/CMakeLists.txt2
-rw-r--r--source/blender/gpu/CMakeLists.txt4
-rw-r--r--source/blender/gpu/intern/gpu_index_buffer.cc2
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c12
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c7
-rw-r--r--source/creator/CMakeLists.txt2
-rw-r--r--tests/CMakeLists.txt2
25 files changed, 227 insertions, 92 deletions
diff --git a/build_files/build_environment/cmake/pugixml.cmake b/build_files/build_environment/cmake/pugixml.cmake
index 8804ae74836..4e0bd0eafcf 100644
--- a/build_files/build_environment/cmake/pugixml.cmake
+++ b/build_files/build_environment/cmake/pugixml.cmake
@@ -39,5 +39,5 @@ if(WIN32)
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/pugixml/lib/pugixml.lib ${HARVEST_TARGET}/osl/lib/pugixml_d.lib
DEPENDEES install
)
- endif()
-endif() \ No newline at end of file
+ endif()
+endif()
diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt
index d114820d723..f420b1faf81 100644
--- a/intern/cycles/CMakeLists.txt
+++ b/intern/cycles/CMakeLists.txt
@@ -57,7 +57,7 @@ if(WITH_CYCLES_NATIVE_ONLY)
COMPILE_OUTPUT_VARIABLE arch_compile_output
RUN_OUTPUT_VARIABLE arch_run_output
)
- if (arch_compile_result AND "${arch_run_result}" EQUAL "0")
+ if(arch_compile_result AND "${arch_run_result}" EQUAL "0")
string(STRIP ${arch_run_output} arch_run_output)
set(MSVC_NATIVE_ARCH_FLAGS ${arch_run_output} CACHE STRING "MSVC Native architecture flags")
endif()
diff --git a/intern/cycles/device/device_multi.cpp b/intern/cycles/device/device_multi.cpp
index 9ea8782d0f0..2e72a0b4393 100644
--- a/intern/cycles/device/device_multi.cpp
+++ b/intern/cycles/device/device_multi.cpp
@@ -237,6 +237,13 @@ class MultiDevice : public Device {
return true;
}
+ virtual void *bvh_device() const
+ {
+ /* CPU devices will always be at the back, so simply choose the last one.
+ There should only ever be one CPU device anyway and we need the Embree device for it. */
+ return devices.back().device->bvh_device();
+ }
+
virtual void *osl_memory()
{
if (devices.size() > 1) {
diff --git a/release/datafiles/userdef/userdef_default_theme.c b/release/datafiles/userdef/userdef_default_theme.c
index cd6be1903ec..791630a1a9c 100644
--- a/release/datafiles/userdef/userdef_default_theme.c
+++ b/release/datafiles/userdef/userdef_default_theme.c
@@ -262,6 +262,7 @@ const bTheme U_theme_default = {
.icon_folder = RGBA(0xe3c16eff),
},
.space_properties = {
+ .match = RGBA(0x5680c2ff),
.back = RGBA(0x42424200),
.title = RGBA(0xd4d4d4ff),
.text = RGBA(0xe6e6e6ff),
diff --git a/release/scripts/presets/interface_theme/blender_light.xml b/release/scripts/presets/interface_theme/blender_light.xml
index 1b48377f62c..53e2571ae8c 100644
--- a/release/scripts/presets/interface_theme/blender_light.xml
+++ b/release/scripts/presets/interface_theme/blender_light.xml
@@ -845,7 +845,9 @@
</ThemeSequenceEditor>
</sequence_editor>
<properties>
- <ThemeProperties>
+ <ThemeProperties
+ match="#5680c2"
+ >
<space>
<ThemeSpaceGeneric
back="#b3b3b3"
diff --git a/release/scripts/startup/bl_ui/space_properties.py b/release/scripts/startup/bl_ui/space_properties.py
index 7d9ca687524..53b67a20115 100644
--- a/release/scripts/startup/bl_ui/space_properties.py
+++ b/release/scripts/startup/bl_ui/space_properties.py
@@ -23,11 +23,18 @@ from bpy.types import Header, Panel
class PROPERTIES_HT_header(Header):
bl_space_type = 'PROPERTIES'
- def draw(self, _context):
+ def draw(self, context):
layout = self.layout
+ view = context.space_data
layout.template_header()
+ layout.separator_spacer()
+
+ row = layout.row()
+ row.emboss = 'NONE'
+ row.operator("buttons.toggle_pin", icon=('PINNED' if view.use_pin_id else 'UNPINNED'), text="")
+
class PROPERTIES_PT_navigation_bar(Panel):
bl_space_type = 'PROPERTIES'
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c
index 955725f0ea7..a0a60630986 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -236,6 +236,8 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
*/
{
/* Keep this block, even when empty. */
+
+ FROM_DEFAULT_V4_UCHAR(space_properties.match);
}
#undef FROM_DEFAULT_V4_UCHAR
diff --git a/source/blender/draw/CMakeLists.txt b/source/blender/draw/CMakeLists.txt
index 4513760d190..089b656d76c 100644
--- a/source/blender/draw/CMakeLists.txt
+++ b/source/blender/draw/CMakeLists.txt
@@ -172,6 +172,8 @@ set(SRC
engines/eevee/eevee_lut.h
engines/eevee/eevee_private.h
engines/external/external_engine.h
+ engines/image/image_engine.h
+ engines/image/image_private.h
engines/workbench/workbench_engine.h
engines/workbench/workbench_private.h
engines/select/select_engine.h
diff --git a/source/blender/draw/engines/image/image_engine.c b/source/blender/draw/engines/image/image_engine.c
index 90bfb38dadf..2f380619c2c 100644
--- a/source/blender/draw/engines/image/image_engine.c
+++ b/source/blender/draw/engines/image/image_engine.c
@@ -141,15 +141,9 @@ static void image_cache_image(IMAGE_Data *vedata, Image *image, ImageUser *iuser
const bool use_premul_alpha = image->alpha_mode == IMA_ALPHA_PREMUL;
const bool is_tiled_texture = tex_tile_data != NULL;
const bool do_repeat = (!is_tiled_texture) && ((sima->flag & SI_DRAW_TILE) != 0);
- const bool is_zoom_out = sima->zoom < 1.0f;
-
- /* use interpolation filtering when zooming out */
- eGPUSamplerState state = 0;
- SET_FLAG_FROM_TEST(state, is_zoom_out, GPU_SAMPLER_FILTER);
int draw_flags = 0;
SET_FLAG_FROM_TEST(draw_flags, do_repeat, SIMA_DRAW_FLAG_DO_REPEAT);
-
if ((sima->flag & SI_USE_ALPHA) != 0) {
/* Show RGBA */
draw_flags |= SIMA_DRAW_FLAG_SHOW_ALPHA | SIMA_DRAW_FLAG_APPLY_ALPHA;
@@ -181,11 +175,11 @@ static void image_cache_image(IMAGE_Data *vedata, Image *image, ImageUser *iuser
GPUShader *shader = IMAGE_shader_image_get(is_tiled_texture);
DRWShadingGroup *shgrp = DRW_shgroup_create(shader, psl->image_pass);
if (is_tiled_texture) {
- DRW_shgroup_uniform_texture_ex(shgrp, "imageTileArray", pd->texture, state);
+ DRW_shgroup_uniform_texture_ex(shgrp, "imageTileArray", pd->texture, 0);
DRW_shgroup_uniform_texture(shgrp, "imageTileData", tex_tile_data);
}
else {
- DRW_shgroup_uniform_texture_ex(shgrp, "imageTexture", pd->texture, state);
+ DRW_shgroup_uniform_texture_ex(shgrp, "imageTexture", pd->texture, 0);
}
DRW_shgroup_uniform_vec2_copy(shgrp, "farNearDistances", far_near);
DRW_shgroup_uniform_vec4_copy(shgrp, "color", color);
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 10650da4b0e..b9a001a9571 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -367,6 +367,12 @@ void UI_block_translate(uiBlock *block, int x, int y)
BLI_rctf_translate(&block->rect, x, y);
}
+static bool ui_but_is_row_alignment_group(const uiBut *left, const uiBut *right)
+{
+ const bool is_same_align_group = (left->alignnr && (left->alignnr == right->alignnr));
+ return is_same_align_group && (left->rect.xmin < right->rect.xmin);
+}
+
static void ui_block_bounds_calc_text(uiBlock *block, float offset)
{
const uiStyle *style = UI_style_get();
@@ -385,7 +391,26 @@ static void ui_block_bounds_calc_text(uiBlock *block, float offset)
}
}
- if (bt->next && bt->rect.xmin < bt->next->rect.xmin) {
+ /* Skip all buttons that are in a horizontal alignment group.
+ * We don't want to split them appart (but still check the row's width and apply current
+ * offsets). */
+ if (bt->next && ui_but_is_row_alignment_group(bt, bt->next)) {
+ int width = 0;
+ int alignnr = bt->alignnr;
+ for (col_bt = bt; col_bt && col_bt->alignnr == alignnr; col_bt = col_bt->next) {
+ width += BLI_rctf_size_x(&col_bt->rect);
+ col_bt->rect.xmin += x1addval;
+ col_bt->rect.xmax += x1addval;
+ }
+ if (width > i) {
+ i = width;
+ }
+ /* Give the following code the last button in the alignment group, there might have to be a
+ * split immediately after. */
+ bt = col_bt ? col_bt->prev : NULL;
+ }
+
+ if (bt && bt->next && bt->rect.xmin < bt->next->rect.xmin) {
/* End of this column, and it's not the last one. */
for (col_bt = init_col_bt; col_bt->prev != bt; col_bt = col_bt->next) {
col_bt->rect.xmin = x1addval;
@@ -403,6 +428,17 @@ static void ui_block_bounds_calc_text(uiBlock *block, float offset)
/* Last column. */
for (col_bt = init_col_bt; col_bt; col_bt = col_bt->next) {
+ /* Recognize a horizontally arranged alignment group and skip its items. */
+ if (col_bt->next && ui_but_is_row_alignment_group(col_bt, col_bt->next)) {
+ int alignnr = col_bt->alignnr;
+ for (; col_bt && col_bt->alignnr == alignnr; col_bt = col_bt->next) {
+ /* pass */
+ }
+ }
+ if (!col_bt) {
+ break;
+ }
+
col_bt->rect.xmin = x1addval;
col_bt->rect.xmax = max_ff(x1addval + i + block->bounds, offset + block->minbounds);
@@ -3907,6 +3943,7 @@ uiBut *ui_but_change_type(uiBut *but, eButType new_type)
const bool found_layout = ui_layout_replace_but_ptr(but->layout, old_but_ptr, but);
BLI_assert(found_layout);
UNUSED_VARS_NDEBUG(found_layout);
+ ui_button_group_replace_but_ptr(but->layout, old_but_ptr, but);
}
}
}
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index 4661d0816ae..edaadd880d7 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -994,6 +994,7 @@ void ui_resources_free(void);
/* interface_layout.c */
void ui_layout_add_but(uiLayout *layout, uiBut *but);
bool ui_layout_replace_but_ptr(uiLayout *layout, const void *old_but_ptr, uiBut *new_but);
+void ui_button_group_replace_but_ptr(uiLayout *layout, const void *old_but_ptr, uiBut *new_but);
uiBut *ui_but_add_search(uiBut *but,
PointerRNA *ptr,
PropertyRNA *prop,
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index a37f87e593b..c3bcaff0d0c 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -80,12 +80,25 @@
/* uiLayoutRoot */
+/**
+ * A group of button references, used by property search to keep track of sets of buttons that
+ * should be searched together. For example, in property split layouts number buttons and their
+ * labels (and even their decorators) are separate buttons, but they must be searched and
+ * highlighted together.
+ */
+typedef struct uiButtonGroup {
+ void *next, *prev;
+ ListBase buttons; /* #LinkData with #uiBut data field. */
+} uiButtonGroup;
+
typedef struct uiLayoutRoot {
struct uiLayoutRoot *next, *prev;
int type;
int opcontext;
+ ListBase button_groups; /* #uiButtonGroup. */
+
int emw, emh;
int padding;
@@ -415,6 +428,58 @@ static void ui_item_move(uiItem *item, int delta_xmin, int delta_xmax)
/** \} */
/* -------------------------------------------------------------------- */
+/** \name Button Groups
+ * \{ */
+
+/**
+ * Every function that adds a set of buttons must create another group,
+ * then #ui_def_but adds buttons to the current group (the last).
+ */
+static void layout_root_new_button_group(uiLayoutRoot *root)
+{
+ uiButtonGroup *new_group = MEM_mallocN(sizeof(uiButtonGroup), __func__);
+ BLI_listbase_clear(&new_group->buttons);
+ BLI_addtail(&root->button_groups, new_group);
+}
+
+static void button_group_add_but(uiLayoutRoot *root, uiBut *but)
+{
+ BLI_assert(root != NULL);
+
+ uiButtonGroup *current_button_group = root->button_groups.last;
+ BLI_assert(current_button_group != NULL);
+
+ /* We can't use the button directly because adding it to
+ * this list would mess with its prev and next pointers. */
+ LinkData *button_link = BLI_genericNodeN(but);
+ BLI_addtail(&current_button_group->buttons, button_link);
+}
+
+static void button_group_free(uiButtonGroup *button_group)
+{
+ BLI_freelistN(&button_group->buttons);
+ MEM_freeN(button_group);
+}
+
+/* This function should be removed whenever #ui_layout_replace_but_ptr is removed. */
+void ui_button_group_replace_but_ptr(uiLayout *layout, const void *old_but_ptr, uiBut *new_but)
+{
+ LISTBASE_FOREACH (uiButtonGroup *, button_group, &layout->root->button_groups) {
+ LISTBASE_FOREACH (LinkData *, link, &button_group->buttons) {
+ if (link->data == old_but_ptr) {
+ link->data = new_but;
+ return;
+ }
+ }
+ }
+
+ /* The button should be in a group. */
+ BLI_assert(false);
+}
+
+/** \} */
+
+/* -------------------------------------------------------------------- */
/** \name Special RNA Items
* \{ */
@@ -1214,6 +1279,10 @@ static uiBut *uiItemFullO_ptr_ex(uiLayout *layout,
but->flag |= UI_SELECT_DRAW;
}
+ if (flag & UI_ITEM_R_ICON_ONLY) {
+ UI_but_drawflag_disable(but, UI_BUT_ICON_LEFT);
+ }
+
if (layout->redalert) {
UI_but_flag_enable(but, UI_BUT_REDALERT);
}
@@ -1434,6 +1503,26 @@ void uiItemsFullEnumO_items(uiLayout *layout,
if (radial) {
target = uiLayoutRadial(layout);
}
+ else if ((uiLayoutGetLocalDir(layout) == UI_LAYOUT_HORIZONTAL) && (flag & UI_ITEM_R_ICON_ONLY)) {
+ target = layout;
+ UI_block_layout_set_current(block, target);
+
+ /* Add a blank button to the beginning of the row. */
+ uiDefIconBut(block,
+ UI_BTYPE_LABEL,
+ 0,
+ ICON_BLANK1,
+ 0,
+ 0,
+ 1.25f * UI_UNIT_X,
+ UI_UNIT_Y,
+ NULL,
+ 0,
+ 0,
+ 0,
+ 0,
+ NULL);
+ }
else {
split = uiLayoutSplit(layout, 0.0f, false);
target = uiLayoutColumn(split, layout->align);
@@ -1481,7 +1570,14 @@ void uiItemsFullEnumO_items(uiLayout *layout,
}
RNA_property_enum_set(&tptr, prop, item->value);
- uiItemFullO_ptr(target, ot, item->name, item->icon, tptr.data, context, flag, NULL);
+ uiItemFullO_ptr(target,
+ ot,
+ (flag & UI_ITEM_R_ICON_ONLY) ? NULL : item->name,
+ item->icon,
+ tptr.data,
+ context,
+ flag,
+ NULL);
ui_but_tip_from_enum_item(block->buttons.last, item);
}
@@ -1489,7 +1585,7 @@ void uiItemsFullEnumO_items(uiLayout *layout,
if (item->name) {
uiBut *but;
- if (item != item_array && !radial) {
+ if (item != item_array && !radial && split != NULL) {
target = uiLayoutColumn(split, layout->align);
/* inconsistent, but menus with labels do not look good flipped */
@@ -1988,6 +2084,7 @@ void uiItemFullR(uiLayout *layout,
#endif /* UI_PROP_DECORATE */
UI_block_layout_set_current(block, layout);
+ layout_root_new_button_group(layout->root);
/* retrieve info */
const PropertyType type = RNA_property_type(prop);
@@ -2738,6 +2835,8 @@ void uiItemPointerR_prop(uiLayout *layout,
char namestr[UI_MAX_NAME_STR];
const bool use_prop_sep = ((layout->item.flag & UI_ITEM_PROP_SEP) != 0);
+ layout_root_new_button_group(layout->root);
+
type = RNA_property_type(prop);
if (!ELEM(type, PROP_POINTER, PROP_STRING, PROP_ENUM)) {
RNA_warning("Property %s.%s must be a pointer, string or enum",
@@ -2843,6 +2942,7 @@ static uiBut *ui_item_menu(uiLayout *layout,
int w, h;
UI_block_layout_set_current(block, layout);
+ layout_root_new_button_group(layout->root);
if (!name) {
name = "";
@@ -3110,6 +3210,7 @@ static uiBut *uiItemL_(uiLayout *layout, const char *name, int icon)
int w;
UI_block_layout_set_current(block, layout);
+ layout_root_new_button_group(layout->root);
if (!name) {
name = "";
@@ -5275,6 +5376,16 @@ static void ui_layout_free(uiLayout *layout)
MEM_freeN(layout);
}
+static void layout_root_free(uiLayoutRoot *root)
+{
+ ui_layout_free(root->layout);
+
+ LISTBASE_FOREACH_MUTABLE (uiButtonGroup *, button_group, &root->button_groups) {
+ button_group_free(button_group);
+ }
+ MEM_freeN(root);
+}
+
static void ui_layout_add_padding_button(uiLayoutRoot *root)
{
if (root->padding) {
@@ -5309,6 +5420,9 @@ uiLayout *UI_block_layout(uiBlock *block,
root->padding = padding;
root->opcontext = WM_OP_INVOKE_REGION_WIN;
+ BLI_listbase_clear(&root->button_groups);
+ layout_root_new_button_group(root);
+
layout = MEM_callocN(sizeof(uiLayout), "uiLayout");
layout->item.type = (type == UI_LAYOUT_VERT_BAR) ? ITEM_LAYOUT_COLUMN : ITEM_LAYOUT_ROOT;
@@ -5393,6 +5507,8 @@ void ui_layout_add_but(uiLayout *layout, uiBut *but)
if (layout->emboss != UI_EMBOSS_UNDEFINED) {
but->emboss = layout->emboss;
}
+
+ button_group_add_but(layout->root, but);
}
bool ui_layout_replace_but_ptr(uiLayout *layout, const void *old_but_ptr, uiBut *new_but)
@@ -5458,15 +5574,15 @@ void UI_block_layout_resolve(uiBlock *block, int *r_x, int *r_y)
block->curlayout = NULL;
- LISTBASE_FOREACH (uiLayoutRoot *, root, &block->layouts) {
+ LISTBASE_FOREACH_MUTABLE (uiLayoutRoot *, root, &block->layouts) {
ui_layout_add_padding_button(root);
/* NULL in advance so we don't interfere when adding button */
ui_layout_end(block, root->layout, r_x, r_y);
- ui_layout_free(root->layout);
+ layout_root_free(root);
}
- BLI_freelistN(&block->layouts);
+ BLI_listbase_clear(&block->layouts);
/* XXX silly trick, interface_templates.c doesn't get linked
* because it's not used by other files in this module? */
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 0cbb8f268a2..c7840aae07a 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -2378,7 +2378,7 @@ static void widget_draw_text_icon(const uiFontStyle *fstyle,
rect->xmin += 0.3f * U.widget_unit;
}
}
- else if (ui_block_is_menu(but->block)) {
+ else if (ui_block_is_menu(but->block) && but->alignnr == 0) {
rect->xmin += 0.2f * U.widget_unit;
}
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index 84a020a9ed7..2e10cc94004 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -1115,11 +1115,18 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
/************************* Drawing the Path ************************/
-void buttons_context_draw(const bContext *C, uiLayout *layout)
+static bool buttons_panel_context_poll(const bContext *C, PanelType *UNUSED(pt))
+{
+ SpaceProperties *sbuts = CTX_wm_space_properties(C);
+ return sbuts->mainb != BCONTEXT_TOOL;
+}
+
+static void buttons_panel_context_draw(const bContext *C, Panel *panel)
{
+ uiLayout *layout = panel->layout;
SpaceProperties *sbuts = CTX_wm_space_properties(C);
ButsContextPath *path = sbuts->path;
- uiLayout *row, *sub;
+ uiLayout *row;
PointerRNA *ptr;
char namebuf[128], *name;
int a, icon;
@@ -1180,52 +1187,11 @@ void buttons_context_draw(const bContext *C, uiLayout *layout)
}
}
}
-
- uiItemSpacer(row);
-
- sub = uiLayoutRow(row, false);
- uiLayoutSetEmboss(sub, UI_EMBOSS_NONE);
- uiItemO(sub,
- "",
- (sbuts->flag & SB_PIN_CONTEXT) ? ICON_PINNED : ICON_UNPINNED,
- "BUTTONS_OT_toggle_pin");
-}
-
-#ifdef USE_HEADER_CONTEXT_PATH
-static bool buttons_header_context_poll(const bContext *C, HeaderType *UNUSED(ht))
-#else
-static bool buttons_panel_context_poll(const bContext *C, PanelType *UNUSED(pt))
-#endif
-{
- SpaceProperties *sbuts = CTX_wm_space_properties(C);
- return (sbuts->mainb != BCONTEXT_TOOL);
-}
-
-#ifdef USE_HEADER_CONTEXT_PATH
-static void buttons_header_context_draw(const bContext *C, Header *ptr)
-#else
-static void buttons_panel_context_draw(const bContext *C, Panel *ptr)
-#endif
-{
- buttons_context_draw(C, ptr->layout);
}
void buttons_context_register(ARegionType *art)
{
-#ifdef USE_HEADER_CONTEXT_PATH
- HeaderType *ht;
-
- ht = MEM_callocN(sizeof(HeaderType), "spacetype buttons context header");
- strcpy(ht->idname, "BUTTONS_HT_context");
- ht->space_type = SPACE_PROPERTIES;
- ht->region_type = art->regionid;
- ht->poll = buttons_header_context_poll;
- ht->draw = buttons_header_context_draw;
- BLI_addtail(&art->headertypes, ht);
-#else
- PanelType *pt;
-
- pt = MEM_callocN(sizeof(PanelType), "spacetype buttons panel context");
+ PanelType *pt = MEM_callocN(sizeof(PanelType), "spacetype buttons panel context");
strcpy(pt->idname, "BUTTONS_PT_context");
strcpy(pt->label, N_("Context")); /* XXX C panels unavailable through RNA bpy.types! */
strcpy(pt->translation_context, BLT_I18NCONTEXT_DEFAULT_BPYRNA);
@@ -1233,7 +1199,6 @@ void buttons_context_register(ARegionType *art)
pt->draw = buttons_panel_context_draw;
pt->flag = PNL_NO_HEADER;
BLI_addtail(&art->paneltypes, pt);
-#endif
}
ID *buttons_context_id_path(const bContext *C)
diff --git a/source/blender/editors/space_buttons/buttons_intern.h b/source/blender/editors/space_buttons/buttons_intern.h
index a1e2b9e9aaf..76a4d72057f 100644
--- a/source/blender/editors/space_buttons/buttons_intern.h
+++ b/source/blender/editors/space_buttons/buttons_intern.h
@@ -37,9 +37,6 @@ struct bNodeTree;
struct uiLayout;
struct wmOperatorType;
-/* Display the context path in the header instead of the main window */
-#define USE_HEADER_CONTEXT_PATH
-
/* context data */
typedef struct ButsContextPath {
@@ -83,7 +80,6 @@ void buttons_context_compute(const struct bContext *C, struct SpaceProperties *s
int buttons_context(const struct bContext *C,
const char *member,
struct bContextDataResult *result);
-void buttons_context_draw(const struct bContext *C, struct uiLayout *layout);
void buttons_context_register(struct ARegionType *art);
struct ID *buttons_context_id_path(const struct bContext *C);
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c
index 377a9a6c1e4..25f8fecbf26 100644
--- a/source/blender/editors/space_buttons/space_buttons.c
+++ b/source/blender/editors/space_buttons/space_buttons.c
@@ -332,14 +332,6 @@ static void buttons_keymap(struct wmKeyConfig *keyconf)
/* add handlers, stuff you only do once or on area/region changes */
static void buttons_header_region_init(wmWindowManager *UNUSED(wm), ARegion *region)
{
-#ifdef USE_HEADER_CONTEXT_PATH
- /* Reinsert context buttons header-type at the end of the list so it's drawn last. */
- HeaderType *context_ht = BLI_findstring(
- &region->type->headertypes, "BUTTONS_HT_context", offsetof(HeaderType, idname));
- BLI_remlink(&region->type->headertypes, context_ht);
- BLI_addtail(&region->type->headertypes, context_ht);
-#endif
-
ED_region_header_init(region);
}
@@ -379,10 +371,6 @@ static void buttons_header_region_message_subscribe(const bContext *UNUSED(C),
if (sbuts->mainb == BCONTEXT_TOOL) {
WM_msg_subscribe_rna_anon_prop(mbus, WorkSpace, tools, &msg_sub_value_region_tag_redraw);
}
-
-#ifdef USE_HEADER_CONTEXT_PATH
- WM_msg_subscribe_rna_anon_prop(mbus, SpaceProperties, context, &msg_sub_value_region_tag_redraw);
-#endif
}
static void buttons_navigation_bar_region_init(wmWindowManager *wm, ARegion *region)
@@ -716,9 +704,7 @@ void ED_spacetype_buttons(void)
art->draw = ED_region_panels_draw;
art->listener = buttons_main_region_listener;
art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_FRAMES;
-#ifndef USE_HEADER_CONTEXT_PATH
buttons_context_register(art);
-#endif
BLI_addhead(&st->regiontypes, art);
/* Register the panel types from modifiers. The actual panels are built per modifier rather than
@@ -754,9 +740,6 @@ void ED_spacetype_buttons(void)
art->init = buttons_header_region_init;
art->draw = buttons_header_region_draw;
art->message_subscribe = buttons_header_region_message_subscribe;
-#ifdef USE_HEADER_CONTEXT_PATH
- buttons_context_register(art);
-#endif
BLI_addhead(&st->regiontypes, art);
/* regions: navigation bar */
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 662be2491a0..6efd95efe25 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -1524,6 +1524,8 @@ static void *sequencer_OCIO_transform_ibuf(const bContext *C,
* properly, in this case we fallback to CPU-based display transform. */
if ((ibuf->rect || ibuf->rect_float) && !*r_glsl_used) {
display_buffer = IMB_display_buffer_acquire_ctx(C, ibuf, &cache_handle);
+ *r_format = GPU_RGBA8;
+ *r_data = GPU_DATA_UNSIGNED_BYTE;
}
if (cache_handle) {
IMB_display_buffer_release(cache_handle);
diff --git a/source/blender/editors/util/CMakeLists.txt b/source/blender/editors/util/CMakeLists.txt
index e05d1fedf6d..b09676fa547 100644
--- a/source/blender/editors/util/CMakeLists.txt
+++ b/source/blender/editors/util/CMakeLists.txt
@@ -51,6 +51,7 @@ set(SRC
../include/ED_curve.h
../include/ED_datafiles.h
../include/ED_fileselect.h
+ ../include/ED_geometry.h
../include/ED_gizmo_library.h
../include/ED_gizmo_utils.h
../include/ED_gpencil.h
diff --git a/source/blender/functions/CMakeLists.txt b/source/blender/functions/CMakeLists.txt
index ad29dbe6668..9a6b6f4a4db 100644
--- a/source/blender/functions/CMakeLists.txt
+++ b/source/blender/functions/CMakeLists.txt
@@ -68,7 +68,7 @@ if(WITH_GTESTS)
tests/FN_multi_function_test.cc
tests/FN_spans_test.cc
)
- set (TEST_LIB
+ set(TEST_LIB
bf_functions
)
include(GTestTesting)
diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt
index b763ea2a528..2dd61a3548b 100644
--- a/source/blender/gpu/CMakeLists.txt
+++ b/source/blender/gpu/CMakeLists.txt
@@ -116,6 +116,7 @@ set(SRC
GPU_debug.h
GPU_drawlist.h
GPU_framebuffer.h
+ GPU_glew.h
GPU_immediate.h
GPU_immediate_util.h
GPU_index_buffer.h
@@ -139,6 +140,7 @@ set(SRC
intern/gpu_capabilities_private.hh
intern/gpu_codegen.h
intern/gpu_context_private.hh
+ intern/gpu_debug_private.hh
intern/gpu_drawlist_private.hh
intern/gpu_framebuffer_private.hh
intern/gpu_immediate_private.hh
@@ -384,6 +386,8 @@ if(WITH_GTESTS)
if(WITH_OPENGL_DRAW_TESTS)
set(TEST_SRC
tests/gpu_testing.cc
+
+ tests/gpu_testing.hh
)
set(TEST_INC
"../../../intern/ghost/"
diff --git a/source/blender/gpu/intern/gpu_index_buffer.cc b/source/blender/gpu/intern/gpu_index_buffer.cc
index 5448e6efbe4..36f18f2da49 100644
--- a/source/blender/gpu/intern/gpu_index_buffer.cc
+++ b/source/blender/gpu/intern/gpu_index_buffer.cc
@@ -296,7 +296,7 @@ void IndexBuf::squeeze_indices_short(uint min_idx, uint max_idx)
if (max_idx >= 0xFFFF) {
index_base_ = min_idx;
for (uint i = 0; i < index_len_; i++) {
- ushort_idx[i] = (uint16_t)MAX2(0xFFFF, uint_idx[i] - min_idx);
+ ushort_idx[i] = (uint16_t)MIN2(0xFFFF, uint_idx[i] - min_idx);
}
}
else {
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index 8dfa54b95da..76d76b0a913 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -346,6 +346,15 @@ static PointerRNA rna_uiItemOMenuHold(uiLayout *layout,
return opptr;
}
+static void rna_uiItemsEnumO(uiLayout *layout,
+ const char *opname,
+ const char *propname,
+ const bool icon_only)
+{
+ int flag = icon_only ? UI_ITEM_R_ICON_ONLY : 0;
+ uiItemsFullEnumO(layout, opname, propname, NULL, uiLayoutGetOperatorContext(layout), flag);
+}
+
static void rna_uiItemMenuEnumO(uiLayout *layout,
bContext *C,
const char *opname,
@@ -972,11 +981,12 @@ void RNA_api_ui_layout(StructRNA *srna)
"Item. Places a button into the layout to call an Operator");
}
- func = RNA_def_function(srna, "operator_enum", "uiItemsEnumO");
+ func = RNA_def_function(srna, "operator_enum", "rna_uiItemsEnumO");
parm = RNA_def_string(func, "operator", NULL, 0, "", "Identifier of the operator");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in operator");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
+ RNA_def_boolean(func, "icon_only", false, "", "Draw only icons in buttons, no text");
func = RNA_def_function(srna, "operator_menu_enum", "rna_uiItemMenuEnumO");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 1ecd0a581b6..868c804b4a3 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -2952,7 +2952,7 @@ static void rna_def_userdef_theme_space_node(BlenderRNA *brna)
static void rna_def_userdef_theme_space_buts(BlenderRNA *brna)
{
StructRNA *srna;
- // PropertyRNA *prop;
+ PropertyRNA *prop;
/* space_buts */
@@ -2961,6 +2961,11 @@ static void rna_def_userdef_theme_space_buts(BlenderRNA *brna)
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Theme Properties", "Theme settings for the Properties");
+ prop = RNA_def_property(srna, "match", PROP_FLOAT, PROP_COLOR_GAMMA);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Search Match", "");
+ RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
+
rna_def_userdef_theme_spaces_main(srna);
}
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 2798cec8c58..43f77556ba1 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1156,7 +1156,7 @@ if(WIN32)
set_target_properties(blender PROPERTIES
PDB_NAME "blender_private"
PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>")
- if (WITH_WINDOWS_PDB AND WITH_WINDOWS_STRIPPED_PDB)
+ if(WITH_WINDOWS_PDB AND WITH_WINDOWS_STRIPPED_PDB)
# This is slightly messy, but single target generators like ninja will not have the
# CMAKE_CFG_INTDIR variable and multitarget generators like msbuild will not have
# CMAKE_BUILD_TYPE. This can be simplified by target_link_options and the $<CONFIG>
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 8f72db07d92..8941cc671dd 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -30,7 +30,7 @@ endif()
# The installation directory's Python is the best one to use. However, it can only be there after the install step,
# which means that Python will never be there on a fresh system. To suit different needs, the user can pass
# -DTEST_PYTHON_EXE=/path/to/python to CMake.
-if (NOT TEST_PYTHON_EXE)
+if(NOT TEST_PYTHON_EXE)
set(TEST_PYTHON_EXE ${_default_test_python_exe})
message(STATUS "Tests: Using Python executable: ${TEST_PYTHON_EXE}")
elseif(NOT EXISTS ${TEST_PYTHON_EXE})