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
06d5747ff3
was using max short on a float in EDBM_face_find_nearest()
2012-12-11 14:21:52 +00:00
634b22fc46
code cleanup: spelling labda -> lambda
2012-12-11 14:18:37 +00:00
bc94b8300e
de-duplicate labda_PdistVL2Dfl() & line_point_factor_v2()
2012-12-10 06:14:43 +00:00
5446dc0bf3
fix for various asserts running operator tests - not likely any of these would cause real user bugs though.
2012-11-30 16:41:43 +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
864c4112e9
Fix #33316 : mesh edge short path select was wrong on large/small objects.
2012-11-26 19:10:34 +00:00
c91562d0ff
Fix #33310 : unnecessary redraw of outliner when editing materials and textures.
2012-11-26 08:52:07 +00:00
387bb73e43
Change edge loop select and edge ring select to be consistent with
...
other selection operators. Instead of having only a single "extend"
option which causes the selection to toggle, there are now
three options:
- extend: adds to selection
- deselect: removes from selection
- toggle: toggles the selection
The default keymap is adjusted to have identical behavior as before,
using these new options, so end-users shouldn't experience any
difference.
2012-11-21 01:51:31 +00:00
622196113a
fix for missing bmesh operator flags when selecting linked (caused by own recent commits)
2012-11-20 20:45:04 +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
5716762c02
fix for changes in own recent commit:
...
selected linked in face mode was crashing. (needs bmesh operator flags)
also some style edits, remove unused includes and change triangulate modifiers use_beauty to a flag.
2012-11-19 23:52:24 +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
add5dd3797
add an operator for mesh mode switching,
...
this lets python menu for mode setting do mixed selection and extending the selection - just like the buttons in the header.
2012-11-13 05:44:49 +00:00
89845f280f
fix [ #33142 ] Ctrl LMB higher selection mode in edit mode sometimes selects extra elements
2012-11-11 23:33:59 +00:00
617a73c573
code cleanup: unused defines & some formatting.
2012-11-08 06:46:10 +00:00
718550878b
minor cleanup to to selecting the shortest path, change some variable names and make edge/face modes share the cost calculation function.
2012-11-08 03:39:15 +00:00
9bdfb82f05
add mesh editmode Ctrl+RMB to select the shortest path between faces, works the same as for edges.
...
Request from Kjartan.
2012-11-08 03:19:21 +00:00
5b0ee040a3
further cleanup for selecting the shortest path, remove the need for EDBM_index_arrays_* functions.
2012-11-08 02:33:26 +00:00
374238b7ef
code improvements for selecting the shortest path for mesh editmode,
...
this will give some speedup but its mainly to simplify the function.
- use bmesh adjacency data, was building its own data, left over from pre-bmesh.
- use a flag to store visited edges rather then a hash.
- store edge pointers in the heap rather then index values (was converting back and fourth a lot).
2012-11-08 02:12:31 +00:00
53160bd508
minor edits to mesh operators
...
- Rename 'mesh.select_nth' operator menu item 'Every N Number of Verts' to 'Checker Deselect',
since its not just de-selecting verts (works on edges and faces too) and the term 'checker' gives a better description of the result.
- Rename 'mesh.select_by_number_vertices' to 'mesh.select_face_by_sides', since this is a face selection tool, which wasnt obvious from its name.
also remove dissolve by type menu since the option has been removed from the operator and was giving an error.
2012-11-01 05:07:15 +00:00
dcb3a5cbf4
fix for crash in own recent commit to add comparison options for select-similar, missing NULL terminator item in the array.
2012-11-01 04:27:59 +00:00
330c0178ce
add the option to select Equal/Greater/Less when selecting similar.
...
Recently addons were submitted for review and this was the only advantage they had over blenders existing internal
select-similar tool.
2012-10-30 07:29:17 +00:00
b5e8e8da6f
add option to select face by matching number of sides.
2012-10-30 06:43:30 +00:00
c9dade4fe0
Big i18n commit: add "reports" from bmesh/readfile/tracking/dynapaint (and a few others), and another bunch of UI messages tweaks/fixes, as well as some BKE_report()<->BKE_reportf()...
2012-10-26 17:32:50 +00:00
248b2fc6d6
bmesh-decimator update
...
- update face normals when triangulating.
- avoid divide by zero when interpolating customdata on a zero length edge.
- replace zero float comparisons with fabsf() < FLT_EPSILON to avoid numeric error.
also renamed BLI_heap_empty() --> BLI_heap_is_empty() so its obviously readonly function.
2012-10-21 15:20:53 +00:00
f3ece5a108
style cleanup: trailing tabs & expand some non prefix tabs into spaces.
2012-10-21 05:46:41 +00:00
12a8c19956
un-subdivide bmesh operator, useful for making lower polygon versions of models, can give nicer results then edge collapsing which tends to give a lot of sharp triangles.
...
works on edges and faces, has iteration option to further reduce the poly count.
access from the edge menu, under subdivide.
example: http://www.graphicall.org/ftp/ideasman42/bmesh_unsubdivide.png
2012-10-16 16:04:12 +00:00
28c20e456f
fix for many RNA definitions having soft/hard ranges swapped, make this BLI_assert() on debug builds.
2012-10-11 23:46:12 +00:00
a17e1eea23
refactor foreachScreen functions for clipping, now the projection clipping flag is passed down directly rather then converting the enum into a flag, also fix own recent crash lasso seleting in object mode with pose objects.
2012-10-10 04:03:22 +00:00
22bf1e13db
code cleanup: split foreach object data iterator functions out of drawobject.c (since they are used for selection too), into their own file: object_iterators.c
2012-10-10 03:13:02 +00:00
c3ca19800c
refactor screen foreach functions to accept float[2] arguments rather then int pairs.
...
overall means less converting between float and int (and short in some cases).
2012-10-10 01:22:19 +00:00
ccd9f1491a
style cleanup: line length,
...
rename V3D_PROJ_RET_SUCCESS -> V3D_PROJ_RET_OK
2012-10-07 14:00:18 +00:00
4cc29110aa
fix writing past array bounds in imagewraposa().
...
also correct array sizes in othere areas.
2012-10-06 12:04:09 +00:00
db70bfc206
code cleanup: use functions to initialize selection user data structs, use radius-squared for circle select comparisons.
...
edge_fully_inside_rect() & edge_inside_rect() args were shorts when all callers were passing ints.
2012-10-05 15:44:11 +00:00
07b52efa20
fix for bug in loop select, picking the active vert/edge/face was using global space checks on object space coordinates. this removes last use of ED_view3d_project_float_noclip().
2012-10-05 04:18:52 +00:00
edb78d090c
code cleanup:
...
- make view3d project names more consistent.
- remove apply_project_float() its not needed.
- update comments referencing an old function name.
- move doxygen docs into the C file, prefer they are kept here to avoid getting out of sync with code.
2012-09-20 04:56:24 +00:00
f169643d46
fix [ #32604 ] Loop select broken with Clipped view and wireframe
2012-09-20 03:45:18 +00:00
e762797af5
fix for sharp edge selection being inverted, change default angle from 1 to 30deg.
2012-09-14 11:10:03 +00:00
a0ae47f06c
add some missing NULL checks, a few parts of the code used a pointer then checked it for NULL after.
...
also made it more clear that some areas assume the pointer isnt null (remove redundant NULL checks).
2012-09-11 02:18:27 +00:00
2812dd92cf
code cleanup: use BMEdit_FromObject() rather then me->edit_btmesh in more places.
2012-09-10 03:34:43 +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
9be74a514b
Fix [ #32260 ] 'Select Sharp Edges' works vice versa
...
We want to select edges sharpest than the given threshold, i.e. which faces’s angle is below the limit! Looks like BMesh switched this somehow...
2012-08-05 07:50:51 +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
84bf3e48c0
style cleanup: use c style comments in C code
2012-07-06 23:56:59 +00:00
69a7e0af02
rename bmesh ops since they are exposed in an api now.
2012-06-30 15:27:13 +00:00
d68fc2b916
Fix for [ #31900 ] Loop Selection on wireframe selects vertex behind.
...
Revert part of r48105 (calling mouse_mesh() in mouse_mesh_loop() is not a good idea, as it might select another element ouside the selected loop, and is anyway overkill!), added lighter code that simply checks for the nearest vertex/face of current edge.
2012-06-25 13:32:04 +00:00
fc1164c223
Fixes [ #31577 ] Select N-th vertex/face/edge doesnt work
...
http://projects.blender.org/tracker/index.php?func=detail&aid=31577&group_id=9&atid=498
Also solves both TODOs in the commented code.
Loop select now calls mouse_mesh() to handle setting an active vertex/edge/face.
2012-06-20 07:31:19 +00:00