Commit Graph

86 Commits

Author SHA1 Message Date
3264461598 move bmesh array lookup data and utility functions from editmesh into bmesh,
since enough bmesh operations can also take advantage of direct index lookups on verts/edges/faces.

developers note:
- EDBM_index_arrays_init/ensure/free -> BM_mesh_elem_table_ensure/init/free
- EDBM_vert/edge/face_at_index -> BM_vert/edge/face_at_index
- EDBM_uv_element_map_create/free -> BM_uv_element_map_create/free
- ED_uv_element_get -> BM_uv_element_get
2013-10-28 02:05:33 +00:00
5342d57a5e allocate bmesh data from known sizes where possible (was still using defaults in places),
add macros for initializing BMAllocTemplate's, also add assert on invalid use of bmesh_sfme()
2013-09-24 03:31:00 +00:00
86f8470a5d Some knife fixes. Avoids duplicating verts; better handling of cut-through ortho.
Now cut lines detect vertices that they pass (almost) exactly over
and snap to them, to avoid making verts vert close to other ones.

Added radius arg to BKE_bmbvh_ray_cast so that can detect an obscuring
face when the ray might otherwise go exactly between two triangles.
Needed an isect_line_tri_epsilon function for similar reason.

Fixes last part of bug #35002. Other knife bugs still present but
getting this commit in now before continuing bug fixing.
2013-08-30 16:34:44 +00:00
31761f5e5b code cleanup: replace bmesh_radial_face_find -> BM_edge_in_face 2013-08-03 15:30:57 +00:00
4982f200fa move alloca define into its own header since its not related to BLI_array 2013-07-28 10:38:25 +00:00
a15e9ca495 triangulate and beauty fill also needed changes to selection handling after recent changes. 2013-07-25 07:00:07 +00:00
9634f8f115 transform was flushing the selection (inline), now skip this and use the selection as-is.
flush the selection on entering editmode instead (since the selection mode can be changed with another mesh).
is other tools leave the selection incorrectly flushed, those will need to be fixed so transform works as expected.
2013-07-22 10:44:24 +00:00
b7396654e1 fix for bad NULL check in bmo_connect_pair, also remove duplicate checks in if statements and redundant initialization vars. 2013-07-13 16:25:47 +00:00
aabddad346 draw loopcut display on the deformed mesh when in editmode. 2013-07-10 02:05:16 +00:00
d0ce73c548 fix [#35939] [Edit - Vertex mode] [Select]-[Mirror] did not returns right result. 2013-07-01 21:56:59 +00:00
77e0709e48 Fix #35551: the topology mirror setting affected shape key and vertex group but
this was confusing as there was no setting visible for it. Now these menus
contain an entry to mirror without and with topology mirror.
2013-06-28 17:13:09 +00:00
781184562b add api calls for BM_mesh_active_vert/edge_get.
inspecting the edit-selection inline was cumbersome.
2013-06-24 04:51:56 +00:00
1ed8343d6d add axis option to EDBM_verts_mirror_cache_begin 2013-06-19 21:23:00 +00:00
d54d00ef84 Remove paranoid null checks for editmesh EDBM_vert_at_index and friends (use asserts instead).
temp set BM_OMP_LIMIT to zero for better testing before release.
2013-06-19 18:59:54 +00:00
06e1bc6178 internal editmesh api: add an extended version of EDBM_verts_mirror_cache_begin which takes arguments to give some more control. 2013-06-19 18:22:00 +00:00
666c8b51ca changes to mirror tools
- give feedback on how many mirror verts succeed/fail (for select mirror, shape key mirror, weight mirror)
... when a mirror failed it was confusing and not obvious what was going on.

- slight change to select mirror, now center vertices will remain selected.

- speedup to EDBM_verts_mirror_cache_begin, cache customdata layer offset.
2013-06-05 05:58:51 +00:00
dfad9b0c09 fix [#35555] Collada: export destroys mesh in some cases
add arguments to calculate normals when converting to bmesh:
  BM_mesh_bm_from_me, DM_to_bmesh

This gives some speedup to undo (which didnt need to re-calculate vertex normals), and array modifier which doesnt need to calculate face normals at all
2013-06-02 23:20:49 +00:00
11186184aa Fix #35404: crash in file save with python code that accesses mesh from panel.
On file save the mesh gets loads from the editmesh but the derived mesh caches
wer not cleared. This usually happens through the depsgraph but it needs to be
done manually here. Most changes are some refactoring to deduplicate derived
mesh freeing code.
2013-05-18 10:24:34 +00:00
2e0f741d01 can't use alloca in inline functions (fills up stack - I thought compiler would be smart here).
also reserve the exact number of vert/face/edge/loops when creating a bmesh during undo.
2013-05-09 11:42:24 +00:00
245a175a00 fix [#34657] Smoothing will not be updated in object mode, when hiding faces in edit mode and changing shape.
remove the option to skip hidden faces in BM_mesh_normals_update, use openmp to speedup recalculation for high poly meshes.
2013-04-24 12:07:13 +00:00
36e7a98459 fix [#35007] clipping border error
add clip option to ED_view3d_win_to_ray(), ED_view3d_win_to_segment()
2013-04-22 20:00:37 +00:00
9cceec40c4 use modified vertex coords for calculating display thickness and intersections.
internal improvement to editmesh_bvh.c

- optionally pass cage-coords as an arg, rather then calculating the coords in BKE_bmbvh_new(),
  since all callers already have coords calculated.
- de-duplicate coords creation function from knife and bmbvhm, move into own generic function: BKE_editmesh_vertexCos_get()
2013-04-18 01:20:04 +00:00
9f5006a967 add distance arg to BKE_bmbvh_ray_cast(). currently unused. 2013-04-16 15:16:48 +00:00
37e73aa368 code cleanup: use BKE naming conventions for functions in BKE_editmesh.h and BKE_editmesh_bvh.h 2013-04-16 05:59:48 +00:00
fa919d23bc move editmesh_bvh.c into blenkernel. 2013-04-16 05:23:34 +00:00
6da961775f code cleanup: rename BKE_tessmesh -> BKE_editmesh, rename EditDerivedBMesh.tc -> em. ('tc' is odd name which isn't used elsewhere). 2013-04-13 20:31:52 +00:00
1c3c4f3954 code cleanup: use bool's for vgroup and editmode. 2013-04-05 14:58:30 +00:00
6d8e25dfdc code cleanup: split editmesh_tools.c, into inset, bevel (both modal operators) and moved extrude operators into their own file.
also move some selection operators from editmesh_tools.c into editmesh_select.c
2013-04-01 10:18:01 +00:00
e7c15beaf6 code cleanup: use booleans for mesh and selection code. 2013-03-19 23:17:44 +00:00
7f8d597c79 fix [#32294] Navmesh crashed if on creation navmesh is also selected
thanks to Sv. Lockal for investigating and providing the fix.
2013-02-20 01:36:35 +00:00
b27854bd47 use booleans for bmesh api. 2013-01-14 16:42:43 +00:00
3225131223 speedup for EDBM_uv_vert_map_create(), reduce customdata lookups. also remove redundant check for hidden faces. 2013-01-12 20:01:09 +00:00
67a6d4dd56 fix for select flushing in face mode for mesh 'Select More' 2013-01-08 17:40:36 +00:00
b249255859 fix own error in bmesh/openmp unhiding, set BM_OMP_LIMIT to 0 so we can spot these cases more easily (will change before release). 2012-12-21 06:06:17 +00:00
1f3e3b0d68 include cleanup 2012-12-19 04:49:32 +00:00
738c482101 uv edge based stitch. Useful to disambiguate betwen islands
when uvs are shared by more than two islands. Uv edges
 usually belong to only two islands, making for much cleaner
 stitches. To change between stitch modes, press TAB.
 Initial mode depends on the selection mode of the image
 editor. Documentation can also be found on the release wiki
2012-12-17 20:14:07 +00:00
f1d3a2e130 Fix error compiling in debug build, should test #ifndef NDEBUG instead of 2012-12-12 16:51:05 +00:00
d5c2a1f8f4 remove context argument from EDBM_update_generic() 2012-12-12 15:22:54 +00:00
f06370dd44 fix for EDBM_index_arrays_ensure not working as intended. 2012-12-12 07:31:22 +00:00
2ee180eab6 add threshold for bmesh & openmp so its not used with low poly meshes, BM_OMP_LIMIT may need tweaking. 2012-12-12 07:20:34 +00:00
44b634bcb1 make EDBM_index_arrays's stay in memory, blender was allocating an array and filling it for verts/edges/faces on every redraw.
this may introduce bugs which I didn't catch, but they are very easy to identify in a debug build which has asserts to ensure the arrays are valid before use.

in my own test drawing ~98,304 quads - this gave an overall ~16% drawing speedup.
2012-12-12 06:53:39 +00:00
cf723e5e7c use htype flags as arguments to EDBM_index_arrays_init(), no functional changes. 2012-12-12 05:27:52 +00:00
3d69dbd44a use openmp to thread some common bmesh operations
- BM_mesh_elem_toolflags_ensure / bmo_flag_layer_alloc / bmo_flag_layer_free / bmo_flag_layer_clear
- BM_mesh_select_flush
- EDBM_index_arrays_init

notes:
- mostly use openmp `sections` to split operations on vert/edge/face since this is a fairly minor change.
- split tool flag pool in 3, this means we can allocate exact sizes needed and iterate on them in threads without alloc'ing.
2012-12-12 05:04:01 +00:00
9982b283e6 fix for asserts added in own recent commit with more strict type-checking
- BMO_slot_copy now only copies compatible elements.

other minor changes
- don't use text.format(...), convention for UI scripts is C style string formatting.
- rename bmo_edgenet_prepare --> bmo_edgenet_prepare_exec
- float/double warning in bevel.
2012-11-27 02:34:40 +00:00
f8bc346eff bmesh/py operator api:
add type checking for element buffers, there was nothing stopping python from passing any element type into an argument when in some cases only verts/edges/faces were expected.
now operator args define which types they support.
2012-11-27 00:50:59 +00:00
dbdc76c9d0 code cleanup: make bmesh operator names more consistant since python has access to these as input arguments and return values.
all output values currently have ".out" suffix, this may go in the future, but for now it makes it clear in C code what are inputs and outputs.
2012-11-20 05:50:19 +00:00
48639af5f8 use input and output slots for bmesh operators, needed for the python api to get return values. 2012-11-19 14:58:31 +00:00
ffd98941b5 Support for connected style proportional editing in UV editor. Now when connected proportional editing is on, only UVs on the same island will be proportionally moved. The implementation simply rejects UVs whose island does not belong to islands of selected vertices and decrements the total count of transform elements appropriately. Memory usage could be better but it would require some more preprocessing. 2012-10-22 07:29:38 +00:00
ad3f01e1d8 fix/workaround [#31811] Subdivision Surface (Apply modifier to editing cage during Editmode) Loop Cut Crash
A correct fix for this bug likely involves changuing how operators are called in the event loop but such changes better not be made just before the release.
2012-09-28 11:02:43 +00:00
0d5d2146eb code cleanup: make shape key api names consistent with our new convention. 2012-09-19 10:12:07 +00:00