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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-12-01 06:47:59 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-12-01 06:47:59 +0400
commited0e2fbd9f4edd55e11df694b34e233cb38cb953 (patch)
tree70a0d0fc080339b87cbeb73ebab6d4eda91ca5ba /source/blender/editors
parent129a29873e552d769339c2b7d3b99a0afbbf2ae0 (diff)
parent75cce01a614e686530e26dbd186a88d75dc4e7b5 (diff)
Merged changes in the trunk up to revision 52690.
Conflicts resolved: release/datafiles/startup.blend source/blender/blenlib/intern/bpath.c
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/animation/anim_markers.c23
-rw-r--r--source/blender/editors/include/ED_view3d.h9
-rw-r--r--source/blender/editors/include/UI_interface.h3
-rw-r--r--source/blender/editors/interface/interface.c1
-rw-r--r--source/blender/editors/interface/interface_regions.c15
-rw-r--r--source/blender/editors/interface/interface_templates.c8
-rw-r--r--source/blender/editors/mesh/editmesh_add.c21
-rw-r--r--source/blender/editors/mesh/editmesh_knife.c4
-rw-r--r--source/blender/editors/mesh/editmesh_loopcut.c14
-rw-r--r--source/blender/editors/mesh/editmesh_rip.c2
-rw-r--r--source/blender/editors/mesh/editmesh_select.c12
-rw-r--r--source/blender/editors/mesh/editmesh_slide.c18
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c72
-rw-r--r--source/blender/editors/mesh/editmesh_utils.c11
-rw-r--r--source/blender/editors/mesh/mesh_navmesh.c4
-rw-r--r--source/blender/editors/object/object_add.c2
-rw-r--r--source/blender/editors/object/object_relations.c6
-rw-r--r--source/blender/editors/object/object_vgroup.c16
-rw-r--r--source/blender/editors/physics/particle_edit.c2
-rw-r--r--source/blender/editors/render/render_internal.c17
-rw-r--r--source/blender/editors/render/render_shading.c4
-rw-r--r--source/blender/editors/render/render_update.c11
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_utils.c4
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c9
-rw-r--r--source/blender/editors/space_buttons/space_buttons.c2
-rw-r--r--source/blender/editors/space_clip/tracking_ops.c2
-rw-r--r--source/blender/editors/space_node/node_edit.c31
-rw-r--r--source/blender/editors/space_node/space_node.c2
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.c2
-rw-r--r--source/blender/editors/space_outliner/outliner_edit.c7
-rw-r--r--source/blender/editors/space_outliner/outliner_select.c2
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.c2
-rw-r--r--source/blender/editors/space_outliner/space_outliner.c6
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c2
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c1
-rw-r--r--source/blender/editors/space_view3d/drawmesh.c7
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c1
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c22
-rw-r--r--source/blender/editors/space_view3d/view3d_iterators.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_toolbar.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c55
-rw-r--r--source/blender/editors/transform/CMakeLists.txt1
-rw-r--r--source/blender/editors/transform/SConscript2
-rw-r--r--source/blender/editors/transform/transform.c12
-rw-r--r--source/blender/editors/transform/transform_conversions.c10
-rw-r--r--source/blender/editors/util/numinput.c3
-rw-r--r--source/blender/editors/uvedit/uvedit_ops.c104
-rw-r--r--source/blender/editors/uvedit/uvedit_smart_stitch.c12
-rw-r--r--source/blender/editors/uvedit/uvedit_unwrap_ops.c2
51 files changed, 388 insertions, 198 deletions
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index 4ac7b61fccb..62ffdc7fd3a 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -732,7 +732,7 @@ static void ed_marker_move_apply(bContext *C, wmOperator *op)
/* so we get view3d redraws */
BKE_scene_camera_switch_update(scene);
- if(camera != scene->camera) {
+ if (camera != scene->camera) {
BKE_screen_view3d_scene_sync(sc);
WM_event_add_notifier(C, NC_SCENE | NA_EDITED, scene);
}
@@ -860,16 +860,21 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt)
}
if (evt->val == KM_PRESS) {
- float vec;
- char str_tx[NUM_STR_REP_LEN];
-
if (handleNumInput(&mm->num, evt)) {
- applyNumInput(&mm->num, &vec);
- outputNumInput(&mm->num, str_tx);
-
- RNA_int_set(op->ptr, "frames", vec);
+ char str_tx[NUM_STR_REP_LEN];
+ float value = RNA_int_get(op->ptr, "frames");
+ applyNumInput(&mm->num, &value);
+
+ if (hasNumInput(&mm->num)) {
+ outputNumInput(&mm->num, str_tx);
+ }
+ else {
+ BLI_snprintf(str_tx, sizeof(str_tx), "%d", (int)value);
+ }
+
+ RNA_int_set(op->ptr, "frames", value);
ed_marker_move_apply(C, op);
- // ed_marker_header_update(C, op, str, (int)vec[0]);
+ // ed_marker_header_update(C, op, str, (int)value);
// strcat(str, str_tx);
BLI_snprintf(str, sizeof(str), "Marker offset %s", str_tx);
ED_area_headerprint(CTX_wm_area(C), str);
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index bd85e93f1af..d5c9b9ef01a 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -100,11 +100,6 @@ void ED_view3d_depth_tag_update(struct RegionView3D *rv3d);
/* Projection */
#define IS_CLIPPED 12000
-/* TODO, these functions work quite differently, we should make them behave in a uniform way
- * otherwise we can't be sure bugs are not added when we need to move from short->float types for eg
- * - Campbell */
-
-
/* return values for ED_view3d_project_...() */
typedef enum {
V3D_PROJ_RET_OK = 0,
@@ -220,6 +215,9 @@ void ED_view3d_clipping_disable(void);
float ED_view3d_pixel_size(struct RegionView3D *rv3d, const float co[3]);
+float ED_view3d_radius_to_persp_dist(const float angle, const float radius);
+float ED_view3d_radius_to_ortho_dist(const float lens, const float radius);
+
void drawcircball(int mode, const float cent[3], float rad, float tmat[][4]);
/* backbuffer select and draw support */
@@ -295,6 +293,7 @@ struct BGpic *ED_view3D_background_image_new(struct View3D *v3d);
void ED_view3D_background_image_remove(struct View3D *v3d, struct BGpic *bgpic);
void ED_view3D_background_image_clear(struct View3D *v3d);
+#define VIEW3D_MARGIN 1.4f
float ED_view3d_offset_distance(float mat[4][4], float ofs[3]);
float ED_view3d_grid_scale(struct Scene *scene, struct View3D *v3d, const char **grid_unit);
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 3645f13f27a..f5c943fbb87 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -615,7 +615,8 @@ int uiSearchItemAdd(uiSearchItems *items, const char *name, void *poin, int
/* bfunc gets search item *poin as arg2, or if NULL the old string */
void uiButSetSearchFunc(uiBut *but, uiButSearchFunc sfunc, void *arg1, uiButHandleFunc bfunc, void *active);
/* height in pixels, it's using hardcoded values still */
-int uiSearchBoxhHeight(void);
+int uiSearchBoxHeight(void);
+int uiSearchBoxWidth(void);
void uiBlockSetHandleFunc(uiBlock *block, uiBlockHandleFunc func, void *arg);
void uiBlockSetButmFunc(uiBlock *block, uiMenuHandleFunc func, void *arg);
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 535239cd462..9037afc472a 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -2826,6 +2826,7 @@ static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *s
EnumPropertyItem *item;
int i, totitem, free;
+ /* TODO, translate after getting the item, saves many lookups */
RNA_property_enum_items_gettexted(block->evil_C, ptr, prop, &item, &totitem, &free);
for (i = 0; i < totitem; i++) {
if (item[i].identifier[0] && item[i].value == (int)max) {
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index c1547593f96..7c099de9c1e 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -826,11 +826,17 @@ int uiSearchItemAdd(uiSearchItems *items, const char *name, void *poin, int icon
return 1;
}
-int uiSearchBoxhHeight(void)
+int uiSearchBoxHeight(void)
{
return SEARCH_ITEMS * UI_UNIT_Y + 2 * MENU_TOP;
}
+int uiSearchBoxWidth(void)
+{
+ /* was hardcoded at 150 */
+ return 9 * UI_UNIT_X;
+}
+
/* ar is the search box itself */
static void ui_searchbox_select(bContext *C, ARegion *ar, uiBut *but, int step)
{
@@ -1191,10 +1197,11 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but)
}
}
else {
+ const int searchbox_width = uiSearchBoxWidth();
rect_fl.xmin = but->rect.xmin - 5; /* align text with button */
rect_fl.xmax = but->rect.xmax + 5; /* symmetrical */
rect_fl.ymax = but->rect.ymin;
- rect_fl.ymin = rect_fl.ymax - uiSearchBoxhHeight();
+ rect_fl.ymin = rect_fl.ymax - uiSearchBoxHeight();
ofsx = (but->block->panel) ? but->block->panel->ofsx : 0;
ofsy = (but->block->panel) ? but->block->panel->ofsy : 0;
@@ -1202,8 +1209,8 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but)
BLI_rctf_translate(&rect_fl, ofsx, ofsy);
/* minimal width */
- if (BLI_rctf_size_x(&rect_fl) < 150) {
- rect_fl.xmax = rect_fl.xmin + 150; /* XXX arbitrary */
+ if (BLI_rctf_size_x(&rect_fl) < searchbox_width) {
+ rect_fl.xmax = rect_fl.xmin + searchbox_width;
}
/* copy to int, gets projected if possible too */
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 4dbdb977d36..e90fc1d4695 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -191,10 +191,12 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem)
}
/* list view */
else {
+ const int searchbox_width = uiSearchBoxWidth();
+ const int searchbox_height = uiSearchBoxHeight();
/* fake button, it holds space for search items */
- uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL);
+ uiDefBut(block, LABEL, 0, "", 10, 15, searchbox_width, searchbox_height, NULL, 0, 0, 0, 0, NULL);
- but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, 150, 19, 0, 0, "");
+ but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, searchbox_width, UI_UNIT_Y - 1, 0, 0, "");
uiButSetSearchFunc(but, id_search_cb, &template, id_search_call_cb, idptr.data);
}
@@ -787,7 +789,7 @@ static int modifier_can_delete(ModifierData *md)
return 1;
}
-/* Check wheter Modifier is a simulation or not, this is used for switching to the physics/particles context tab */
+/* Check whether Modifier is a simulation or not, this is used for switching to the physics/particles context tab */
static int modifier_is_simulation(ModifierData *md)
{
/* Physic Tab */
diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c
index 65d70e231a4..cd6063b12d0 100644
--- a/source/blender/editors/mesh/editmesh_add.c
+++ b/source/blender/editors/mesh/editmesh_add.c
@@ -86,7 +86,8 @@ static void make_prim_finish(bContext *C, Object *obedit, int *state, int enter_
* to push this up to edges & faces. */
EDBM_selectmode_flush_ex(em, SCE_SELECT_VERTEX);
- EDBM_update_generic(C, em, TRUE);
+ /* only recalc editmode tessface if we are staying in editmode */
+ EDBM_update_generic(C, em, enter_editmode);
/* userdef */
if (*state && !enter_editmode) {
@@ -109,7 +110,7 @@ static int add_primitive_plane_exec(bContext *C, wmOperator *op)
em = BMEdit_FromObject(obedit);
if (!EDBM_op_call_and_selectf(em, op, "verts.out",
- "create_grid x_segments=%i y_segments=%i size=%f mat=%m4", 1, 1, dia, mat))
+ "create_grid x_segments=%i y_segments=%i size=%f matrix=%m4", 1, 1, dia, mat))
{
return OPERATOR_CANCELLED;
}
@@ -149,7 +150,7 @@ static int add_primitive_cube_exec(bContext *C, wmOperator *op)
obedit = make_prim_init(C, "Cube", &dia, mat, &state, loc, rot, layer);
em = BMEdit_FromObject(obedit);
- if (!EDBM_op_call_and_selectf(em, op, "verts.out", "create_cube mat=%m4 size=%f", mat, dia * 2.0f)) {
+ if (!EDBM_op_call_and_selectf(em, op, "verts.out", "create_cube matrix=%m4 size=%f", mat, dia * 2.0f)) {
return OPERATOR_CANCELLED;
}
@@ -199,7 +200,7 @@ static int add_primitive_circle_exec(bContext *C, wmOperator *op)
em = BMEdit_FromObject(obedit);
if (!EDBM_op_call_and_selectf(em, op, "verts.out",
- "create_circle segments=%i diameter=%f cap_ends=%b cap_tris=%b mat=%m4",
+ "create_circle segments=%i diameter=%f cap_ends=%b cap_tris=%b matrix=%m4",
RNA_int_get(op->ptr, "vertices"), RNA_float_get(op->ptr, "radius") * dia,
cap_end, cap_tri, mat))
{
@@ -254,7 +255,7 @@ static int add_primitive_cylinder_exec(bContext *C, wmOperator *op)
if (!EDBM_op_call_and_selectf(
em, op, "verts.out",
- "create_cone segments=%i diameter1=%f diameter2=%f cap_ends=%b cap_tris=%b depth=%f mat=%m4",
+ "create_cone segments=%i diameter1=%f diameter2=%f cap_ends=%b cap_tris=%b depth=%f matrix=%m4",
RNA_int_get(op->ptr, "vertices"),
RNA_float_get(op->ptr, "radius") * dia,
RNA_float_get(op->ptr, "radius") * dia,
@@ -314,7 +315,7 @@ static int add_primitive_cone_exec(bContext *C, wmOperator *op)
if (!EDBM_op_call_and_selectf(
em, op, "verts.out",
- "create_cone segments=%i diameter1=%f diameter2=%f cap_ends=%b cap_tris=%b depth=%f mat=%m4",
+ "create_cone segments=%i diameter1=%f diameter2=%f cap_ends=%b cap_tris=%b depth=%f matrix=%m4",
RNA_int_get(op->ptr, "vertices"), RNA_float_get(op->ptr, "radius1") * dia,
RNA_float_get(op->ptr, "radius2") * dia, cap_end, cap_tri, RNA_float_get(op->ptr, "depth") * dia, mat))
{
@@ -369,7 +370,7 @@ static int add_primitive_grid_exec(bContext *C, wmOperator *op)
em = BMEdit_FromObject(obedit);
if (!EDBM_op_call_and_selectf(em, op, "verts.out",
- "create_grid x_segments=%i y_segments=%i size=%f mat=%m4",
+ "create_grid x_segments=%i y_segments=%i size=%f matrix=%m4",
RNA_int_get(op->ptr, "x_subdivisions"),
RNA_int_get(op->ptr, "y_subdivisions"),
RNA_float_get(op->ptr, "size") * dia, mat))
@@ -427,7 +428,7 @@ static int add_primitive_monkey_exec(bContext *C, wmOperator *op)
em = BMEdit_FromObject(obedit);
- if (!EDBM_op_call_and_selectf(em, op, "verts.out", "create_monkey mat=%m4", mat)) {
+ if (!EDBM_op_call_and_selectf(em, op, "verts.out", "create_monkey matrix=%m4", mat)) {
return OPERATOR_CANCELLED;
}
@@ -467,7 +468,7 @@ static int add_primitive_uvsphere_exec(bContext *C, wmOperator *op)
em = BMEdit_FromObject(obedit);
if (!EDBM_op_call_and_selectf(em, op, "verts.out",
- "create_uvsphere u_segments=%i v_segments=%i diameter=%f mat=%m4",
+ "create_uvsphere u_segments=%i v_segments=%i diameter=%f matrix=%m4",
RNA_int_get(op->ptr, "segments"), RNA_int_get(op->ptr, "ring_count"),
RNA_float_get(op->ptr, "size") * dia, mat))
{
@@ -519,7 +520,7 @@ static int add_primitive_icosphere_exec(bContext *C, wmOperator *op)
if (!EDBM_op_call_and_selectf(
em, op, "verts.out",
- "create_icosphere subdivisions=%i diameter=%f mat=%m4",
+ "create_icosphere subdivisions=%i diameter=%f matrix=%m4",
RNA_int_get(op->ptr, "subdivisions"),
RNA_float_get(op->ptr, "size") * dia, mat))
{
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c
index aed16be5b73..9dc68848c69 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -1965,7 +1965,7 @@ static void knifenet_fill_faces(KnifeTool_OpData *kcd)
kfe->e = NULL;
}
- kfe->e = BM_edge_create(bm, kfe->v1->v, kfe->v2->v, NULL, TRUE);
+ kfe->e = BM_edge_create(bm, kfe->v1->v, kfe->v2->v, NULL, BM_CREATE_NO_DOUBLE);
BMO_elem_flag_enable(bm, kfe->e, BOUNDARY);
for (ref = kfe->faces.first; ref; ref = ref->next) {
@@ -2067,7 +2067,7 @@ static void knifenet_fill_faces(KnifeTool_OpData *kcd)
}
}
- BLI_scanfill_calc(&sf_ctx, FALSE);
+ BLI_scanfill_calc(&sf_ctx, 0);
for (sf_tri = sf_ctx.fillfacebase.first; sf_tri; sf_tri = sf_tri->next) {
BMVert *v1 = sf_tri->v3->tmp.p, *v2 = sf_tri->v2->tmp.p, *v3 = sf_tri->v1->tmp.p;
diff --git a/source/blender/editors/mesh/editmesh_loopcut.c b/source/blender/editors/mesh/editmesh_loopcut.c
index f951073155d..dec45b7f326 100644
--- a/source/blender/editors/mesh/editmesh_loopcut.c
+++ b/source/blender/editors/mesh/editmesh_loopcut.c
@@ -261,7 +261,11 @@ static void edgering_sel(RingSelOpData *lcd, int previewlines, int select)
lasteed = eed;
}
+#ifdef BMW_EDGERING_NGON
if (lasteed != startedge && BM_edge_share_face_check(lasteed, startedge)) {
+#else
+ if (lasteed != startedge && BM_edge_share_quad_check(lasteed, startedge)) {
+#endif
v[1][0] = v[0][0];
v[1][1] = v[0][1];
@@ -309,6 +313,11 @@ static void ringsel_finish(bContext *C, wmOperator *op)
RingSelOpData *lcd = op->customdata;
const int cuts = RNA_int_get(op->ptr, "number_cuts");
const float smoothness = 0.292f * RNA_float_get(op->ptr, "smoothness");
+#ifdef BMW_EDGERING_NGON
+ const int use_only_quads = FALSE;
+#else
+ const int use_only_quads = TRUE;
+#endif
if (lcd->eed) {
BMEditMesh *em = lcd->em;
@@ -322,7 +331,8 @@ static void ringsel_finish(bContext *C, wmOperator *op)
BM_mesh_esubdivide(em->bm, BM_ELEM_SELECT,
smoothness, 0.0f, 0.0f,
cuts,
- SUBDIV_SELECT_LOOPCUT, SUBD_PATH, 0, TRUE, 0);
+ SUBDIV_SELECT_LOOPCUT, SUBD_PATH, 0, TRUE,
+ use_only_quads, 0);
/* force edge slide to edge select mode in in face select mode */
if (em->selectmode & SCE_SELECT_FACE) {
@@ -552,9 +562,9 @@ static int loopcut_modal(bContext *C, wmOperator *op, wmEvent *event)
/* using the keyboard to input the number of cuts */
if (event->val == KM_PRESS) {
/* init as zero so backspace clears */
- float value = 0.0f;
if (handleNumInput(&lcd->num, event)) {
+ float value = RNA_int_get(op->ptr, "number_cuts");
applyNumInput(&lcd->num, &value);
/* allow zero so you can backspace and type in a value
diff --git a/source/blender/editors/mesh/editmesh_rip.c b/source/blender/editors/mesh/editmesh_rip.c
index d3a4c951e06..2ecc20b2ddb 100644
--- a/source/blender/editors/mesh/editmesh_rip.c
+++ b/source/blender/editors/mesh/editmesh_rip.c
@@ -60,7 +60,7 @@
*
* \param inset is used so we get some useful distance
* when comparing multiple edges that meet at the same
- * point and would result in teh same distance.
+ * point and would result in the same distance.
*/
#define INSET_DEFAULT 0.00001f
static float edbm_rip_edgedist(ARegion *ar, float mat[][4],
diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c
index 2f40d281505..cb1b4ebba72 100644
--- a/source/blender/editors/mesh/editmesh_select.c
+++ b/source/blender/editors/mesh/editmesh_select.c
@@ -734,7 +734,7 @@ static int similar_face_select_exec(bContext *C, wmOperator *op)
EDBM_flag_disable_all(em, BM_ELEM_SELECT);
/* select the output */
- BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "faces.out", BM_ALL, BM_ELEM_SELECT, TRUE);
+ BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "faces.out", BM_FACE, BM_ELEM_SELECT, TRUE);
/* finish the operator */
if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
@@ -775,7 +775,7 @@ static int similar_edge_select_exec(bContext *C, wmOperator *op)
EDBM_flag_disable_all(em, BM_ELEM_SELECT);
/* select the output */
- BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "edges.out", BM_ALL, BM_ELEM_SELECT, TRUE);
+ BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "edges.out", BM_EDGE, BM_ELEM_SELECT, TRUE);
EDBM_selectmode_flush(em);
/* finish the operator */
@@ -819,7 +819,7 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op)
EDBM_flag_disable_all(em, BM_ELEM_SELECT);
/* select the output */
- BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "verts.out", BM_ALL, BM_ELEM_SELECT, TRUE);
+ BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "verts.out", BM_VERT, BM_ELEM_SELECT, TRUE);
/* finish the operator */
if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
@@ -1269,12 +1269,12 @@ static float step_cost_3_v3(const float v1[3], const float v2[3], const float v3
/* The cost is based on the simple sum of the length of the two edgees... */
sub_v3_v3v3(d1, v2, v1);
sub_v3_v3v3(d2, v3, v2);
- cost = len_v3(d1) + len_v3(d2);
+ cost = normalize_v3(d1) + normalize_v3(d2);
/* but is biased to give higher values to sharp turns, so that it will take
* paths with fewer "turns" when selecting between equal-weighted paths between
* the two edges */
- cost = cost + 0.5f * cost * (2.0f - sqrtf(fabsf(dot_v3v3(d1, d2))));
+ cost = cost * (1.0f + 0.5f * (2.0f - sqrtf(fabsf(dot_v3v3(d1, d2)))));
return cost;
}
@@ -1881,7 +1881,7 @@ int EDBM_select_pick(bContext *C, const int mval[2], short extend, short deselec
vc.obedit->actcol = efa->mat_nr + 1;
vc.em->mat_nr = efa->mat_nr;
- WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING, NULL);
+ WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING_LINKS, NULL);
}
diff --git a/source/blender/editors/mesh/editmesh_slide.c b/source/blender/editors/mesh/editmesh_slide.c
index c32033054e0..4fbe9c2534f 100644
--- a/source/blender/editors/mesh/editmesh_slide.c
+++ b/source/blender/editors/mesh/editmesh_slide.c
@@ -695,7 +695,7 @@ static int edbm_vertex_slide_exec_ex(bContext *C, wmOperator *op, const int do_u
BMOperator bmop;
BMEditSelection *ese = (BMEditSelection *)em->bm->selected.last;
- float distance_t = 0.0f;
+ float factor = 0.0f;
/* Invoked modally? */
if (op->type->modal == edbm_vertex_slide_modal && op->customdata) {
@@ -711,12 +711,12 @@ static int edbm_vertex_slide_exec_ex(bContext *C, wmOperator *op, const int do_u
BM_select_history_store(em->bm, vso->start_vtx);
ese = (BMEditSelection *)em->bm->selected.last;
}
- distance_t = vso->distance;
- RNA_float_set(op->ptr, "distance_t", distance_t);
+ factor = vso->distance;
+ RNA_float_set(op->ptr, "factor", factor);
}
else {
/* Get Properties */
- distance_t = RNA_float_get(op->ptr, "distance_t");
+ factor = RNA_float_get(op->ptr, "factor");
}
/* Is there a starting vertex ? */
@@ -729,8 +729,8 @@ static int edbm_vertex_slide_exec_ex(bContext *C, wmOperator *op, const int do_u
/* Prepare operator */
if (!EDBM_op_init(em, &bmop, op,
- "slide_vert vert=%e edge=%hev distance_t=%f",
- start_vert, BM_ELEM_SELECT, distance_t))
+ "slide_vert vert=%e edges=%he factor=%f",
+ start_vert, BM_ELEM_SELECT, factor))
{
return OPERATOR_CANCELLED;
}
@@ -738,10 +738,10 @@ static int edbm_vertex_slide_exec_ex(bContext *C, wmOperator *op, const int do_u
BMO_op_exec(bm, &bmop);
/* Deselect the input edges */
- BMO_slot_buffer_hflag_disable(bm, bmop.slots_in, "edge", BM_ALL, BM_ELEM_SELECT, TRUE);
+ BMO_slot_buffer_hflag_disable(bm, bmop.slots_in, "edges", BM_EDGE, BM_ELEM_SELECT, TRUE);
/* Select the output vert */
- BMO_slot_buffer_hflag_enable(bm, bmop.slots_out, "verts.out", BM_ALL, BM_ELEM_SELECT, TRUE);
+ BMO_slot_buffer_hflag_enable(bm, bmop.slots_out, "verts.out", BM_VERT, BM_ELEM_SELECT, TRUE);
/* Flush the select buffers */
EDBM_selectmode_flush(em);
@@ -787,7 +787,7 @@ void MESH_OT_vert_slide(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* Properties for vertex slide */
- prop = RNA_def_float(ot->srna, "distance_t", 0.0f, -FLT_MAX, FLT_MAX, "Distance", "Distance", -5.0f, 5.0f);
+ prop = RNA_def_float(ot->srna, "factor", 0.0f, -FLT_MAX, FLT_MAX, "Distance", "Distance", -5.0f, 5.0f);
RNA_def_property_ui_range(prop, -5.0f, 5.0f, 0.1, 4);
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index eb98efdfea3..3ff33b79f55 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -109,7 +109,7 @@ static int edbm_subdivide_exec(bContext *C, wmOperator *op)
smooth, fractal, along_normal,
cuts,
SUBDIV_SELECT_ORIG, RNA_enum_get(op->ptr, "quadcorner"),
- RNA_boolean_get(op->ptr, "quadtri"), TRUE,
+ RNA_boolean_get(op->ptr, "quadtri"), TRUE, FALSE,
RNA_int_get(op->ptr, "seed"));
EDBM_update_generic(C, em, TRUE);
@@ -354,21 +354,21 @@ static short edbm_extrude_edge(Object *obedit, BMEditMesh *em, const char hflag,
if ((fabsf(co1[0]) < mmd->tolerance) &&
(fabsf(co2[0]) < mmd->tolerance))
{
- BMO_slot_map_ptr_insert(&extop, slot_edges_exclude, edge, NULL);
+ BMO_slot_map_empty_insert(&extop, slot_edges_exclude, edge);
}
}
if (mmd->flag & MOD_MIR_AXIS_Y) {
if ((fabsf(co1[1]) < mmd->tolerance) &&
(fabsf(co2[1]) < mmd->tolerance))
{
- BMO_slot_map_ptr_insert(&extop, slot_edges_exclude, edge, NULL);
+ BMO_slot_map_empty_insert(&extop, slot_edges_exclude, edge);
}
}
if (mmd->flag & MOD_MIR_AXIS_Z) {
if ((fabsf(co1[2]) < mmd->tolerance) &&
(fabsf(co2[2]) < mmd->tolerance))
{
- BMO_slot_map_ptr_insert(&extop, slot_edges_exclude, edge, NULL);
+ BMO_slot_map_empty_insert(&extop, slot_edges_exclude, edge);
}
}
}
@@ -891,7 +891,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, wmEvent
}
if (rot_src) {
- EDBM_op_callf(vc.em, op, "rotate verts=%hv cent=%v mat=%m3",
+ EDBM_op_callf(vc.em, op, "rotate verts=%hv cent=%v matrix=%m3",
BM_ELEM_SELECT, cent, mat);
/* also project the source, for retopo workflow */
@@ -900,7 +900,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, wmEvent
}
edbm_extrude_edge(vc.obedit, vc.em, BM_ELEM_SELECT, nor);
- EDBM_op_callf(vc.em, op, "rotate verts=%hv cent=%v mat=%m3",
+ EDBM_op_callf(vc.em, op, "rotate verts=%hv cent=%v matrix=%m3",
BM_ELEM_SELECT, cent, mat);
EDBM_op_callf(vc.em, op, "translate verts=%hv vec=%v",
BM_ELEM_SELECT, min);
@@ -1343,7 +1343,7 @@ static int edbm_duplicate_exec(bContext *C, wmOperator *op)
BMO_op_exec(em->bm, &bmop);
EDBM_flag_disable_all(em, BM_ELEM_SELECT);
- BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "geom.out", BM_ALL, BM_ELEM_SELECT, TRUE);
+ BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "geom.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, TRUE);
if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
return OPERATOR_CANCELLED;
@@ -2018,7 +2018,7 @@ static int merge_firstlast(BMEditMesh *em, int first, int uvmerge, wmOperator *w
return OPERATOR_CANCELLED;
if (uvmerge) {
- if (!EDBM_op_callf(em, wmop, "pointmerge_facedata verts=%hv snapv=%e", BM_ELEM_SELECT, mergevert))
+ if (!EDBM_op_callf(em, wmop, "pointmerge_facedata verts=%hv vert_snap=%e", BM_ELEM_SELECT, mergevert))
return OPERATOR_CANCELLED;
}
@@ -2308,7 +2308,9 @@ static int edbm_select_vertex_path_exec(bContext *C, wmOperator *op)
}
/* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
- EDBM_op_init(em, &bmop, op, "shortest_path startv=%e endv=%e type=%i", svert, evert, type);
+ EDBM_op_init(em, &bmop, op,
+ "shortest_path vert_start=%e vert_end=%e type=%i",
+ svert, evert, type);
/* execute the operator */
BMO_op_exec(em->bm, &bmop);
@@ -2317,7 +2319,7 @@ static int edbm_select_vertex_path_exec(bContext *C, wmOperator *op)
/* EDBM_flag_disable_all(em, BM_ELEM_SELECT); */
/* select the output */
- BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "verts.out", BM_ALL, BM_ELEM_SELECT, TRUE);
+ BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "verts.out", BM_VERT, BM_ELEM_SELECT, TRUE);
/* finish the operator */
if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
@@ -2889,7 +2891,7 @@ static int edbm_knife_cut_exec(bContext *C, wmOperator *op)
float isect = 0.0f;
int len = 0, isected, i;
short numcuts = 1, mode = RNA_int_get(op->ptr, "type");
- BMOpSlot *slot_edgepercents;
+ BMOpSlot *slot_edge_percents;
/* allocd vars */
float (*screen_vert_coords)[2], (*sco)[2], (*mouse_path)[2];
@@ -2944,7 +2946,7 @@ static int edbm_knife_cut_exec(bContext *C, wmOperator *op)
}
/* store percentage of edge cut for KNIFE_EXACT here.*/
- slot_edgepercents = BMO_slot_get(bmop.slots_in, "edgepercents");
+ slot_edge_percents = BMO_slot_get(bmop.slots_in, "edge_percents");
for (be = BM_iter_new(&iter, bm, BM_EDGES_OF_MESH, NULL); be; be = BM_iter_step(&iter)) {
int is_cut = FALSE;
if (BM_elem_flag_test(be, BM_ELEM_SELECT)) {
@@ -2957,7 +2959,7 @@ static int edbm_knife_cut_exec(bContext *C, wmOperator *op)
if (isect != 0.0f) {
if (mode != KNIFE_MULTICUT && mode != KNIFE_MIDPOINT) {
- BMO_slot_map_float_insert(&bmop, slot_edgepercents, be, isect);
+ BMO_slot_map_float_insert(&bmop, slot_edge_percents, be, isect);
}
}
}
@@ -2978,8 +2980,8 @@ static int edbm_knife_cut_exec(bContext *C, wmOperator *op)
BMO_slot_int_set(bmop.slots_in, "cuts", numcuts);
BMO_slot_int_set(bmop.slots_in, "quad_corner_type", SUBD_STRAIGHT_CUT);
- BMO_slot_bool_set(bmop.slots_in, "use_singleedge", FALSE);
- BMO_slot_bool_set(bmop.slots_in, "use_gridfill", FALSE);
+ BMO_slot_bool_set(bmop.slots_in, "use_single_edge", FALSE);
+ BMO_slot_bool_set(bmop.slots_in, "use_grid_fill", FALSE);
BMO_slot_float_set(bmop.slots_in, "radius", 0);
@@ -3596,7 +3598,7 @@ static int edbm_split_exec(bContext *C, wmOperator *op)
EDBM_op_init(em, &bmop, op, "split geom=%hvef use_only_faces=%b", BM_ELEM_SELECT, FALSE);
BMO_op_exec(em->bm, &bmop);
BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, FALSE);
- BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "geom.out", BM_ALL, BM_ELEM_SELECT, TRUE);
+ BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "geom.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, TRUE);
if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
return OPERATOR_CANCELLED;
}
@@ -3634,14 +3636,14 @@ static int edbm_spin_exec(bContext *C, wmOperator *op)
float cent[3], axis[3], imat[3][3];
float d[3] = {0.0f, 0.0f, 0.0f};
int steps, dupli;
- float degr;
+ float angle;
RNA_float_get_array(op->ptr, "center", cent);
RNA_float_get_array(op->ptr, "axis", axis);
steps = RNA_int_get(op->ptr, "steps");
- degr = RNA_float_get(op->ptr, "degrees");
+ angle = RNA_float_get(op->ptr, "angle");
//if (ts->editbutflag & B_CLOCKWISE)
- degr = -degr;
+ angle = -angle;
dupli = RNA_boolean_get(op->ptr, "dupli");
/* undo object transformation */
@@ -3652,13 +3654,13 @@ static int edbm_spin_exec(bContext *C, wmOperator *op)
if (!EDBM_op_init(em, &spinop, op,
"spin geom=%hvef cent=%v axis=%v dvec=%v steps=%i angle=%f use_duplicate=%b",
- BM_ELEM_SELECT, cent, axis, d, steps, degr, dupli))
+ BM_ELEM_SELECT, cent, axis, d, steps, angle, dupli))
{
return OPERATOR_CANCELLED;
}
BMO_op_exec(bm, &spinop);
EDBM_flag_disable_all(em, BM_ELEM_SELECT);
- BMO_slot_buffer_hflag_enable(bm, spinop.slots_out, "geom_last.out", BM_ALL, BM_ELEM_SELECT, TRUE);
+ BMO_slot_buffer_hflag_enable(bm, spinop.slots_out, "geom_last.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, TRUE);
if (!EDBM_op_finish(em, &spinop, op, TRUE)) {
return OPERATOR_CANCELLED;
}
@@ -3683,6 +3685,8 @@ static int edbm_spin_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void MESH_OT_spin(wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
/* identifiers */
ot->name = "Spin";
ot->description = "Extrude selected vertices in a circle around the cursor in indicated viewport";
@@ -3699,7 +3703,8 @@ void MESH_OT_spin(wmOperatorType *ot)
/* props */
RNA_def_int(ot->srna, "steps", 9, 0, INT_MAX, "Steps", "Steps", 0, INT_MAX);
RNA_def_boolean(ot->srna, "dupli", 0, "Dupli", "Make Duplicates");
- RNA_def_float(ot->srna, "degrees", 90.0f, -FLT_MAX, FLT_MAX, "Degrees", "Degrees", -360.0f, 360.0f);
+ prop = RNA_def_float(ot->srna, "angle", DEG2RADF(90.0f), -FLT_MAX, FLT_MAX, "Angle", "Angle", DEG2RADF(-360.0f), DEG2RADF(360.0f));
+ RNA_def_property_subtype(prop, PROP_ANGLE);
RNA_def_float_vector(ot->srna, "center", 3, NULL, -FLT_MAX, FLT_MAX, "Center", "Center in global view space", -FLT_MAX, FLT_MAX);
RNA_def_float_vector(ot->srna, "axis", 3, NULL, -FLT_MAX, FLT_MAX, "Axis", "Axis in global view space", -1.0f, 1.0f);
@@ -3737,15 +3742,11 @@ static int edbm_screw_exec(bContext *C, wmOperator *op)
v1 = NULL;
v2 = NULL;
for (eve = BM_iter_new(&iter, em->bm, BM_VERTS_OF_MESH, NULL); eve; eve = BM_iter_step(&iter)) {
-
valence = 0;
-
for (eed = BM_iter_new(&eiter, em->bm, BM_EDGES_OF_VERT, eve); eed; eed = BM_iter_step(&eiter)) {
-
if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
valence++;
}
-
}
if (valence == 1) {
@@ -3782,7 +3783,7 @@ static int edbm_screw_exec(bContext *C, wmOperator *op)
}
BMO_op_exec(bm, &spinop);
EDBM_flag_disable_all(em, BM_ELEM_SELECT);
- BMO_slot_buffer_hflag_enable(bm, spinop.slots_out, "geom_last.out", BM_ALL, BM_ELEM_SELECT, TRUE);
+ BMO_slot_buffer_hflag_enable(bm, spinop.slots_out, "geom_last.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, TRUE);
if (!EDBM_op_finish(em, &spinop, op, TRUE)) {
return OPERATOR_CANCELLED;
}
@@ -4947,8 +4948,13 @@ static float edbm_bevel_mval_factor(wmOperator *op, wmEvent *event)
/* Fake shift-transform... */
if (event->shift) {
- if (opdata->shift_factor < 0.0f)
+ if (opdata->shift_factor < 0.0f) {
+#ifdef NEW_BEVEL
+ opdata->shift_factor = RNA_float_get(op->ptr, "factor");
+#else
opdata->shift_factor = RNA_float_get(op->ptr, "percent");
+#endif
+ }
factor = (factor - opdata->shift_factor) * 0.1f + opdata->shift_factor;
}
else if (opdata->shift_factor >= 0.0f)
@@ -4973,9 +4979,9 @@ static int edbm_bevel_modal(bContext *C, wmOperator *op, wmEvent *event)
if (event->val == KM_PRESS) {
/* Try to handle numeric inputs... */
#ifdef NEW_BEVEL
- float value;
if (handleNumInput(&opdata->num_input, event)) {
+ float value = RNA_float_get(op->ptr, "offset");
applyNumInput(&opdata->num_input, &value);
RNA_float_set(op->ptr, "offset", value);
edbm_bevel_calc(C, op);
@@ -4983,9 +4989,8 @@ static int edbm_bevel_modal(bContext *C, wmOperator *op, wmEvent *event)
return OPERATOR_RUNNING_MODAL;
}
#else
- float factor;
-
if (handleNumInput(&opdata->num_input, event)) {
+ float factor = RNA_float_get(op->ptr, "percent");
applyNumInput(&opdata->num_input, &factor);
CLAMP(factor, 0.0f, 1.0f);
RNA_float_set(op->ptr, "percent", factor);
@@ -5026,6 +5031,7 @@ static int edbm_bevel_modal(bContext *C, wmOperator *op, wmEvent *event)
#ifdef NEW_BEVEL
case WHEELUPMOUSE: /* change number of segments */
+ case PAGEUPKEY:
if (event->val == KM_RELEASE)
break;
@@ -5036,6 +5042,7 @@ static int edbm_bevel_modal(bContext *C, wmOperator *op, wmEvent *event)
break;
case WHEELDOWNMOUSE: /* change number of segments */
+ case PAGEDOWNKEY:
if (event->val == KM_RELEASE)
break;
@@ -5365,9 +5372,10 @@ static int edbm_inset_modal(bContext *C, wmOperator *op, wmEvent *event)
if (event->val == KM_PRESS) {
/* Try to handle numeric inputs... */
- float amounts[2];
if (handleNumInput(&opdata->num_input, event)) {
+ float amounts[2] = {RNA_float_get(op->ptr, "thickness"),
+ RNA_float_get(op->ptr, "depth")};
applyNumInput(&opdata->num_input, amounts);
amounts[0] = max_ff(amounts[0], 0.0f);
RNA_float_set(op->ptr, "thickness", amounts[0]);
diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c
index 22c71d5d3ca..2cf63586142 100644
--- a/source/blender/editors/mesh/editmesh_utils.c
+++ b/source/blender/editors/mesh/editmesh_utils.c
@@ -265,9 +265,11 @@ int EDBM_op_callf(BMEditMesh *em, wmOperator *op, const char *fmt, ...)
int EDBM_op_call_and_selectf(BMEditMesh *em, wmOperator *op, const char *select_slot_out, const char *fmt, ...)
{
+ BMOpSlot *slot_select_out;
BMesh *bm = em->bm;
BMOperator bmop;
va_list list;
+ char hflag;
va_start(list, fmt);
@@ -283,9 +285,12 @@ int EDBM_op_call_and_selectf(BMEditMesh *em, wmOperator *op, const char *select_
BMO_op_exec(bm, &bmop);
+ slot_select_out = BMO_slot_get(bmop.slots_out, select_slot_out);
+ hflag = slot_select_out->slot_subtype.elem & BM_ALL_NOLOOP;
+
BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, FALSE);
- BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, select_slot_out, BM_ALL, BM_ELEM_SELECT, TRUE);
+ BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, select_slot_out, hflag, BM_ELEM_SELECT, TRUE);
va_end(list);
return EDBM_op_finish(em, &bmop, op, TRUE);
@@ -498,7 +503,7 @@ void EDBM_select_more(BMEditMesh *em)
BM_ELEM_SELECT, FALSE, use_faces);
BMO_op_exec(em->bm, &bmop);
/* don't flush selection in edge/vertex mode */
- BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "geom.out", BM_ALL, BM_ELEM_SELECT, use_faces ? TRUE : FALSE);
+ BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "geom.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, use_faces ? TRUE : FALSE);
BMO_op_finish(em->bm, &bmop);
EDBM_select_flush(em);
@@ -514,7 +519,7 @@ void EDBM_select_less(BMEditMesh *em)
BM_ELEM_SELECT, TRUE, use_faces);
BMO_op_exec(em->bm, &bmop);
/* don't flush selection in edge/vertex mode */
- BMO_slot_buffer_hflag_disable(em->bm, bmop.slots_out, "geom.out", BM_ALL, BM_ELEM_SELECT, use_faces ? TRUE : FALSE);
+ BMO_slot_buffer_hflag_disable(em->bm, bmop.slots_out, "geom.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, use_faces ? TRUE : FALSE);
BMO_op_finish(em->bm, &bmop);
EDBM_selectmode_flush(em);
diff --git a/source/blender/editors/mesh/mesh_navmesh.c b/source/blender/editors/mesh/mesh_navmesh.c
index f6f8eee0a69..83a1261e981 100644
--- a/source/blender/editors/mesh/mesh_navmesh.c
+++ b/source/blender/editors/mesh/mesh_navmesh.c
@@ -341,7 +341,7 @@ static Object *createRepresentation(bContext *C, struct recast_polyMesh *pmesh,
co[1] = bmin[1] + v[1] * ch;
co[2] = bmin[2] + v[2] * cs;
SWAP(float, co[1], co[2]);
- BM_vert_create(em->bm, co, NULL);
+ BM_vert_create(em->bm, co, NULL, 0);
}
/* create custom data layer to save polygon idx */
@@ -372,7 +372,7 @@ static Object *createRepresentation(bContext *C, struct recast_polyMesh *pmesh,
for (j = nv; j < ndv; j++) {
copy_v3_v3(co, &dverts[3 * (vbase + j)]);
SWAP(float, co[1], co[2]);
- BM_vert_create(em->bm, co, NULL);
+ BM_vert_create(em->bm, co, NULL, 0);
}
EDBM_index_arrays_init(em, 1, 0, 0);
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 4d1f2bbc4e9..ad1e2816c10 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -271,7 +271,7 @@ int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float loc[3], fl
if (RNA_struct_property_is_set(op->ptr, "enter_editmode") && enter_editmode)
*enter_editmode = RNA_boolean_get(op->ptr, "enter_editmode");
else {
- *enter_editmode = U.flag & USER_ADD_EDITMODE;
+ *enter_editmode = (U.flag & USER_ADD_EDITMODE) != 0;
RNA_boolean_set(op->ptr, "enter_editmode", *enter_editmode);
}
}
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index e7f09b4055a..f886b52e2ce 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -1225,7 +1225,7 @@ static unsigned int move_to_layer_init(bContext *C, wmOperator *op)
return lay;
}
-static int move_to_layer_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
+static int move_to_layer_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
View3D *v3d = CTX_wm_view3d(C);
if (v3d && v3d->localvd) {
@@ -1233,7 +1233,7 @@ static int move_to_layer_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(eve
}
else {
move_to_layer_init(C, op);
- return WM_operator_props_dialog_popup(C, op, 260, 30);
+ return WM_operator_props_popup(C, op, event);
}
}
@@ -2148,7 +2148,7 @@ static int drop_named_material_invoke(bContext *C, wmOperator *op, wmEvent *even
DAG_ids_flush_update(bmain, 0);
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, CTX_wm_view3d(C));
- WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING, ma);
+ WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING_LINKS, ma);
return OPERATOR_FINISHED;
}
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index d7c7d4c04ef..1b135c0686e 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -400,22 +400,22 @@ typedef enum WT_ReplaceMode {
} WT_ReplaceMode;
static EnumPropertyItem WT_vertex_group_mode_item[] = {
- {WT_REPLACE_ACTIVE_VERTEX_GROUP, "WT_REPLACE_ACTIVE_VERTEX_GROUP", 1, "Active", "Transfer active vertex group from selected to active mesh"},
- {WT_REPLACE_ALL_VERTEX_GROUPS, "WT_REPLACE_ALL_VERTEX_GROUPS", 1, "All", "Transfer all vertex groups from selected to active mesh"},
+ {WT_REPLACE_ACTIVE_VERTEX_GROUP, "WT_REPLACE_ACTIVE_VERTEX_GROUP", 0, "Active", "Transfer active vertex group from selected to active mesh"},
+ {WT_REPLACE_ALL_VERTEX_GROUPS, "WT_REPLACE_ALL_VERTEX_GROUPS", 0, "All", "Transfer all vertex groups from selected to active mesh"},
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem WT_method_item[] = {
- {WT_BY_INDEX, "WT_BY_INDEX", 1, "Vertex index", "Copy for identical meshes"},
- {WT_BY_NEAREST_VERTEX, "WT_BY_NEAREST_VERTEX", 1, "Nearest vertex", "Copy weight from closest vertex"},
- {WT_BY_NEAREST_FACE, "WT_BY_NEAREST_FACE", 1, "Nearest face", "Barycentric interpolation from nearest face"},
- {WT_BY_NEAREST_VERTEX_IN_FACE, "WT_BY_NEAREST_VERTEX_IN_FACE", 1, "Nearest vertex in face", "Copy weight from closest vertex in nearest face"},
+ {WT_BY_INDEX, "WT_BY_INDEX", 0, "Vertex index", "Copy for identical meshes"},
+ {WT_BY_NEAREST_VERTEX, "WT_BY_NEAREST_VERTEX", 0, "Nearest vertex", "Copy weight from closest vertex"},
+ {WT_BY_NEAREST_FACE, "WT_BY_NEAREST_FACE", 0, "Nearest face", "Barycentric interpolation from nearest face"},
+ {WT_BY_NEAREST_VERTEX_IN_FACE, "WT_BY_NEAREST_VERTEX_IN_FACE", 0, "Nearest vertex in face", "Copy weight from closest vertex in nearest face"},
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem WT_replace_mode_item[] = {
- {WT_REPLACE_ALL_WEIGHTS, "WT_REPLACE_ALL_WEIGHTS", 1, "All", "Overwrite all weights"},
- {WT_REPLACE_EMPTY_WEIGHTS, "WT_REPLACE_EMPTY_WEIGHTS", 1, "Empty", "Add weights to vertices with no weight"},
+ {WT_REPLACE_ALL_WEIGHTS, "WT_REPLACE_ALL_WEIGHTS", 0, "All", "Overwrite all weights"},
+ {WT_REPLACE_EMPTY_WEIGHTS, "WT_REPLACE_EMPTY_WEIGHTS", 0, "Empty", "Add weights to vertices with no weight"},
{0, NULL, 0, NULL, NULL}
};
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 2ac5f98927c..f5754297e9f 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -431,7 +431,7 @@ static int key_test_depth(PEData *data, const float co[3], const int screen_co[2
#else /* faster to use depths, these are calculated in PE_set_view3d_data */
/* check if screen_co is within bounds because brush_cut uses out of screen coords */
- if(screen_co[0] >= 0 && screen_co[0] < vd->w && screen_co[1] >= 0 && screen_co[1] < vd->h) {
+ if (screen_co[0] >= 0 && screen_co[0] < vd->w && screen_co[1] >= 0 && screen_co[1] < vd->h) {
BLI_assert(vd && vd->depths);
/* we know its not clipped */
depth = vd->depths[screen_co[1] * vd->w + screen_co[0]];
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c
index 7b67f63c646..9a49a1970a0 100644
--- a/source/blender/editors/render/render_internal.c
+++ b/source/blender/editors/render/render_internal.c
@@ -553,13 +553,20 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event)
rj->win = CTX_wm_window(C);
rj->srl = srl;
rj->camera_override = camera_override;
- rj->lay = (v3d) ? v3d->lay : scene->lay;
+ rj->lay = scene->lay;
rj->anim = is_animation;
rj->write_still = is_write_still && !is_animation;
rj->iuser.scene = scene;
rj->iuser.ok = 1;
rj->reports = op->reports;
+ if(v3d) {
+ rj->lay = v3d->lay;
+
+ if(v3d->localvd)
+ rj->lay |= v3d->localvd->lay;
+ }
+
/* setup job */
if (RE_seq_render_active(scene, &scene->r)) name = "Sequence Render";
else name = "Render";
@@ -611,6 +618,8 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* contextual render, using current scene, view3d? */
void RENDER_OT_render(wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
/* identifiers */
ot->name = "Render";
ot->description = "Render active scene";
@@ -625,7 +634,9 @@ void RENDER_OT_render(wmOperatorType *ot)
RNA_def_boolean(ot->srna, "animation", 0, "Animation", "Render files from the animation range of this scene");
RNA_def_boolean(ot->srna, "write_still", 0, "Write Image", "Save rendered the image to the output path (used only when animation is disabled)");
- RNA_def_string(ot->srna, "layer", "", RE_MAXNAME, "Render Layer", "Single render layer to re-render (used only when animation is disabled)");
- RNA_def_string(ot->srna, "scene", "", MAX_ID_NAME - 2, "Scene", "Scene to render, current scene if not specified");
+ prop = RNA_def_string(ot->srna, "layer", "", RE_MAXNAME, "Render Layer", "Single render layer to re-render (used only when animation is disabled)");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+ prop = RNA_def_string(ot->srna, "scene", "", MAX_ID_NAME - 2, "Scene", "Scene to render, current scene if not specified");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index ebbdc90ab04..34677650f80 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -1480,7 +1480,7 @@ static int paste_material_exec(bContext *C, wmOperator *UNUSED(op))
paste_matcopybuf(ma);
- WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING_DRAW, ma);
+ WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING_LINKS, ma);
return OPERATOR_FINISHED;
}
@@ -1642,7 +1642,7 @@ static int paste_mtex_exec(bContext *C, wmOperator *UNUSED(op))
paste_mtex_copybuf(id);
- WM_event_add_notifier(C, NC_TEXTURE | ND_SHADING_DRAW, NULL);
+ WM_event_add_notifier(C, NC_TEXTURE | ND_SHADING_LINKS, NULL);
return OPERATOR_FINISHED;
}
diff --git a/source/blender/editors/render/render_update.c b/source/blender/editors/render/render_update.c
index 3f438c5948e..e9fbb3a0885 100644
--- a/source/blender/editors/render/render_update.c
+++ b/source/blender/editors/render/render_update.c
@@ -65,6 +65,8 @@
#include "render_intern.h" // own include
+extern Material defmaterial;
+
/***************************** Render Engines ********************************/
void ED_render_scene_update(Main *bmain, Scene *scene, int updated)
@@ -266,6 +268,9 @@ static void lamp_changed(Main *bmain, Lamp *la)
for (ma = bmain->mat.first; ma; ma = ma->id.next)
if (ma->gpumaterial.first)
GPU_material_free(ma);
+
+ if (defmaterial.gpumaterial.first)
+ GPU_material_free(&defmaterial);
}
static void texture_changed(Main *bmain, Tex *tex)
@@ -347,6 +352,9 @@ static void world_changed(Main *bmain, World *wo)
for (ma = bmain->mat.first; ma; ma = ma->id.next)
if (ma->gpumaterial.first)
GPU_material_free(ma);
+
+ if (defmaterial.gpumaterial.first)
+ GPU_material_free(&defmaterial);
}
static void image_changed(Main *bmain, Image *ima)
@@ -375,6 +383,9 @@ static void scene_changed(Main *bmain, Scene *UNUSED(scene))
for (ma = bmain->mat.first; ma; ma = ma->id.next)
if (ma->gpumaterial.first)
GPU_material_free(ma);
+
+ if (defmaterial.gpumaterial.first)
+ GPU_material_free(&defmaterial);
}
void ED_render_id_flush_update(Main *bmain, ID *id)
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 676f033af32..a929c3ef585 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -656,7 +656,7 @@ static float VecZDepthPersp(const float pt[2],
* barycentric_weights_v2 would return, in this case its easiest just to
* undo the 4th axis division and make it unit-sum
*
- * don't call barycentric_weights_v2() becaue our callers expect 'w'
+ * don't call barycentric_weights_v2() because our callers expect 'w'
* to be weighted from the perspective */
w_tmp[0] = w[0] * v1[3];
w_tmp[1] = w[1] * v2[3];
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index c5eff1a1f0e..cb4b6346c2a 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -257,8 +257,8 @@ void imapaint_pick_uv(Scene *scene, Object *ob, unsigned int faceindex, const in
/* double lookup */
const int *index_mf_to_mpoly = dm->getTessFaceDataArray(dm, CD_ORIGINDEX);
const int *index_mp_to_orig = dm->getPolyDataArray(dm, CD_ORIGINDEX);
- if ((index_mf_to_mpoly && index_mp_to_orig) == FALSE) {
- index_mf_to_mpoly = index_mp_to_orig = NULL;
+ if (index_mf_to_mpoly == NULL) {
+ index_mp_to_orig = NULL;
}
minabsw = 1e10;
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 38dbdcd8337..25ea08a4bb1 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -3356,7 +3356,10 @@ static void sculpt_update_cache_invariants(bContext *C, Sculpt *sd, SculptSessio
sculpt_init_mirror_clipping(ob, ss);
/* Initial mouse location */
- copy_v2_v2(ss->cache->initial_mouse, mouse);
+ if (mouse)
+ copy_v2_v2(ss->cache->initial_mouse, mouse);
+ else
+ zero_v2(ss->cache->initial_mouse);
mode = RNA_enum_get(op->ptr, "mode");
cache->invert = mode == BRUSH_STROKE_INVERT;
@@ -3890,8 +3893,8 @@ static int sculpt_stroke_test_start(bContext *C, struct wmOperator *op,
const float mouse[2])
{
/* Don't start the stroke until mouse goes over the mesh.
- * note: event will only be null when re-executing the saved stroke. */
- if (over_mesh(C, op, mouse[0], mouse[1])) {
+ * note: mouse will only be null when re-executing the saved stroke. */
+ if (!mouse || over_mesh(C, op, mouse[0], mouse[1])) {
Object *ob = CTX_data_active_object(C);
SculptSession *ss = ob->sculpt;
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c
index 7d2374738ef..95a5bbdf5c8 100644
--- a/source/blender/editors/space_buttons/space_buttons.c
+++ b/source/blender/editors/space_buttons/space_buttons.c
@@ -300,6 +300,7 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn)
buttons_area_redraw(sa, BCONTEXT_PHYSICS);
case ND_SHADING:
case ND_SHADING_DRAW:
+ case ND_SHADING_LINKS:
/* currently works by redraws... if preview is set, it (re)starts job */
sbuts->preview = 1;
break;
@@ -322,6 +323,7 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn)
switch (wmn->data) {
case ND_SHADING:
case ND_SHADING_DRAW:
+ case ND_SHADING_LINKS:
case ND_NODES:
/* currently works by redraws... if preview is set, it (re)starts job */
sbuts->preview = 1;
diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c
index d97b112e95d..a29524de36d 100644
--- a/source/blender/editors/space_clip/tracking_ops.c
+++ b/source/blender/editors/space_clip/tracking_ops.c
@@ -1409,7 +1409,7 @@ static void solve_camera_freejob(void *scv)
id_us_plus(&clip->id);
/* set blender camera focal length so result would look fine there */
- if (scene->camera && GS(scene->camera->id.name) == ID_CA) {
+ if (scene->camera && scene->camera->data && GS(((ID *) scene->camera->data)->name) == ID_CA) {
Camera *camera = (Camera *)scene->camera->data;
int width, height;
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index 62e941d3148..f757345bdcb 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -86,6 +86,7 @@ typedef struct CompoJob {
short *stop;
short *do_update;
float *progress;
+ short need_sync;
} CompoJob;
/* called by compo, only to check job 'stop' value */
@@ -102,8 +103,17 @@ static int compo_breakjob(void *cjv)
);
}
+/* called by compo, wmJob sends notifier, old compositor system only */
+static void compo_statsdrawjob(void *cjv, char *UNUSED(str))
+{
+ CompoJob *cj = cjv;
+
+ *(cj->do_update) = TRUE;
+ cj->need_sync = TRUE;
+}
+
/* called by compo, wmJob sends notifier */
-static void compo_redrawjob(void *cjv, char *UNUSED(str))
+static void compo_redrawjob(void *cjv)
{
CompoJob *cj = cjv;
@@ -133,8 +143,15 @@ static void compo_initjob(void *cjv)
static void compo_updatejob(void *cjv)
{
CompoJob *cj = cjv;
-
- ntreeLocalSync(cj->localtree, cj->ntree);
+
+ if (cj->need_sync) {
+ /* was used by old compositor system only */
+ ntreeLocalSync(cj->localtree, cj->ntree);
+
+ cj->need_sync = FALSE;
+ }
+
+ WM_main_add_notifier(NC_WINDOW | ND_DRAW, NULL);
}
static void compo_progressjob(void *cjv, float progress)
@@ -161,11 +178,13 @@ static void compo_startjob(void *cjv, short *stop, short *do_update, float *prog
ntree->test_break = compo_breakjob;
ntree->tbh = cj;
- ntree->stats_draw = compo_redrawjob;
+ ntree->stats_draw = compo_statsdrawjob;
ntree->sdh = cj;
ntree->progress = compo_progressjob;
ntree->prh = cj;
-
+ ntree->update_draw = compo_redrawjob;
+ ntree->udh = cj;
+
// XXX BIF_store_spare();
ntreeCompositExecTree(ntree, &cj->scene->r, 0, 1, &scene->view_settings, &scene->display_settings); /* 1 is do_previews */
@@ -177,7 +196,7 @@ static void compo_startjob(void *cjv, short *stop, short *do_update, float *prog
}
/**
- * \param sa_owner is the owner of the job,
+ * \param scene_owner is the owner of the job,
* we don't use it for anything else currently so could also be a void pointer,
* but for now keep it an 'Scene' for consistency.
*
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index 4d2512cdc93..f7e0d51ea03 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -193,6 +193,8 @@ static void node_area_listener(ScrArea *sa, wmNotifier *wmn)
ED_area_tag_refresh(sa);
else if (wmn->data == ND_SHADING_DRAW)
ED_area_tag_refresh(sa);
+ else if (wmn->data == ND_SHADING_LINKS)
+ ED_area_tag_refresh(sa);
else if (wmn->action == NA_ADDED && snode->edittree)
nodeSetActiveID(snode->edittree, ID_MA, wmn->reference);
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 61d513929ad..d37cb4be8fa 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -631,7 +631,7 @@ static uiBlock *operator_search_menu(bContext *C, ARegion *ar, void *arg_kmi)
uiBlockSetFlag(block, UI_BLOCK_LOOP | UI_BLOCK_REDRAW | UI_BLOCK_SEARCH_MENU);
/* fake button, it holds space for search items */
- uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL);
+ uiDefBut(block, LABEL, 0, "", 10, 15, uiSearchBoxWidth(), uiSearchBoxHeight(), NULL, 0, 0, 0, 0, NULL);
but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, 150, UI_UNIT_Y, 0, 0, "");
uiButSetSearchFunc(but, operator_search_cb, arg_kmi, operator_call_cb, ot);
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index 23766d6a6fe..d11a8ed6369 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -836,6 +836,8 @@ static int outliner_one_level_exec(bContext *C, wmOperator *op)
void OUTLINER_OT_show_one_level(wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
/* identifiers */
ot->name = "Show/Hide One Level";
ot->idname = "OUTLINER_OT_show_one_level";
@@ -848,7 +850,8 @@ void OUTLINER_OT_show_one_level(wmOperatorType *ot)
/* no undo or registry, UI option */
/* properties */
- RNA_def_boolean(ot->srna, "open", 1, "Open", "Expand all entries one level deep");
+ prop = RNA_def_boolean(ot->srna, "open", 1, "Open", "Expand all entries one level deep");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
/* Show Hierarchy ----------------------------------------------- */
@@ -1859,7 +1862,7 @@ static int material_drop_invoke(bContext *C, wmOperator *op, wmEvent *event)
DAG_ids_flush_update(bmain, 0);
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, CTX_wm_view3d(C));
- WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING, ma);
+ WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING_LINKS, ma);
return OPERATOR_FINISHED;
}
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 4668dfa1386..0b585e1272b 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -222,7 +222,7 @@ static int tree_element_active_material(bContext *C, Scene *scene, SpaceOops *so
}
}
if (set) {
- WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING, NULL);
+ WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING_LINKS, NULL);
}
return 0;
}
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index af890a81ad6..e6910280da4 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -133,7 +133,7 @@ static void outliner_storage_cleanup(SpaceOops *soops)
}
/* XXX - THIS FUNCTION IS INCREDIBLY SLOW
- * ... it can bring blenders tools and viewport to a grinding halt becuase of searching
+ * ... it can bring blenders tools and viewport to a grinding halt because of searching
* for duplicate items every times they are added.
*
* TODO (possible speedups)
diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c
index f8856cb9646..ecc09a35670 100644
--- a/source/blender/editors/space_outliner/space_outliner.c
+++ b/source/blender/editors/space_outliner/space_outliner.c
@@ -326,15 +326,11 @@ static void outliner_main_area_listener(ARegion *ar, wmNotifier *wmn)
break;
case NC_MATERIAL:
switch (wmn->data) {
- case ND_SHADING:
- case ND_SHADING_DRAW:
+ case ND_SHADING_LINKS:
ED_region_tag_redraw(ar);
break;
}
break;
- case NC_TEXTURE:
- ED_region_tag_redraw(ar);
- break;
case NC_GEOM:
switch (wmn->data) {
case ND_VERTEX_GROUP:
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 5fefafaa54a..1a84efa0b50 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -926,7 +926,7 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq
/* stop all running jobs, except screen one. currently previews frustrate Render
* needed to make so sequencer's rendering doesn't conflict with compositor
*/
- WM_jobs_kill_all_except(CTX_wm_manager(C), CTX_wm_screen(C));
+ WM_jobs_kill_type(CTX_wm_manager(C), WM_JOB_TYPE_COMPOSITE);
}
render_size = sseq->render_size;
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 00d4a943626..4e2bf982ff3 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -1850,6 +1850,7 @@ void SEQUENCER_OT_images_separate(wmOperatorType *ot)
/* api callbacks */
ot->exec = sequencer_separate_images_exec;
+ ot->invoke = WM_operator_props_popup;
ot->poll = sequencer_edit_poll;
/* flags */
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c
index f35a844afc9..0ecde350b00 100644
--- a/source/blender/editors/space_view3d/drawmesh.c
+++ b/source/blender/editors/space_view3d/drawmesh.c
@@ -51,6 +51,7 @@
#include "BKE_DerivedMesh.h"
#include "BKE_effect.h"
+#include "BKE_global.h"
#include "BKE_image.h"
#include "BKE_material.h"
#include "BKE_paint.h"
@@ -965,7 +966,7 @@ void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d,
Mesh *me = ob->data;
TexMatCallback data = {scene, ob, me, dm};
int (*set_face_cb)(void *, int);
- int glsl;
+ int glsl, picking = (G.f & G_PICKSEL);
/* face hiding callback depending on mode */
if (ob == scene->obedit)
@@ -976,11 +977,11 @@ void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d,
set_face_cb = NULL;
/* test if we can use glsl */
- glsl = (v3d->drawtype == OB_MATERIAL) && GPU_glsl_support();
+ glsl = (v3d->drawtype == OB_MATERIAL) && GPU_glsl_support() && !picking;
GPU_begin_object_materials(v3d, rv3d, scene, ob, glsl, NULL);
- if (glsl) {
+ if (glsl || picking) {
/* draw glsl */
dm->drawMappedFacesMat(dm,
tex_mat_set_material_cb,
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 726fd26b11d..1c31cd23e33 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -724,6 +724,7 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
case NC_MATERIAL:
switch (wmn->data) {
case ND_SHADING_DRAW:
+ case ND_SHADING_LINKS:
ED_region_tag_redraw(ar);
break;
}
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index fcd92cd5639..6c23635da90 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1940,7 +1940,7 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas
* is intended to speed up drawing, and drawing extra (especially wire) can
* slow it down too much */
dtx = tbase.object->dtx;
- if(tbase.object->dt != OB_BOUNDBOX)
+ if (tbase.object->dt != OB_BOUNDBOX)
tbase.object->dtx = base->object->dtx;
/* negative scale flag has to propagate */
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 0d8567b256d..d45013c40d9 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -2224,10 +2224,24 @@ static void view3d_from_minmax(bContext *C, View3D *v3d, ARegion *ar,
/* fix up zoom distance if needed */
if (rv3d->is_persp) {
- if (size <= v3d->near * 1.5f) {
- /* do not zoom closer than the near clipping plane */
- size = v3d->near * 1.5f;
+ float lens, sensor_size;
+ /* offset the view based on the lens */
+ if (rv3d->persp == RV3D_CAMOB && ED_view3d_camera_lock_check(v3d, rv3d)) {
+ CameraParams params;
+ BKE_camera_params_init(&params);
+ BKE_camera_params_from_object(&params, v3d->camera);
+
+ lens = params.lens;
+ sensor_size = BKE_camera_sensor_size(params.sensor_fit, params.sensor_x, params.sensor_y);
}
+ else {
+ lens = v3d->lens;
+ sensor_size = DEFAULT_SENSOR_WIDTH;
+ }
+ size = ED_view3d_radius_to_persp_dist(focallength_to_fov(lens, sensor_size), size / 2.0f) * VIEW3D_MARGIN;
+
+ /* do not zoom closer than the near clipping plane */
+ size = max_ff(size, v3d->near * 1.5f);
}
else { /* ortho */
if (size < 0.0001f) {
@@ -2236,7 +2250,7 @@ static void view3d_from_minmax(bContext *C, View3D *v3d, ARegion *ar,
}
else {
/* adjust zoom so it looks nicer */
- size *= 0.7f;
+ size = ED_view3d_radius_to_ortho_dist(v3d->lens, size / 2.0f) * VIEW3D_MARGIN;
}
}
}
diff --git a/source/blender/editors/space_view3d/view3d_iterators.c b/source/blender/editors/space_view3d/view3d_iterators.c
index b928e060ca0..37607729d0d 100644
--- a/source/blender/editors/space_view3d/view3d_iterators.c
+++ b/source/blender/editors/space_view3d/view3d_iterators.c
@@ -20,7 +20,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/** \file blender/editors/object/view3d_iterators.c
+/** \file blender/editors/space_view3d/view3d_iterators.c
* \ingroup spview3d
*/
diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c
index d36b0085acb..bfeb56036e6 100644
--- a/source/blender/editors/space_view3d/view3d_toolbar.c
+++ b/source/blender/editors/space_view3d/view3d_toolbar.c
@@ -176,7 +176,7 @@ static uiBlock *tool_search_menu(bContext *C, ARegion *ar, void *arg_listbase)
uiBlockSetFlag(block, UI_BLOCK_LOOP | UI_BLOCK_REDRAW | UI_BLOCK_SEARCH_MENU);
/* fake button, it holds space for search items */
- uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL);
+ uiDefBut(block, LABEL, 0, "", 10, 15, uiSearchBoxWidth(), uiSearchBoxHeight(), NULL, 0, 0, 0, 0, NULL);
but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, 150, 19, 0, 0, "");
uiButSetSearchFunc(but, operator_search_cb, arg_listbase, operator_call_cb, NULL);
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index 714898fed21..ef15c1e734e 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -323,8 +323,14 @@ static int view3d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent
if (rv3d->viewlock & RV3D_BOXVIEW)
view3d_boxview_copy(CTX_wm_area(C), CTX_wm_region(C));
-
+
+ /* note: this doesn't work right because the v3d->lens is now used in ortho mode r51636,
+ * when switching camera in quad-view the other ortho views would zoom & reset. */
+#if 0
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d);
+#else
+ ED_region_tag_redraw(CTX_wm_region(C));
+#endif
return OPERATOR_FINISHED;
}
@@ -1028,7 +1034,8 @@ static int view3d_localview_init(Main *bmain, Scene *scene, ScrArea *sa, ReportL
{
View3D *v3d = sa->spacedata.first;
Base *base;
- float size = 0.0, min[3], max[3], box[3];
+ float min[3], max[3], box[3];
+ float size = 0.0f, size_persp = 0.0f, size_ortho = 0.0f;
unsigned int locallay;
int ok = FALSE;
@@ -1068,7 +1075,13 @@ static int view3d_localview_init(Main *bmain, Scene *scene, ScrArea *sa, ReportL
box[1] = (max[1] - min[1]);
box[2] = (max[2] - min[2]);
size = MAX3(box[0], box[1], box[2]);
- if (size <= 0.01f) size = 0.01f;
+
+ /* do not zoom closer than the near clipping plane */
+ size = max_ff(size, v3d->near * 1.5f);
+
+ /* perspective size (we always switch out of camera view so no need to use its lens size) */
+ size_persp = ED_view3d_radius_to_persp_dist(focallength_to_fov(v3d->lens, DEFAULT_SENSOR_WIDTH), size / 2.0f) * VIEW3D_MARGIN;
+ size_ortho = ED_view3d_radius_to_ortho_dist(v3d->lens, size / 2.0f) * VIEW3D_MARGIN;
}
if (ok == TRUE) {
@@ -1085,14 +1098,20 @@ static int view3d_localview_init(Main *bmain, Scene *scene, ScrArea *sa, ReportL
rv3d->localvd = MEM_mallocN(sizeof(RegionView3D), "localview region");
memcpy(rv3d->localvd, rv3d, sizeof(RegionView3D));
- rv3d->ofs[0] = -(min[0] + max[0]) / 2.0f;
- rv3d->ofs[1] = -(min[1] + max[1]) / 2.0f;
- rv3d->ofs[2] = -(min[2] + max[2]) / 2.0f;
+ mid_v3_v3v3(v3d->cursor, min, max);
+ negate_v3_v3(rv3d->ofs, v3d->cursor);
+
+ if (rv3d->persp == RV3D_CAMOB) {
+ rv3d->persp = RV3D_PERSP;
+ }
- rv3d->dist = size;
/* perspective should be a bit farther away to look nice */
- if (rv3d->persp == RV3D_ORTHO)
- rv3d->dist *= 0.7f;
+ if (rv3d->persp != RV3D_ORTHO) {
+ rv3d->dist = size_persp;
+ }
+ else {
+ rv3d->dist = size_ortho;
+ }
/* correction for window aspect ratio */
if (ar->winy > 2 && ar->winx > 2) {
@@ -1100,12 +1119,6 @@ static int view3d_localview_init(Main *bmain, Scene *scene, ScrArea *sa, ReportL
if (asp < 1.0f) asp = 1.0f / asp;
rv3d->dist *= asp;
}
-
- if (rv3d->persp == RV3D_CAMOB) rv3d->persp = RV3D_PERSP;
-
- v3d->cursor[0] = -rv3d->ofs[0];
- v3d->cursor[1] = -rv3d->ofs[1];
- v3d->cursor[2] = -rv3d->ofs[2];
}
}
@@ -1511,7 +1524,7 @@ static void UNUSED_FUNCTION(view3d_align_axis_to_vector)(View3D *v3d, RegionView
}
}
-float ED_view3d_pixel_size(struct RegionView3D *rv3d, const float co[3])
+float ED_view3d_pixel_size(RegionView3D *rv3d, const float co[3])
{
return (rv3d->persmat[3][3] + (
rv3d->persmat[0][3] * co[0] +
@@ -1520,6 +1533,16 @@ float ED_view3d_pixel_size(struct RegionView3D *rv3d, const float co[3])
) * rv3d->pixsize;
}
+float ED_view3d_radius_to_persp_dist(const float angle, const float radius)
+{
+ return (radius / 2.0f) * fabsf(1.0f / cosf((((float)M_PI) - angle) / 2.0f));
+}
+
+float ED_view3d_radius_to_ortho_dist(const float lens, const float radius)
+{
+ return radius / (DEFAULT_SENSOR_WIDTH / lens);
+}
+
/* view matrix properties utilities */
/* unused */
diff --git a/source/blender/editors/transform/CMakeLists.txt b/source/blender/editors/transform/CMakeLists.txt
index 05a4f6f4ce5..ec114bc3019 100644
--- a/source/blender/editors/transform/CMakeLists.txt
+++ b/source/blender/editors/transform/CMakeLists.txt
@@ -25,6 +25,7 @@ set(INC
../../blenlib
../../blenloader
../../bmesh
+ ../../ikplugin
../../makesdna
../../makesrna
../../windowmanager
diff --git a/source/blender/editors/transform/SConscript b/source/blender/editors/transform/SConscript
index dbf6179035c..9cf36a2d970 100644
--- a/source/blender/editors/transform/SConscript
+++ b/source/blender/editors/transform/SConscript
@@ -6,7 +6,7 @@ sources = env.Glob('*.c')
incs = '../include ../../blenfont ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
incs += ' ../../render/extern/include'
-incs += ' ../../gpu ../../makesrna ../../blenloader ../../bmesh'
+incs += ' ../../gpu ../../makesrna ../../blenloader ../../bmesh ../../ikplugin'
defs = []
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index b26718bb516..f93cfa25120 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -2427,6 +2427,8 @@ static void constraintSizeLim(TransInfo *t, TransData *td)
bConstraintTypeInfo *cti = get_constraint_typeinfo(CONSTRAINT_TYPE_SIZELIMIT);
bConstraintOb cob = {NULL};
bConstraint *con;
+ float size_sign[3], size_abs[3];
+ int i;
/* Make a temporary bConstraintOb for using these limit constraints
* - they only care that cob->matrix is correctly set ;-)
@@ -2440,8 +2442,14 @@ static void constraintSizeLim(TransInfo *t, TransData *td)
/* Reset val if SINGLESIZE but using a constraint */
if (td->flag & TD_SINGLESIZE)
return;
+
+ /* separate out sign to apply back later */
+ for (i = 0; i < 3; i++) {
+ size_sign[i] = signf(td->ext->size[i]);
+ size_abs[i] = fabsf(td->ext->size[i]);
+ }
- size_to_mat4(cob.matrix, td->ext->size);
+ size_to_mat4(cob.matrix, size_abs);
}
/* Evaluate valid constraints */
@@ -2489,7 +2497,9 @@ static void constraintSizeLim(TransInfo *t, TransData *td)
if (td->flag & TD_SINGLESIZE)
return;
+ /* extrace scale from matrix and apply back sign */
mat4_to_size(td->ext->size, cob.matrix);
+ mul_v3_v3(td->ext->size, size_sign);
}
}
}
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 5b79b69f7ec..51efa2b0e40 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -91,6 +91,7 @@
#include "BKE_tracking.h"
#include "BKE_mask.h"
+#include "BIK_api.h"
#include "ED_anim_api.h"
#include "ED_armature.h"
@@ -773,6 +774,9 @@ static void pose_grab_with_ik_clear(Object *ob)
if (con->type == CONSTRAINT_TYPE_KINEMATIC) {
data = con->data;
if (data->flag & CONSTRAINT_IK_TEMP) {
+ /* iTaSC needs clear for removed constraints */
+ BIK_clear_data(ob->pose);
+
BLI_remlink(&pchan->constraints, con);
MEM_freeN(con->data);
MEM_freeN(con);
@@ -839,7 +843,7 @@ static short pose_grab_with_ik_add(bPoseChannel *pchan)
}
else
data->flag = CONSTRAINT_IK_TIP;
- data->flag |= CONSTRAINT_IK_TEMP | CONSTRAINT_IK_AUTO;
+ data->flag |= CONSTRAINT_IK_TEMP | CONSTRAINT_IK_AUTO | CONSTRAINT_IK_POS;
copy_v3_v3(data->grabtarget, pchan->pose_tail);
data->rootbone = 0; /* watch-it! has to be 0 here, since we're still on the same bone for the first time through the loop [#25885] */
@@ -933,6 +937,10 @@ static short pose_grab_with_ik(Object *ob)
}
}
+ /* iTaSC needs clear for new IK constraints */
+ if (tot_ik)
+ BIK_clear_data(ob->pose);
+
return (tot_ik) ? 1 : 0;
}
diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c
index b73f5fa0869..0ec16ead35d 100644
--- a/source/blender/editors/util/numinput.c
+++ b/source/blender/editors/util/numinput.c
@@ -130,6 +130,9 @@ short hasNumInput(NumInput *n)
return 0;
}
+/**
+ * \warning \a vec must be set beforehand otherwise we risk uninitialized vars.
+ */
void applyNumInput(NumInput *n, float *vec)
{
short i, j;
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index 0feaec514d2..a384c777aab 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -224,7 +224,9 @@ void ED_uvedit_assign_image(Main *bmain, Scene *scene, Object *obedit, Image *im
BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
- if (uvedit_face_visible_test(scene, previma, efa, tf)) {
+ if (uvedit_face_visible_test(scene, previma, efa, tf) &&
+ (selected == TRUE || uvedit_face_select_test(scene, em, efa)))
+ {
if (ima) {
tf->tpage = ima;
@@ -2667,10 +2669,12 @@ static void uv_faces_do_sticky(SpaceImage *sima, Scene *scene, Object *obedit, s
else { /* SI_STICKY_DISABLE or ts->uv_flag & UV_SYNC_SELECTION */
BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
if (BM_elem_flag_test(efa, BM_ELEM_TAG)) {
- if (select)
+ if (select) {
uvedit_face_select_enable(scene, em, efa, FALSE);
- else
+ }
+ else {
uvedit_face_select_disable(scene, em, efa);
+ }
}
}
}
@@ -2692,7 +2696,10 @@ static int border_select_exec(bContext *C, wmOperator *op)
MLoopUV *luv;
rcti rect;
rctf rectf;
- int change, pinned, select, faces, extend;
+ int change, pinned, select, extend;
+ const int use_face_center = (ts->uv_flag & UV_SYNC_SELECTION) ?
+ (ts->selectmode == SCE_SELECT_FACE) :
+ (ts->uv_selectmode == UV_SELECT_FACE);
/* get rectangle from operator */
WM_operator_properties_border_to_rcti(op, &rect);
@@ -2707,14 +2714,9 @@ static int border_select_exec(bContext *C, wmOperator *op)
if (!extend)
select_all_perform(scene, ima, em, SEL_DESELECT);
-
- if (ts->uv_flag & UV_SYNC_SELECTION)
- faces = (ts->selectmode == SCE_SELECT_FACE);
- else
- faces = (ts->uv_selectmode == UV_SELECT_FACE);
/* do actual selection */
- if (faces && !pinned) {
+ if (use_face_center && !pinned) {
/* handle face selection mode */
float cent[2];
@@ -2735,8 +2737,9 @@ static int border_select_exec(bContext *C, wmOperator *op)
}
/* (de)selects all tagged faces and deals with sticky modes */
- if (change)
+ if (change) {
uv_faces_do_sticky(sima, scene, obedit, select);
+ }
}
else {
/* other selection modes */
@@ -2805,19 +2808,19 @@ static void UV_OT_select_border(wmOperatorType *ot)
/* ******************** circle select operator **************** */
-static int select_uv_inside_ellipse(BMEditMesh *em, SpaceImage *UNUSED(sima), Scene *scene, int select,
- float *offset, float *ell, BMLoop *l, MLoopUV *luv)
+static int uv_inside_circle(const float uv[2], const float offset[2], const float ellipse[2])
{
/* normalized ellipse: ell[0] = scaleX, ell[1] = scaleY */
- float x, y, r2, *uv;
-
- uv = luv->uv;
-
- x = (uv[0] - offset[0]) * ell[0];
- y = (uv[1] - offset[1]) * ell[1];
+ float x, y;
+ x = (uv[0] - offset[0]) * ellipse[0];
+ y = (uv[1] - offset[1]) * ellipse[1];
+ return ((x * x + y * y) < 1.0f);
+}
- r2 = x * x + y * y;
- if (r2 < 1.0f) {
+static int select_uv_inside_ellipse(BMEditMesh *em, Scene *scene, const int select,
+ const float offset[2], const float ellipse[2], BMLoop *l, MLoopUV *luv)
+{
+ if (uv_inside_circle(luv->uv, offset, ellipse)) {
if (select) uvedit_uv_select_enable(em, scene, l, FALSE);
else uvedit_uv_select_disable(em, scene, l);
return TRUE;
@@ -2843,6 +2846,9 @@ static int circle_select_exec(bContext *C, wmOperator *op)
float zoomx, zoomy, offset[2], ellipse[2];
int gesture_mode = RNA_int_get(op->ptr, "gesture_mode");
int change = FALSE;
+ const int use_face_center = (ts->uv_flag & UV_SYNC_SELECTION) ?
+ (ts->selectmode == SCE_SELECT_FACE) :
+ (ts->uv_selectmode == UV_SELECT_FACE);
/* get operator properties */
select = (gesture_mode == GESTURE_MODAL_SELECT);
@@ -2861,10 +2867,32 @@ static int circle_select_exec(bContext *C, wmOperator *op)
UI_view2d_region_to_view(&ar->v2d, x, y, &offset[0], &offset[1]);
/* do selection */
- BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
- BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
- luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
- change |= select_uv_inside_ellipse(em, sima, scene, select, offset, ellipse, l, luv);
+ if (use_face_center) {
+ change = FALSE;
+ BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
+ BM_elem_flag_disable(efa, BM_ELEM_TAG);
+ /* assume not touched */
+ if ((select) != (uvedit_face_select_test(scene, em, efa))) {
+ float cent[2];
+ uv_poly_center(em, efa, cent);
+ if (uv_inside_circle(cent, offset, ellipse)) {
+ BM_elem_flag_enable(efa, BM_ELEM_TAG);
+ change = TRUE;
+ }
+ }
+ }
+
+ /* (de)selects all tagged faces and deals with sticky modes */
+ if (change) {
+ uv_faces_do_sticky(sima, scene, obedit, select);
+ }
+ }
+ else {
+ BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
+ BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
+ luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+ change |= select_uv_inside_ellipse(em, scene, select, offset, ellipse, l, luv);
+ }
}
}
@@ -2906,12 +2934,16 @@ static void UV_OT_circle_select(wmOperatorType *ot)
static int do_lasso_select_mesh_uv(bContext *C, const int mcords[][2], short moves, short select)
{
+ SpaceImage *sima = CTX_wm_space_image(C);
Image *ima = CTX_data_edit_image(C);
ARegion *ar = CTX_wm_region(C);
Object *obedit = CTX_data_edit_object(C);
Scene *scene = CTX_data_scene(C);
ToolSettings *ts = scene->toolsettings;
BMEditMesh *em = BMEdit_FromObject(obedit);
+ const int use_face_center = (ts->uv_flag & UV_SYNC_SELECTION) ?
+ (ts->selectmode == SCE_SELECT_FACE) :
+ (ts->uv_selectmode == UV_SELECT_FACE);
BMIter iter, liter;
@@ -2923,9 +2955,10 @@ static int do_lasso_select_mesh_uv(bContext *C, const int mcords[][2], short mov
BLI_lasso_boundbox(&rect, mcords, moves);
- if (ts->uv_selectmode == UV_SELECT_FACE) { /* Face Center Sel */
+ if (use_face_center) { /* Face Center Sel */
change = FALSE;
BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
+ BM_elem_flag_disable(efa, BM_ELEM_TAG);
/* assume not touched */
if ((select) != (uvedit_face_select_test(scene, em, efa))) {
float cent[2];
@@ -2934,11 +2967,16 @@ static int do_lasso_select_mesh_uv(bContext *C, const int mcords[][2], short mov
if (BLI_rcti_isect_pt_v(&rect, screen_uv) &&
BLI_lasso_is_point_inside(mcords, moves, screen_uv[0], screen_uv[1], V2D_IS_CLIPPED))
{
- uvedit_face_select_enable(scene, em, efa, FALSE);
+ BM_elem_flag_enable(efa, BM_ELEM_TAG);
change = TRUE;
}
}
}
+
+ /* (de)selects all tagged faces and deals with sticky modes */
+ if (change) {
+ uv_faces_do_sticky(sima, scene, obedit, select);
+ }
}
else { /* Vert Sel */
BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
@@ -3395,7 +3433,7 @@ static int hide_exec(bContext *C, wmOperator *op)
MTexPoly *tf;
int swap = RNA_boolean_get(op->ptr, "unselected");
Image *ima = sima ? sima->image : NULL;
- int facemode = (ts->uv_selectmode == UV_SELECT_FACE);
+ const int use_face_center = (ts->uv_selectmode == UV_SELECT_FACE);
if (ts->uv_flag & UV_SYNC_SELECTION) {
EDBM_mesh_hide(em, swap);
@@ -3425,7 +3463,7 @@ static int hide_exec(bContext *C, wmOperator *op)
if (hide) {
/* note, a special case for edges could be used,
* for now edges act like verts and get flushed */
- if (facemode) {
+ if (use_face_center) {
if (em->selectmode == SCE_SELECT_FACE) {
/* check that every UV is selected */
if (bm_face_is_all_uv_sel(em->bm, efa, TRUE) == !swap) {
@@ -3443,8 +3481,6 @@ static int hide_exec(bContext *C, wmOperator *op)
}
}
if (!swap) uvedit_face_select_disable(scene, em, efa);
-
-
}
}
else if (em->selectmode == SCE_SELECT_FACE) {
@@ -3507,8 +3543,8 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
BMLoop *l;
BMIter iter, liter;
MLoopUV *luv;
- int facemode = (ts->uv_selectmode == UV_SELECT_FACE);
- int stickymode = sima ? (sima->sticky != SI_STICKY_DISABLE) : 1;
+ const int use_face_center = (ts->uv_selectmode == UV_SELECT_FACE);
+ const int stickymode = sima ? (sima->sticky != SI_STICKY_DISABLE) : 1;
/* note on tagging, selecting faces needs to be delayed so it doesn't select the verts and
* confuse our checks on selected verts. */
@@ -3520,7 +3556,7 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_FINISHED;
}
- if (facemode) {
+ if (use_face_center) {
if (em->selectmode == SCE_SELECT_FACE) {
BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
BM_elem_flag_disable(efa, BM_ELEM_TAG);
diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c
index e10d70d48d1..4ca642690c4 100644
--- a/source/blender/editors/uvedit/uvedit_smart_stitch.c
+++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c
@@ -1072,17 +1072,23 @@ static int stitch_init(bContext *C, wmOperator *op)
BMEditMesh *em;
GHashIterator *ghi;
UvEdge *all_edges;
- StitchState *state = MEM_mallocN(sizeof(StitchState), "stitch state");
+ StitchState *state;
Scene *scene = CTX_data_scene(C);
ToolSettings *ts = scene->toolsettings;
+ ARegion *ar = CTX_wm_region(C);
Object *obedit = CTX_data_edit_object(C);
- op->customdata = state;
+ if (!ar)
+ return 0;
+
+ state = MEM_mallocN(sizeof(StitchState), "stitch state");
if (!state)
return 0;
+ op->customdata = state;
+
/* initialize state */
state->use_limit = RNA_boolean_get(op->ptr, "use_limit");
state->limit_dist = RNA_float_get(op->ptr, "limit");
@@ -1091,7 +1097,7 @@ static int stitch_init(bContext *C, wmOperator *op)
state->static_island = RNA_int_get(op->ptr, "static_island");
state->midpoints = RNA_boolean_get(op->ptr, "midpoint_snap");
state->clear_seams = RNA_boolean_get(op->ptr, "clear_seams");
- state->draw_handle = ED_region_draw_cb_activate(CTX_wm_region(C)->type, stitch_draw, NULL, REGION_DRAW_POST_VIEW);
+ state->draw_handle = ED_region_draw_cb_activate(ar->type, stitch_draw, NULL, REGION_DRAW_POST_VIEW);
/* in uv synch selection, all uv's are visible */
if (ts->uv_flag & UV_SYNC_SELECTION) {
state->element_map = EDBM_uv_element_map_create(state->em, 0, 1);
diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
index efe9d1fedfe..1eec06eee75 100644
--- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c
+++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
@@ -306,7 +306,7 @@ static ParamHandle *construct_param_handle(Scene *scene, Object *ob, BMEditMesh
BLI_scanfill_edge_add(&sf_ctx, sf_vert_first, sf_vert);
- BLI_scanfill_calc_ex(&sf_ctx, TRUE, efa->no);
+ BLI_scanfill_calc_ex(&sf_ctx, 0, efa->no);
for (sf_tri = sf_ctx.fillfacebase.first; sf_tri; sf_tri = sf_tri->next) {
int i;
ls[0] = sf_tri->v1->tmp.p;