Commit Graph

78 Commits

Author SHA1 Message Date
1b19b790dd fix for knife when clipping was enabled, The knife would not snap to edges/verts outside the clip area but the geometry would still get cut 2012-12-10 08:15:14 +00:00
b0a361584a knife tool was incorrectly moving points into worldspace, then checking clipping against the object space bounds.
more fixes needed here but at least correct whats there.

also ensure clipping is initialized from the object before handling modal operator events.
2012-12-10 07:20:52 +00:00
bc94b8300e de-duplicate labda_PdistVL2Dfl() & line_point_factor_v2() 2012-12-10 06:14:43 +00:00
27ddd17ef9 some of the modal knife key bindings didn't cause a refresh until you moved the mouse. - snap, angle snap, midpoint snap. 2012-12-10 05:07:46 +00:00
6ce73abde8 fix [#33400] Knife ortho floating point error
the green dot under the mouse would not draw under the mouse when clipping values were high (1000+) - which is common.
use a different method which doesnt give these problems.
2012-12-03 15:09:33 +00:00
07ccd3ee3f fix [#33029] Applying modifier leaks memory
Thanks for Sergey for finding the bug & patching, This fix works a bit differently.
Theres no need to allocate the customdata in the first place - since its written into. So add a flag for vert/edge/face/loop creation functions so they can skip customdata creation.
2012-11-29 16:26:39 +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
0bfc92ff8e BM_iter_as_arrayN() can now take an optional existing array argument, useful to avoid many small malloc's by passing a fixes size stack variable instead.
Will give some speedup to edge-split modifier and bevel.
2012-11-12 05:53:43 +00:00
be5e2a0dd4 Fix knife sensitivity issue (#30637): better calculation of how
to clamp distances in ortho mode.
2012-10-23 18:17:51 +00:00
d677e4b8b3 Use better epsilon for line intersection, fixes bug where
missed some hits on very small scale meshes, e.g., bug #31143.
2012-10-23 14:57:25 +00:00
f70d2c65d8 rename api functions...
- minf, maxf, mini, maxi --> min_ff, max_ff, min_ii, max_ii
2012-10-23 13:28:22 +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
b26ccf0aff toggle cut through in the knife tool now refreshes (before you had to wave the mouse about to see the result).
also remove print from last commit.
2012-10-06 03:34:52 +00:00
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