Commit Graph

164 Commits

Author SHA1 Message Date
fa919d23bc move editmesh_bvh.c into blenkernel. 2013-04-16 05:23:34 +00:00
afb4b65167 Random number generator: replace a bunch of usage of the global random number
generator with a local one. It's not thread safe and will not give repeatable
results, so in most cases it should not be used.

Also fixes #34992 where the noise texture of a displacement modifier was not
properly random in opengl animation render, because the seed got reset to a
fixed value by an unrelated function while for final render it changed each
frame.
2013-04-15 23:12:40 +00:00
da5e0ea8fe bmesh operators: use operator type-flag to specify which operations require normal-calculations and which operations require selection flushing.
eg, no need to flush selection after 'Smooth' tool, no need to recalculate normals after 'Select Similar'.
2013-04-14 06:22: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
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
cb11af8b06 fix for knife tool crash when knife_make_chain_cut() couldn't create a new face. 2013-03-19 21:37:22 +00:00
a7b83837db fix for crash when using BM_face_calc_tessellation(), its not ensured that all tris will be filled in.
(effected knife project and laplacian smooth).
2013-03-16 14:18:32 +00:00
6347f96f53 knife project improvements
When running in non-interactive mode, dont add a area draw callback or adjust the cursor, use a fixed snap value and don't use opengl lookups on faces.
Minor optimization - compare squared distances where possible.
2013-03-15 20:39:56 +00:00
433c82649e knife project: improve selection inside/outside checks.
- use more accurate method to find if a face is inside projected lines.
- check faces intersect while expanding selection - in some cases this could result in the entire model being selected.
2013-03-15 19:38:42 +00:00
40bfce6616 use bool for knife, also scons tab/space mix. 2013-03-15 19:00:21 +00:00
630798ba3c add in ifdef for WITH_LIBMV, correct own error passing float[2] as float[3] 2013-03-15 15:47:32 +00:00
1d5d8bc934 knife project:
- selecting faces inside the cut now works properly
- improve epsilon for detecing if faces are inside a cut (still not perfect)
2013-03-15 14:43:09 +00:00
03f02019f2 knife projection feature,
apart of 3d printing tools - use to cookie-cut text into a mesh.
2013-03-15 13:06:31 +00:00
d92e32e4e7 use floats for knife tool internal mouse coord. 2013-03-14 14:46:59 +00:00
8dd2464626 minor knife refactor to prepare for running non interactively. 2013-03-14 13:58:56 +00:00
1158f06b57 code cleanup: de-duplicate view clipping function for paint and knife tool, minor changes to knife initialization. 2013-03-14 07:56:40 +00:00
aaa8a13c49 code cleanup: use const events for modal and invoke operators. 2013-03-13 09:03:46 +00:00
347e2b6cb0 code cleanup: make bmesh var names more consistent 2013-03-09 17:12:24 +00:00
d9d1f8e58f Raise a bit Header string fixed length, else some translations (e.g. Japanese) have not enough room! 2013-02-20 13:07:28 +00:00
04d628a5b5 Another huge bunch of new UI translations (some reported by Leon Cheung, thanks!)... 2013-02-19 15:45:56 +00:00
66e160d503 Fix Knife cut-through bug #34072. 2013-02-08 13:51:29 +00:00
c30fb009cc problem with own changes to triabgulate: calling beauty fill directly would re-allocate the faces which mean't triangulates output slots pointers became invalid. (noticed when using from py api) 2013-02-06 15:57:12 +00:00
c93e127e7a code cleanup: style and replace (float)sin, (float)cos with sinf, cosf 2013-01-12 14:28:23 +00:00
45c453c9b1 replace inline with BLI_INLINE define. 2013-01-12 10:39:09 +00:00
d1d3384750 Fix knife angle constraint bug #33813 by changing knife mvals to floats.
The problem was that by snapping the integer mouse values to
lines through the previous point, the angle was slightly off.
2013-01-11 14:13:22 +00:00
e24443b79a style cleanup 2013-01-09 03:30:15 +00:00
4190169282 code cleanup, also remove glError check in font drawing code since its now a debug option. 2013-01-04 17:24:40 +00:00
0f56514986 Fix knife cut bug #33625, failure to cut in otho mode sometimes.
Problem was that the code to limit the front and back planes
for better precision assumed line would have center near origin.
2013-01-04 15:06:34 +00:00
b2c66e268f replace MIN/MAX 3,4 with inline functions 2012-12-21 05:07:26 +00:00
1f3e3b0d68 include cleanup 2012-12-19 04:49:32 +00:00
f596cb2721 Fix knife cut-through bug #33571.
The code to connect across a face didn't stop after it found one.
2012-12-17 00:31:59 +00:00
d5c2a1f8f4 remove context argument from EDBM_update_generic() 2012-12-12 15:22:54 +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
71730f26d7 replace BLI_array_fixedstack_declare with() new macro BLI_array_alloca() which uses stack memory always and doesn't need to be freed explicitly. 2012-12-11 15:10:19 +00:00
634b22fc46 code cleanup: spelling labda -> lambda 2012-12-11 14:18:37 +00:00
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