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:
authorBastien Montagne <montagne29@wanadoo.fr>2017-10-12 17:40:35 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2017-10-12 17:40:35 +0300
commit557dc7d34353992058451851a6ec1068d25b13d4 (patch)
tree8c86daa924fdf1d8c82fb0236789b3160e016755 /source/blender
parent5f025a7e5e043a2dbdebf66668217fbae591ef89 (diff)
parenta51688d0b066f00d5912d677d0f4bdad08b28ea6 (diff)
Merge branch 'master' into blender2.8
Conflicts: source/blender/editors/screen/screen_edit.c
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/scene.c4
-rw-r--r--source/blender/editors/include/UI_interface.h2
-rw-r--r--source/blender/editors/interface/interface.c21
-rw-r--r--source/blender/editors/interface/interface_regions.c5
-rw-r--r--source/blender/python/bmesh/bmesh_py_utils.c4
5 files changed, 25 insertions, 11 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index d36f128cef1..6b2d809c31a 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -420,7 +420,7 @@ Scene *BKE_scene_copy(Main *bmain, Scene *sce, int type)
ListBase rl, rv;
sce_copy = BKE_scene_add(bmain, sce->id.name + 2);
-
+
rl = sce_copy->r.layers;
rv = sce_copy->r.views;
curvemapping_free_data(&sce_copy->r.mblur_shutter_curve);
@@ -517,6 +517,8 @@ Scene *BKE_scene_copy(Main *bmain, Scene *sce, int type)
}
else {
BKE_id_copy_ex(bmain, (ID *)sce, (ID **)&sce_copy, LIB_ID_COPY_ACTIONS, false);
+ id_us_min(&sce_copy->id);
+ id_us_ensure_real(&sce_copy->id);
/* Extra actions, most notably SCE_FULL_COPY also duplicates several 'children' datablocks... */
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index f6826deaf3a..158cc53dfb3 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -444,7 +444,7 @@ void UI_popup_block_close(struct bContext *C, struct wmWindow *win, uiBlock *blo
* */
uiBlock *UI_block_begin(const struct bContext *C, struct ARegion *region, const char *name, short dt);
-void UI_block_end_ex(const struct bContext *C, uiBlock *block, const int xy[2]);
+void UI_block_end_ex(const struct bContext *C, uiBlock *block, const int xy[2], int r_xy[2]);
void UI_block_end(const struct bContext *C, uiBlock *block);
void UI_block_draw(const struct bContext *C, struct uiBlock *block);
void UI_block_update_from_old(const struct bContext *C, struct uiBlock *block);
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 5eb1d362394..35cbcccf515 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -367,10 +367,10 @@ static void ui_block_bounds_calc_centered_pie(uiBlock *block)
static void ui_block_bounds_calc_popup(
wmWindow *window, uiBlock *block,
- eBlockBoundsCalc bounds_calc, const int xy[2])
+ eBlockBoundsCalc bounds_calc, const int xy[2], int r_xy[2])
{
int width, height, oldwidth, oldheight;
- int oldbounds, xmax, ymax;
+ int oldbounds, xmax, ymax, raw_x, raw_y;
const int margin = UI_SCREEN_MARGIN;
rcti rect, rect_bounds;
int ofs_dummy[2];
@@ -408,8 +408,8 @@ static void ui_block_bounds_calc_popup(
/* offset block based on mouse position, user offset is scaled
* along in case we resized the block in ui_block_bounds_calc_text */
- rect.xmin = xy[0] + block->rect.xmin + (block->mx * width) / oldwidth;
- rect.ymin = xy[1] + block->rect.ymin + (block->my * height) / oldheight;
+ raw_x = rect.xmin = xy[0] + block->rect.xmin + (block->mx * width) / oldwidth;
+ raw_y = rect.ymin = xy[1] + block->rect.ymin + (block->my * height) / oldheight;
rect.xmax = rect.xmin + width;
rect.ymax = rect.ymin + height;
@@ -423,6 +423,13 @@ static void ui_block_bounds_calc_popup(
/* now recompute bounds and safety */
ui_block_bounds_calc(block);
+
+ /* If given, adjust input coordinates such that they would generate real final popup position.
+ * Needed to handle correctly floating panels once they have been dragged around, see T52999. */
+ if (r_xy) {
+ r_xy[0] = xy[0] + block->rect.xmin - raw_x;
+ r_xy[1] = xy[1] + block->rect.ymin - raw_y;
+ }
}
/* used for various cases */
@@ -1233,7 +1240,7 @@ void UI_block_update_from_old(const bContext *C, uiBlock *block)
block->oldblock = NULL;
}
-void UI_block_end_ex(const bContext *C, uiBlock *block, const int xy[2])
+void UI_block_end_ex(const bContext *C, uiBlock *block, const int xy[2], int r_xy[2])
{
wmWindow *window = CTX_wm_window(C);
Scene *scene = CTX_data_scene(C);
@@ -1301,7 +1308,7 @@ void UI_block_end_ex(const bContext *C, uiBlock *block, const int xy[2])
/* fallback */
case UI_BLOCK_BOUNDS_POPUP_MOUSE:
case UI_BLOCK_BOUNDS_POPUP_MENU:
- ui_block_bounds_calc_popup(window, block, block->bounds_type, xy);
+ ui_block_bounds_calc_popup(window, block, block->bounds_type, xy, r_xy);
break;
}
@@ -1319,7 +1326,7 @@ void UI_block_end(const bContext *C, uiBlock *block)
{
wmWindow *window = CTX_wm_window(C);
- UI_block_end_ex(C, block, &window->eventstate->x);
+ UI_block_end_ex(C, block, &window->eventstate->x, NULL);
}
/* ************** BLOCK DRAWING FUNCTION ************* */
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index 57290c47210..aabb165b483 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -1877,8 +1877,9 @@ uiBlock *ui_popup_block_refresh(
/* defer this until blocks are translated (below) */
block->oldblock = NULL;
- if (!block->endblock)
- UI_block_end_ex(C, block, handle->popup_create_vars.event_xy);
+ if (!block->endblock) {
+ UI_block_end_ex(C, block, handle->popup_create_vars.event_xy, handle->popup_create_vars.event_xy);
+ }
/* if this is being created from a button */
if (but) {
diff --git a/source/blender/python/bmesh/bmesh_py_utils.c b/source/blender/python/bmesh/bmesh_py_utils.c
index 89c196dbcad..fc0cd9e475b 100644
--- a/source/blender/python/bmesh/bmesh_py_utils.c
+++ b/source/blender/python/bmesh/bmesh_py_utils.c
@@ -565,6 +565,10 @@ PyDoc_STRVAR(bpy_bm_utils_face_split_edgenet_doc,
" :type edgenet: :class:`bmesh.types.BMEdge`\n"
" :return: The newly created faces.\n"
" :rtype: tuple of (:class:`bmesh.types.BMFace`)\n"
+"\n"
+" .. note::\n"
+"\n"
+" Regions defined by edges need to connect to the face, otherwise they're ignored as loose edges.\n"
);
static PyObject *bpy_bm_utils_face_split_edgenet(PyObject *UNUSED(self), PyObject *args, PyObject *kw)
{