diff options
-rw-r--r-- | source/blender/bmesh/intern/bmesh_query.c | 7 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 1 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_input.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_workspace_api.c | 9 |
4 files changed, 14 insertions, 7 deletions
diff --git a/source/blender/bmesh/intern/bmesh_query.c b/source/blender/bmesh/intern/bmesh_query.c index cebfd4df75b..a121bd3b9f4 100644 --- a/source/blender/bmesh/intern/bmesh_query.c +++ b/source/blender/bmesh/intern/bmesh_query.c @@ -2808,6 +2808,13 @@ int BM_mesh_calc_edge_groups(BMesh *bm, return group_curr; } +/** + * This is an alternative to #BM_mesh_calc_edge_groups. + * + * While we could call this, then create vertex & face arrays, + * it requires looping over geometry connectivity twice, + * this slows down edit-mesh separate by loose parts, see: T70864. + */ int BM_mesh_calc_edge_groups_as_arrays( BMesh *bm, BMVert **verts, BMEdge **edges, BMFace **faces, int (**r_groups)[3]) { diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 7252488a303..a1232347516 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -3887,6 +3887,7 @@ enum { MESH_SEPARATE_LOOSE = 2, }; +/** TODO: Use #mesh_separate_arrays since it's more efficient. */ static Base *mesh_separate_tagged( Main *bmain, Scene *scene, ViewLayer *view_layer, Base *base_old, BMesh *bm_old) { diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c index e0c62c45204..8dc403c45d2 100644 --- a/source/blender/editors/transform/transform_input.c +++ b/source/blender/editors/transform/transform_input.c @@ -63,8 +63,8 @@ static void InputSpringFlip(TransInfo *t, MouseInput *mi, const double mval[2], /* flip scale */ /* values can become really big when zoomed in so use longs [#26598] */ - if ((int64_t)((int)mi->center[0] - mval[0]) * (int64_t)((int)mi->center[0] - mi->imval[0]) + - (int64_t)((int)mi->center[1] - mval[1]) * (int64_t)((int)mi->center[1] - mi->imval[1]) < + if (((int64_t)((int)mi->center[0] - mval[0]) * (int64_t)((int)mi->center[0] - mi->imval[0]) + + (int64_t)((int)mi->center[1] - mval[1]) * (int64_t)((int)mi->center[1] - mi->imval[1])) < 0) { output[0] *= -1.0f; } diff --git a/source/blender/makesrna/intern/rna_workspace_api.c b/source/blender/makesrna/intern/rna_workspace_api.c index f22c86b3ff2..2d3b1e76b71 100644 --- a/source/blender/makesrna/intern/rna_workspace_api.c +++ b/source/blender/makesrna/intern/rna_workspace_api.c @@ -43,14 +43,13 @@ static void rna_WorkSpaceTool_setup(ID *id, bToolRef *tref, bContext *C, - const char *name, + const char *tool_idname, /* Args for: 'bToolRef_Runtime'. */ int cursor, const char *keymap, const char *gizmo_group, const char *data_block, - const char * - operator, + const char *op_idname, int index) { bToolRef_Runtime tref_rt = {0}; @@ -59,10 +58,10 @@ static void rna_WorkSpaceTool_setup(ID *id, STRNCPY(tref_rt.keymap, keymap); STRNCPY(tref_rt.gizmo_group, gizmo_group); STRNCPY(tref_rt.data_block, data_block); - STRNCPY(tref_rt.op, operator); + STRNCPY(tref_rt.op, op_idname); tref_rt.index = index; - WM_toolsystem_ref_set_from_runtime(C, (WorkSpace *)id, tref, &tref_rt, name); + WM_toolsystem_ref_set_from_runtime(C, (WorkSpace *)id, tref, &tref_rt, tool_idname); } static void rna_WorkSpaceTool_refresh_from_context(ID *id, bToolRef *tref, Main *bmain) |