Commit Graph

69 Commits

Author SHA1 Message Date
cadf77d5ef Fix T40862: numinput transform did not take into account scale_length. 2014-06-30 10:57:39 +02:00
48446870a8 Code cleanup: remove redundant CTX calls 2014-04-30 08:11:47 +10:00
b6e967be63 Code cleanup: const args and arrays 2014-04-27 08:56:54 +10:00
57dba73917 View3d: take pixelsize into account for selection distance 2014-03-11 15:34:19 +11:00
d8f4cb9b69 Fix T37965, loop multicut confirmation not happening when numeric input
is used. When numerical input was active confirmation events were not
getting handled.

Code here seems a bit duplicated, it may be possible to simplify it, but
leaving it slightly bloated for now.
2014-01-01 06:27:17 +02:00
87cc890aef Support units in modal numinput
Summary:
This completly changes the way modal numinput is handled. Now, edited expression is a string, which then gets unit- and py-evaluated to get a float value.

We gain many power and flexibility, but lose a few "shortcuts" like '-' to negate, or '/' to inverse (if they are really needed, we still can add them with modifiers, like e.g. ctrl-/ or so).

Features:
- units (cm, ", deg, etc.).
- basic operations from python/BKE_unit (+, *, **, etc.), and math constants and functions (pi, sin, etc.).
- you can navigate in edited value (left/right key, ctrl to move by block) and insert/delete chars, e.g. to fix a typo without having to rewrite everything.
- you can go to next/previous value with (ctrl-)TAB key.
- As before, hitting backspace after having deleted all leading chars will first reset the edited value to init state, and on second press, the whole "modal numinput" editing will be cancelled, going back to usual transform with mouse.

Notes:
- Did not touch to how values are shown in header when modal numinput is not enabled (would do that in another commit), so this is still quite inconsistent.
- Added back radian support in BKE_unit.
- Added arcminute/arcsecond to BKE_unit.
(those unit changes affect all angle UI controls, btw, so you can now enter radians or longitude/latitude values when in degrees units).

Related to T37600.

Reviewers: brecht, campbellbarton, carter2422

Reviewed By: brecht, campbellbarton, carter2422
Thanks everybody!

Differential Revision: http://developer.blender.org/D61
2013-12-21 17:44:48 +01:00
7267221715 remove return argument from wmOperatorType->cancel, was only ever returning OPERATOR_CANCELLED. 2013-10-30 23:08:53 +00:00
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
ecc5eb59c6 fix [#37030] Loop Cut and Slide doesn't clear header text if you click a blank area 2013-10-10 21:04:39 +00:00
31761f5e5b code cleanup: replace bmesh_radial_face_find -> BM_edge_in_face 2013-08-03 15:30:57 +00:00
a2492e0603 style cleanup: braces/indentation 2013-07-19 16:44:17 +00:00
1d761d0eca fix [#36106] Defining the Loopcut number with the keyboard is limited to 130
mousewheel value is now clamped too and raised the limit to 500.
2013-07-12 01:33:42 +00:00
aabddad346 draw loopcut display on the deformed mesh when in editmode. 2013-07-10 02:05:16 +00:00
501f655503 fix [#35648] Loop cut, smoothness showing wrong symmetrical
this is more of a feature request then a bug, but nicer to use even smoothing offset for loopcut smoothing.
2013-06-10 04:33:05 +00:00
b9fa4f7df9 workaround for loopselect-slide (with multicut enabled) changing from vertex-select to edge-select.
this is needed to slide, but wasn't so nice for users, now restore the original mode.
2013-05-16 18:33:07 +00:00
e4aff35020 smooth falloff options for loopcut. 2013-05-08 12:58:28 +00:00
d92bd6bb04 fix [#35194] Change view while LoopCut is active breaks the cut options
use edge-index rather then mouse coords for loopcut so the viewport doesn't interfere.
2013-05-03 00:22:22 +00:00
35ddc47d38 fix for regression where tessface weren't recalculated when running loopcut outside of a macro. 2013-04-26 19:25:56 +00:00
61ad024b7e fix for recent commit that allowed incorrectly flushed face selection. 2013-04-26 18:45:05 +00:00
2e89f6350d edgeslide fixes/tweaks
* re-executing edgeslide was using initial mouse coords only.
* allow negative smooth
* allow more then 10 cuts in RNA limits.
2013-04-26 18:12:05 +00:00
44b9de12b5 add exec() to loopcut so it supports redo. 2013-04-26 17:29:42 +00:00
dfc406fc2c fix/feature [#35085] Loop cut slide
Loop cut slide now works with multicut.

issue is that since edge slide now supports more configurations, cases where loop-cut-slide silently failed before,
now slide (albeit in an awkward way at times).

Fix this my adjusting the selection of after loopcut so edge slide can properly operate on it.
2013-04-26 15:05:19 +00:00
34f9932418 simple optimization, replace BM_face_other_edge_loop() with BM_loop_other_edge_loop() in situations where the loop is known this avoids a lookup. 2013-04-19 01:02:58 +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
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
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
f8611bac8f - add knife project to toolbar.
- when running knife project, disable vertex selection since it may select areas between the newly cut regions.
  add EDBM_selectmode_disable() function since loopcut does this too.
- (optimization) avoid looping over all geometry when flushing and no selection exists.
2013-03-20 16:03:34 +00:00
e7c15beaf6 code cleanup: use booleans for mesh and selection code. 2013-03-19 23:17:44 +00:00
aaa8a13c49 code cleanup: use const events for modal and invoke operators. 2013-03-13 09:03:46 +00:00
04d628a5b5 Another huge bunch of new UI translations (some reported by Leon Cheung, thanks!)... 2013-02-19 15:45:56 +00:00
761ac89877 style cleanup 2013-01-15 23:45:41 +00:00
9f2e845181 code cleanup: use BMW_begin insode for loops body. 2013-01-14 09:53:56 +00:00
192e00b0c9 code cleanup: use interp_v3_v3v3() 2012-12-19 04:59:47 +00:00
1f3e3b0d68 include cleanup 2012-12-19 04:49:32 +00:00
d5c2a1f8f4 remove context argument from EDBM_update_generic() 2012-12-12 15:22:54 +00:00
8e9a6871b4 fix for crash in own commit r52911 2012-12-12 15:01:27 +00:00
0b9be70591 typo's and some style cleanup, also added asserts into BLI_vsnprintf and BLI_sprintfN when invalid args are given. 2012-11-28 06:43:04 +00:00
8ecce451ab bmesh operator naming - use clearer names for args eg: (mat -> matrix, use_singleedge -> use_single_edge)
also remove duplicate docs for operator arg formatting.
2012-11-28 00:16:06 +00:00
cf2c459325 Fix #33285: loop cut is not supposed to cut through triangles/ngons, but it
still happened  when the loop would go all the way around the mesh with just one
triangle/ngon inbetween to close the loop.
2012-11-26 06:59:59 +00:00
e77e1f183a fix for uninitialized memory use with numeric input:
bevel/inset/marker-move would use uninitialized memory when used as modal operators and pressing backspace after entering values.
2012-11-26 03:47:20 +00:00
a7bee65d38 make smoothing value for ring select compatible with the operator.
also wrap long lines in noise.c
2012-11-13 02:45:42 +00:00
6335401a49 todo from 2.4x, add back smooth option to edge loop cut. 2012-11-13 02:28:07 +00:00
6cdb555e6e bmesh refactor - rename some of the BM_****_share_****_count() functions to BM_***_share_check()
some of these were only returning a boolean, others returned a count even though only a boolean was needed.

split some of the functions in two as well where check/count are both needed.
2012-11-09 14:52:05 +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
fec81d9b56 use min_ max_ functions in more places.
also fix minor error in MOD decimate when the modifier did nothing the reported face count would be wrong.
2012-10-23 16:21:55 +00:00
f3ece5a108 style cleanup: trailing tabs & expand some non prefix tabs into spaces. 2012-10-21 05:46:41 +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
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
25c96bc9f3 code cleanup: remove unused macros, commet some which may be useful later - or good to keep for completeness. quieted some warnings and add flags -Wmissing-include-dirs and -Wno-div-by-zero to cmake/gcc 2012-09-20 01:02:39 +00:00
3d9637f60a Fix [#32133] Numpad Enter key doesnt work with Loopcut (worked in 2.49b)
Adding PADENTER to the "OK" keys...
2012-07-17 17:55:23 +00:00