Commit Graph

49 Commits

Author SHA1 Message Date
1300721d57 add asserts to ensure face normal is up to date. 2013-07-29 09:12:23 +00:00
4982f200fa move alloca define into its own header since its not related to BLI_array 2013-07-28 10:38:25 +00:00
c098557240 fix [#36100] bevel lost selection
interpolating loop was copying face attributes including selection, checked all users of this function and its safe to remove the call (which is bad to begin with).
2013-07-11 14:21:50 +00:00
b36999b2f7 bm_loop_interp_mdisps was doing multiple lookups in the same pointer in a nested loop. only need one, also avoid multiple layer lookups with mdisp calculation/smoothing 2013-07-11 01:28:27 +00:00
cda5770160 code cleanup: also fix crash in GPU_state_print(). and confine to debug mode builds. 2013-06-13 11:59:28 +00:00
e895c8302e Use OpenMP threads in bm_loop_interp_mdisps
Gives approx 2x speedup on my laptop on such operations
as mesh subdivision in edit mode. Desktops with fancier
CPUs could benefit even more.

Thanks Campbell for review!
2013-06-11 09:14:39 +00:00
8ac2fee57a minor speedup for bmesh - add CustomData_bmesh_free_block_data(), use
when the block would be immediately allocated again.
2013-05-08 13:00:25 +00:00
1edf56e7a5 fix [#35150] Crash when bmesh operation called from within a Panel draw()
accessing a bmesh from python would reallocate all customdata layers.

add an assert to BM_data_layer_free(), when its called unnecessarily since its reallocating all layers.
2013-04-29 20:21:19 +00:00
c68ae745b6 interpolate verts as well as loops for inset.
- add vertex option to BM_face_interp_from_face, also expose via python.
2013-04-10 23:25:44 +00:00
634dfcdecc fix for fix: re-activating buttons to fix [#33466], meant the icon didn't get refreshed immediately. 2013-04-08 00:32:32 +00:00
b1ac23c5bd Mesh Tool,
inset interpolation now works for 'inset_region', enabled by default.

Example:
http://www.graphicall.org/ftp/ideasman42/inset_interpolation_new.png
2013-04-07 11:41:37 +00:00
b4e7e7efd6 improve bmesh face interpolation - transforming verts into the faces plane rather then using dominant axis or calculating in 3d with interp_weights_poly_v3(). 2013-04-07 02:10:15 +00:00
93ac968db3 code cleanup: include order 2013-04-05 17:56:54 +00:00
347e2b6cb0 code cleanup: make bmesh var names more consistent 2013-03-09 17:12:24 +00:00
b27854bd47 use booleans for bmesh api. 2013-01-14 16:42:43 +00:00
c3b5c726c7 * Fix for #31581. The issue was that we scaled the face prior to
projecting it. The original paper suggests to simply interpolate between
the two points of an edge if the distance of the point to that edge is
smaller than a threshold.

* Fixed both 3D and 2D code to utilize this. Possibly other places in
blender where this scaling is done will have to be adjusted.

* Changed vertex interpolation to use 2D interpolation, since it already
did projection on plane and 2d calculations are faster.

* Also added notifier on hard recalc when uvcalc_transfor_correction is
used. Results in instant feedback on UV editor when edge sliding.
2013-01-07 21:42:40 +00:00
fb989c2a65 code cleanup: don't alloca zero size and remove paranoid NULL checks (checked all uses and there not needed). 2012-12-24 14:59:15 +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
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
a1856a38f6 minor improvement to vector api use, replace add, multiply by 0.5 with mid_v3_v3v3 2012-10-30 14:22:49 +00:00
e5a31eff37 code cleanup: use squared length for comparisons and is_zero_v# rather then checking length == 0. 2012-10-25 23:04:33 +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
7deb8d8a26 code cleanup: spelling 2012-10-20 20:36:51 +00:00
0d5d2146eb code cleanup: make shape key api names consistent with our new convention. 2012-09-19 10:12:07 +00:00
e91e1814d0 fix own error in BM_data_interp_from_edges() from recent commit. 2012-08-23 09:20:15 +00:00
6e90903baf - add BM_data_interp_from_edges() function (matches BM_data_interp_from_verts).
- bridge-merged now merges edge customdata and flags for verts and edges.
2012-08-23 05:19:40 +00:00
ca7d1ec39d style cleanup: use <pre> for doxygen ascii art 2012-08-13 15:17:15 +00:00
c41e1e434a code cleanup: replace MIN2/MAX2 with minf/maxf 2012-07-29 16:59:51 +00:00
c63602286c Fix for customdata layer copying. Issue was caused by mixing up of destination and source in copy function. Also fixed an error in Py API, check to see if layers were different should be check to see if they're the same. 2012-05-22 12:03:56 +00:00
2a1ba8c85b style cleanup: formatting and some float/double promotion 2012-05-03 19:57:24 +00:00
1d743d11dc bmesh - python api
- bm.*.layers.*.verify()
- bm.*.layers.*.is_singleton
- bm.*.layers.*.copy_from(other)


also added api functons
- BM_data_layer_copy(...)
- CustomData_layertype_is_singleton(type)
2012-04-30 18:54:14 +00:00
b40476455e code cleanup: remove unused BMesh args. 2012-04-19 14:38:09 +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
75b869e428 style cleanup: BM_ITER / BM_ITER_INDEX / BMO_ITER 2012-04-19 11:44:12 +00:00
4f19c1a995 spelling cleanup 2012-03-18 07:38:51 +00:00
99f72dfbfc Add 'level' field to struct MDisps, companion to 'totdisp'.
Gets initialized when loading old files and updated at the same places
totdisp is updated. Saves having to do log+sqrt to extract level from
totdisp.
2012-03-14 03:10:18 +00:00
dfdfa3d51b code cleanup: replace macros VECCOPY, VECADD, VECSUB, INPR - with BLI_math funcs.
added copy float/double funcs: copy_v3fl_v3db(), copy_v3db_v3fl(). 2d & 4d too.
2012-03-09 06:04:17 +00:00
17786b3b3e building without python works again, cleanup bmesh include paths (cmake and scons). 2012-03-08 03:25:53 +00:00
921a7556fb bmesh - changes to mempool allocations
* double default edge allocation size (double the number of verts/faces).
* CustomData_bmesh_init_pool was using allocsize & chunksize as the same variable. Now use type specific chunk size.
* bmesh copy and editmode conversion now allocate the BMesh mempool size needed for the entire vert/edge/loop/face arrays since its known already.
2012-03-01 22:17:04 +00:00
a6f420b828 update doxygen comments for bmesh. 2012-02-29 06:55:10 +00:00
2a7f1af61e Code Cleanup:
- apply some rules for function naming conventions, added to main bmesh doc in bmesh.h.
- remove unused function BM_loops_to_corners().
2012-02-28 19:10:53 +00:00
d1d11bbe9b more header re-arranging.
Some function comments were in headers, some in the C files, some in both.
Moved function comments from headers into the C files.
2012-02-28 18:28:30 +00:00
3ba37b65a3 style cleanup 2012-02-26 22:38:49 +00:00
98aececc8e bmesh code cleanup
* change BMO_elem_flag_* defines to inline functions.
* BMO_slot_map_insert() is too big for an inline function - un-inline it.
* remove redundant casts.
2012-02-25 20:58:03 +00:00
3663bd580f Remove debug print code.
It was harmless because it ifdef-ed, but it's likelly not needed anymore.
2012-02-21 17:27:33 +00:00
4041c57756 - Remove unused code in bmesh interpolation module and switch it to using mathutils
functions instead of own macros for vectors.
- Double precision isn't needed here at all. It only makes it impossible to use
  mathutils, adds extra float<->double conversions without any benefits.
  (current multires interpolation is already an approximate method and it can't
  be improved using double precision)
2012-02-21 17:24:05 +00:00
debd32d336 Improved displacement flipping algorithm to work properly in cases when target grid isn't orthogonal.
Subdivision of face now works pretty smooth, only producing minor unwanted displacement on the along edges.
2012-02-21 17:23:32 +00:00
b2fd08c754 Flip displacement direction after interpolation in bmesh_loop_interp_mdisps
This is needed because displacement might been interpolated from a grid
with different orientation and in this case X and Y components of displacement
are need to be flipped in needed order.

Order of flipping is determining by projecting source grids axis orientation
on target grid axis. This probably will give some unwanted artifacts when
interpolating non-planar face but currently can't think about better way
to determine how to flip displacement.

This commit makes operators like Subdivide works much more unpredictable
for sculpting data, but this stuff should be rethinked much more global
because current approach is not acceptable.
2012-02-21 17:23:03 +00:00
afc56a0b10 copying bmesh dir on its own from bmesh branch 2012-02-19 18:31:04 +00:00