Commit Graph

47594 Commits

Author SHA1 Message Date
Campbell Barton
e4d278668f code cleanup for mempool, refactor chunk initialization into a static function. 2013-08-25 14:50:40 +00:00
Campbell Barton
a476459c5e merge mempool allocs per chunk, include the data in the BLI_mempool_chunk alloc. 2013-08-25 13:15:22 +00:00
Campbell Barton
3a9eb9b497 doxygen docs for ghash/edgehash 2013-08-25 12:17:46 +00:00
Campbell Barton
150af65d9f For pointer hashing use the same method as python, it gives better distribution.
some tests with high poly mesh data in hashes.
- empty buckets before 4-5%, after 1-2%
- speedup for hash lookups, in my tests lookups take approx ~60% of the time they did before.
2013-08-24 20:30:08 +00:00
Campbell Barton
7c65015ab8 use ints for ghash/edgehash flags, since its allocated theres not much point to try save a few bytes here. 2013-08-24 20:16:14 +00:00
Tamito Kajiyama
4ece675781 Quiet annoying VC++ warning C4819: The file contains a character that cannot be represented in the current code page. 2013-08-24 17:36:45 +00:00
Campbell Barton
09a52f18b6 ghash: reserve size when its known or can be guessed close enough.
also avoid allocs per node in pbvh_bmesh_node_limit_ensure()
2013-08-24 17:33:47 +00:00
Sergey Sharybin
7bd422143e Fix bad draw of plane track when using Tiny display option 2013-08-24 17:25:12 +00:00
Sergey Sharybin
6caad3445e Add stdlib.h to solve compilation error caused by missing abort() prototype
Perhaps we'd better move this include to BLI_utildefines as we made with
with other includes needed for BLI_abort?
2013-08-24 17:15:59 +00:00
Campbell Barton
1e2ceabbe1 correct error in face walker (was inserting into the wrong ghash which was immediately freed after) 2013-08-24 16:43:09 +00:00
Campbell Barton
585272fbcf cloth was using edgehash not quite correctly:
- was ordering vertex args unnecessarily.
- was adding the same edges multiple times into the edgehash.
2013-08-24 16:06:18 +00:00
Campbell Barton
1ba29c3a4a cloth spring building: replace MIN2/MAX2 in assignments with a function which orders on assignment. 2013-08-24 15:55:56 +00:00
Campbell Barton
2c556c2ef7 avoid double ghash lookup in sculpt map_insert_vert 2013-08-24 15:31:47 +00:00
Campbell Barton
4b1fc0593e add versions of BLI_ghash_int_new, BLI_ghash_str_new, etc. that take a reserve argument. 2013-08-24 15:14:50 +00:00
Campbell Barton
aefe93d909 revert bucket size change (edgehash was this way for years, since r26206, ghash since r57657)
having 2 free buckets for each entry is faster but uses more memory.

use the original size, best case 3 entries per bucket.
2013-08-24 15:09:57 +00:00
Brecht Van Lommel
a31a85ac9c Fix #36541: blender internal raytrace render hangs with high ray depth. The code
here is not efficient for such cases, a ray depth can give up to 2^depth rays due
to the ray splitting in two at each depth. A proper solution requires a better
algorithm, for now I've ensured that you can at least cancel such renders. The
overhead from the extra test_break is negligible.
2013-08-24 15:02:12 +00:00
Campbell Barton
25ffb79a0b use reserve argument for more edgehashs 2013-08-24 14:40:15 +00:00
Campbell Barton
8811e521c0 fix for leak in cloth modifier
- any error in cloth_build_springs wasn't freeing the edge-hash.
- was checking BLI_edgehash_haskey on matching vertices.
- was looping over setting NULL for all elements of a calloc'd array.
2013-08-24 14:32:43 +00:00
Campbell Barton
0b88b4fad7 when the size of an edgehash is known or can be guessed,
pass in the argument to reserve the size.
2013-08-24 13:47:57 +00:00
Campbell Barton
f320c5ae9e fix for leak in make_edges_mdata() if there were no edges to create,
also reserve the total number of edges in the hash when its created.
2013-08-24 13:13:29 +00:00
Campbell Barton
f2acb10b6b edge hash: take an arg for the guarded-malloc string (as ghash does) 2013-08-24 13:08:55 +00:00
Campbell Barton
9c090cecfe ghash and edgehash api, allow newly defined hashes to take in the size of the hash as an arg (avoids resizing in simple cases when the hash is created and filled immediately). 2013-08-24 13:04:03 +00:00
Andrea Weikert
b187c1be4b == filebrowser ==
* fix old bug: wrong layout that could happen  when switching between thumbnail view and list view. This caused the layout to be recalculated sometimes and the items being moved. Reason was that the layout was wrongly initialized without the scroll bars, so calculated wrongly.
2013-08-24 12:53:47 +00:00
Campbell Barton
f3ceee51fa fix for GPU_update_bmesh_buffers not setting bmesh vertex index values as dirty (could cause errors later). 2013-08-24 11:46:08 +00:00
Tamito Kajiyama
248e3d74a0 Fix for [#36374] Read unitialized memory in Freestyle.
A variable keeping a bounding box was referenced after it was flagged as empty.
2013-08-24 11:42:00 +00:00
Campbell Barton
3cf14f0b3a style cleanup: space around for loop wrappers 2013-08-24 10:05:29 +00:00
Gaia Clary
3741a588bc Fix 36505: Collada exporter crashes Blender when exporting to locked file 2013-08-24 09:51:05 +00:00
Campbell Barton
bffd7767e2 fix for crash in weight-paint-gradient, missing call to curve curvemapping_initialize 2013-08-24 08:58:58 +00:00
Bastien Montagne
2fefb0fe85 Fix [#36330] Clicking Scrolled Object Properties Tab Brings Up Wrong One
Actually, happened in any view2D... Just added a call to WM_event_add_mousemove() in view_pan_apply, so that overed/active button is refreshed in this case.
2013-08-24 08:46:48 +00:00
Campbell Barton
b97334f992 add GPL header to treehash.c and add missing includes to cmake. 2013-08-24 03:17:28 +00:00
Campbell Barton
b44f3bf1ab code cleanup: change to r59443, TRUE/FALSE are deprecated, see BLI_sys_types.h 2013-08-24 03:16:22 +00:00
Brecht Van Lommel
3a73f635c2 Fix #36441: opengl render of smoke wrong after regular render with blender internal.
Object.imat isn't always the inverse of Object.obmat, needs to be set before usage
as mentioned in DNA_object_types.h.

Thanks to Miika for tracking down the cause of this bug.
2013-08-23 22:57:29 +00:00
Bastien Montagne
ab24f8aa9d Related to [#36548] "Grease Pencil" Problems
Use scene's GPencil when active object is deselected. Else it can be tricky and not user-friendly to access to the scene's GPencil once some objects have GPencil data (you have to select/active a non-gpencil object, or switch to a layout without active object...).
2013-08-23 21:26:59 +00:00
Bastien Montagne
d54b2f7d91 Code cleanup: use TRUE/FALSE instead of 1/0 for bool properties default values... 2013-08-23 21:13:30 +00:00
Sv. Lockal
52eb61f84b Fix state losses for recursive outliner trees (e.g. datablocks editor)
In previous optimization in outliner I assumed that order in treehash was not important.
But testing outliner in datablocks mode revealed a problem: when user expands multiple recursive levels and then closes any element, it always closed the top level of recursion.
Now it should work fine with recursive trees.
Now treehash contains groups of elements indexed by (id,nr,type). Adding an element with the same (id,nr,type) results in appending it to existing group. No duplicates are possible in treehash.
This commit should also make lookups a little bit faster, because searching in small arrays by "used" is faster than searching in hashtable with duplicates by "id,nr,type,used".
2013-08-23 20:35:00 +00:00
Andrea Weikert
587796170a Fix compile in Visual Studio 2008:
* isfinite is not defined, in Blender code we use 'finite' instead
2013-08-23 18:02:23 +00:00
Bastien Montagne
5dacf174e6 UI layout: Fix the fact that children layouts were implicitely inconditionnaly aligned when the parent was. E.g.in
col = layout.column(True)
row = col.row(False)

Items in row would be 'aligned' in the same group as those in col. Now to get this happening, you have to set row as aligned as well.

Please note that fixes for py UI scripts will follow in another commit.

Also fixed labels of RNA pointers searchboxes, which were missing the colon!
2013-08-23 16:53:37 +00:00
Campbell Barton
384b8aafbf patch to add backkbacks for game engine start/end,
by sjoerd_de_vries
2013-08-23 15:45:18 +00:00
Campbell Barton
6f26acb009 simplify dist_to_plane_v3 and add dist_squared_to_plane_v3 2013-08-23 15:19:20 +00:00
Bastien Montagne
25ca762238 Fix [#36538] Discontinuity (Euler) Filter - never ends - (deadlock?)
Code could enter in an infinite loop when curve value was an odd multiple of PI (i.e. 180°)...

Current code was also factorized and got rid of fabs calls! ;)
2013-08-23 15:17:54 +00:00
Campbell Barton
09ff49755f math api edits - replace point-normal form for a plane with dist_to_plane_v3()
also correct python mathutils api, was missing vector checks.
2013-08-23 14:37:22 +00:00
Campbell Barton
a55857c653 new mesh bisect had a problem not selecting faces with fill option in face mode. 2013-08-23 14:07:22 +00:00
Campbell Barton
620d674b85 fix error in recently added symmetrize rewrite, verts already on the aligned to the mirror-plane would not be welded. 2013-08-23 13:27:44 +00:00
Campbell Barton
d6b9fb36d8 fix leak in BM_face_split() with multires if the split failed.
also remove redundant normal copy.

only triangulate the mesh if its needed when enabling dyntopo.
2013-08-23 13:00:43 +00:00
Campbell Barton
c752346cfa new mesh bisect tool, available in the mesh menu.
cuts the mesh in half based on the cursor location and the viewport,
optionally supports filling the cut area (with uvs. vcols, etc),
and removing geometry on either side of the cut.
2013-08-23 11:46:08 +00:00
Campbell Barton
81096bab0c correct error in recent commit triangle-fill-dissolve, need to check if the edges face is removed (happens in rare cases). 2013-08-23 11:28:33 +00:00
Thomas Dinges
9843170f4b * Compile fix for r59395, 'move bmesh tools into their own include'. 2013-08-23 11:16:52 +00:00
Campbell Barton
111b365c58 _another_ fix for recently added bisect operator, looping over mixed geometry could read freed memory when vertices were removed. 2013-08-23 11:11:59 +00:00
Campbell Barton
98bb2197a2 add dissolve option to triangle fill operator, running dissolve after scanfill isn't so simple because of errors if one edge can't merge. 2013-08-23 11:10:46 +00:00
Campbell Barton
59b082dc27 fix for error in recetly added bisect operator, in rare cases it could attempt to remove vertices twice. 2013-08-23 10:19:58 +00:00