Commit Graph

70 Commits

Author SHA1 Message Date
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
d1cde59ed3 fix [#32442] UNDO causes actual shape key to be lost, undoing a modification of another shape key. 2012-09-17 06:14:09 +00:00
e647c748fb fix [#32518] Vertex slide crash sometimes.
Undo would leave BMEditMesh->me pointer NULL, this would likely crash EDBM_verts_mirror_cache_begin() too.

Rather then restore 'me', remove the pointer altogether and use BMEditMesh->ob->data to save us having to keep track of 2 pointers.
2012-09-10 03:42:29 +00:00
04418fe8dd code cleanup: header had many incorrect sections for function/file, also rename mouse_mesh() --> EDBM_select_pick() 2012-09-07 00:22:10 +00:00
fe9b1c644f Fix #32458: changing UV image in image editor not working when the active face
was not selected. Now changed it so that the active face must also have its
UVs shown in the image editor to be used as the source of the image shown.
2012-08-31 15:01:40 +00:00
dfd54c61d1 Possible fix for #32446: after undo in mesh edit mode, vertex/edge/face
selection syncing would not work correct, in this case deselecting an edge
would deselect the two vertices even if it wasn't needed.
2012-08-30 14:18:14 +00:00
90d215535e add option so operators can be called with a flag, currently the only flag is to respect hidden geometry.
this is useful for bmesh tools that operate in object mode or for modifiers which would previously use hidden faces in some cases.
2012-07-21 00:58:02 +00:00
c8db1e832d minor edits for bmesh api 2012-07-20 09:49:54 +00:00
69a7e0af02 rename bmesh ops since they are exposed in an api now. 2012-06-30 15:27:13 +00:00
5ff7ede1b5 modal operation for bevel and inset:
This commit adds some first building blocks for the two operators to work modally based on mouse input. To make their function easier, two hotkeys are introduced, Ctrl+B for bevel and I for inset.

TODO:
After discussion with Campbell, we would like to add scale-style line indicators for the operators. This is already done for transform operators but a new interface for mesh operations may have to be written using pieces from that code since, strictly speaking bevel and inset are not exactly "transform" operators.

Also, a better input method for inset is needed and more options exposed. The method implemented right now uses mouse move for thickness and ctrl-mouse move for depth. These are calculated using the distance of the selection center in screen space and the mouse position. While that may work and prevents abrupt changes in values when switching from thickness tweak mode to depth tweak mode, it limits the magnitude of values that can be put into the tool especially in small or large scale. 

Alternatives until a better method is written include:

* use relative offset (works but may give strange results)
* tweak manually after the operation.
2012-05-16 14:30:41 +00:00
c91cee2bb9 code cleanup: naming - BKE_mesh_* 2012-05-05 21:28:12 +00:00
a731e13043 code cleanup: function naming, use BKE_*type* prefix. 2012-05-05 14:03:12 +00:00
5da2135eef code cleanup: double promotion & some style cleanup 2012-05-03 21:35:04 +00:00
950ed69297 code cleanup:
- replace inline face UV center calc.
- use const float[3] for mesh and uv functions.
- remove unused define
2012-04-28 08:29:20 +00:00
47b6b60e5a code cleanup: no functional change - had both EDBM_editselection_* and BM_editselection_* funcs, replace EDBM_ funcs. 2012-04-24 21:19:18 +00:00
8baa5fbde2 - fix for python freeing its own bmesh clearing the global mirror cache.
- fix for own mistake (Ctrl+T didnt set beauty peroperty).
- remove bad level includes in bmesh.
2012-04-23 04:24:11 +00:00
b40476455e code cleanup: remove unused BMesh args. 2012-04-19 14:38:09 +00:00