Commit Graph

164 Commits

Author SHA1 Message Date
2ba295bcd1 knife tool: avoid sqrt's for length comparison, and define KNIFE_FLT_EPS rather than using (FLT_EPSILON * 80). 2012-10-05 04:43:46 +00:00
d8144ef0f5 style cleanup: comment blocks 2012-10-04 13:26:15 +00:00
ed1cda9a6c style cleanup 2012-09-30 06:12:47 +00:00
dbeddcdbce style cleanup: also correct incorrect doxy heading 2012-09-26 20:26:31 +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
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
306e2b4878 stule cleanup 2012-09-04 18:47:08 +00:00
aaafa0c2fe code cleanup: move file string defines into BLI_path_utils.h, BKE_utildefines is now unused but keep incase we want to add defines there later. 2012-09-03 22:04:14 +00:00
5c2d9022d9 Fix knife bug #30764, failure to cut sometimes.
Two bugs: first, the point-in-face function had a bug that made it fail for the xz or yz planes.
Second, in ortho mode, simultaneous linehits need careful sorting.
Also, in orth mode it is somewhat random whether the edges exactly behind the front ones are reported 'hit' by bvh tree, so put in code to prevent cuts along the parallel-to-view faces when not in cut-through mode.
2012-09-03 14:37:34 +00:00
ca6fa937d4 style cleanup 2012-09-03 05:36:47 +00:00
56534ecdcb style cleanup: also add debugging print function for derived mesh DM_debug_print_cdlayers() 2012-09-03 02:41:12 +00:00
3e5cbb48f6 Fix knife stack overflow (bug #31907).
The mutual recursion was removed: it was not needed.
2012-08-07 12:54:32 +00:00
21a137471d Fix to knife: would sometimes miss cuts on non-planar faces.
Also, there was a needless loop through all three loops of
a tesselation triangle, which all share the same original face.
Also, made an early out for case where an edge cut had already
been discovered on a Knife edge.
2012-08-06 13:37:25 +00:00
e32c60284a style cleanup 2012-07-29 00:20:28 +00:00
b1a1f7e0e7 Fixed some knife cut failures.
Fixes #31391.  Some cases still fail but these
changes are good because they fix a bogus
calculation of the 'basef' of some cut segments.
2012-07-27 20:12:29 +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
3a0593cc3d code cleanup: dont use function calls like dot_v3v3, pow and sqrt within macros which results in calling the function multiple times needlessly.
also added some comments.
2012-07-06 22:48:28 +00:00
69a7e0af02 rename bmesh ops since they are exposed in an api now. 2012-06-30 15:27:13 +00:00
ec3399efa6 This backtracks an error introduced in r48155 when trying to fix: http://projects.blender.org/tracker/?func=detail&atid=498&aid=31433&group_id=9
First half of the problem is fixed, but the second issue regarding edge/vertex snapping disregarding angle constraints will need some refactoring eventually.
2012-06-22 04:40:38 +00:00
11cb213d45 Fixes [#31433] BMesh: Knife tool Angle Constraint function
The problem was that calculating the angle was reliant on previous mouse coordinates, which did not update to match snapped-to vertices and edges.

This solves the issue by updating mouse coordinates in knife_find_closest_edge() and knife_find_closest_vertex(). Additionally, when angle constraints are enabled, edge/vertex snapping is now prevented.
2012-06-21 08:58:17 +00:00
32530c2827 Quite some warnings... 2012-06-07 18:21:07 +00:00
3896ad4cbb code cleanup: spelling 2012-05-20 21:23:26 +00:00
ed33320e3f Code cleanup: simplify standard GHash creation.
Added four new functions as shortcuts to creating GHashes that use the
standard ptr/str/int/pair hash and compare functions.

GHash *BLI_ghash_ptr_new(const char *info);
GHash *BLI_ghash_str_new(const char *info);
GHash *BLI_ghash_int_new(const char *info);
GHash *BLI_ghash_pair_new(const char *info);

Replaced almost all occurrences of BLI_ghash_new() with one of the
above functions.
2012-05-16 00:51:36 +00:00
c8ebfe1d12 code cleanup:
- use bmesh iterator macros in more places
- rename scanfill variables (were using same names as mesh faces/verts which was confusing)
2012-05-13 14:47:53 +00:00
e17a708dce add back pose specials menu, also add back the ability to clear user transforms on all bones (not just selected - mango request - was possible in 2.4x).
- rename only_select op property to only_selected (both were used).
- only do mingw workaround when building with FREE_WINDOWS defined.
2012-05-06 12:13:45 +00:00
4c5502bfd6 code cleanup: function naming for BLI functions. 2012-05-05 00:23:55 +00:00
5da2135eef code cleanup: double promotion & some style cleanup 2012-05-03 21:35:04 +00:00
4965f3d022 Fix #31234: vertex normals not update after knife cut. 2012-05-03 16:35:51 +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
6d2cd24010 fix memory leak in validating mesh and remove unneeded knife operator settings store. 2012-04-26 15:20:26 +00:00
61015fbd8c fix for memory leak in the knife tool 2012-04-26 04:41:27 +00:00
7cc4353dff Update knife tool header to reflect that spacebar can be used for confirm too. 2012-04-23 21:04:26 +00:00
aa09c5750e add spacebar to confirm knife cut, space confirms - enter isnt so handy, This is consistent with fly mode and grab. 2012-04-23 11:19:39 +00:00
cb3dc8ff0e Knife tool: Increase the header string length to avoid clipping the message. 2012-04-20 14:46:46 +00:00
ed81982049 knife tool alpha values where being set to zero (intersection points weren't visible), error made when converting to theme colors.
also minor bmesh style cleanup.
2012-04-20 13:45:38 +00:00
5874106ea7 style cleanup 2012-04-20 12:26:16 +00:00
4d1faf1fd9 knife tool: use the knife mouse cursor, dont store the context in the knife tool data, also rename struct camel case (follow own style guide) 2012-04-20 12:19:09 +00:00
aa02acfe95 knife tool: store color once on initializations, de-select only when cutting selected. 2012-04-20 12:05:08 +00:00
617af9d99d knife tool now selects newly cut edges. 2012-04-20 11:14:16 +00:00
3d851bfd5b knife tool modifications
from user freedback it seems there are 2 use cases, both valid.
* Select geometry and cut the selection in half (as 2.4x worked)
* Point-to-point define the faces to cut, dont cut through everything (only cut what you see).

With the second, since you are already selecting the edges to cut and snapping to them. only cutting the selecting is limiting/annoying.


Modifying these options while the knife tool runs doesn't work well, so expose under 2 keys, K, Shift-K.
2012-04-20 10:52:13 +00:00
b40476455e code cleanup: remove unused BMesh args. 2012-04-19 14:38:09 +00:00
ac6b702c93 Change knife header to reflect current key binding (RMB cancels now). 2012-04-19 13:59:03 +00:00
475ecbb0ce remove BM_ITER, BM_ITER_INDEX macros, use ELEM or MESH variants only (the maceros had unused args in both cases). 2012-04-19 13:47:58 +00:00
9276d7aeb2 For bug #30931, change knife hardcoded colors to ones derived from theme.
For now, just reusing some theme colors that are there for other reasons
but matched approximately the colors used now.
Except that cut lines are now purple-violet, so that they contrast
with grid and edges better, especially in wireframe.
2012-04-19 13:44:28 +00:00
75b869e428 style cleanup: BM_ITER / BM_ITER_INDEX / BMO_ITER 2012-04-19 11:44:12 +00:00
aeccaa6f32 knife tool: Add state indicator in header for tool options 2012-04-18 19:59:27 +00:00
446d5ad970 bmesh knife tool: cut through no longer initializes from view setting to limit selection to front faces.
instead this is a toggle (Zkey) which is remembered between executions.
2012-04-18 18:20:20 +00:00
d4bc938676 bmesh knife tool:
fix for bug where not moving the mouse after pressing K and clicking would start the first point at the bottom left of the view.
2012-04-18 16:55:15 +00:00
486bf16af5 bmesh knife tool:
- only cut selected geometry.
- exclude hidden geometry from snapping.
2012-04-18 16:27:11 +00:00
40e3ae6478 correct ifdef'd scanfill code, incase someone wants to test. 2012-04-18 15:09:13 +00:00