Dalai Felinto
2d1cce8331
Cleanup: make format after SortedIncludes change
2020-03-19 09:33:58 +01:00
Sergey Sharybin
598ab525da
Cleanup: Replace ABS/SQUARE/CUBE with function calls
...
While it might be handy to have type-less functionality which is
similar to how C++ math is implemented it can not be easily achieved
with just preprocessor in a way which does not have side-effects on
wrong usage.
There macros where often used on a non-trivial expression, and there
was at least one usage where it was causing an actual side effect/bug
on Windows (see change around square_f(sh[index++]) in studiolight.c).
For such cases it is handy to have a function which is guaranteed to
have zero side-effects. The motivation behind actually removing the
macros is that there is already a way to do similar calculation. Also,
not having such macros is a way to guarantee that its usage is not
changed in a way which have side-effects and that it's not used as an
inspiration for cases where it should not be used.
Differential Revision: https://developer.blender.org/D7051
2020-03-09 14:47:59 +01:00
mano-wii
8c60205bef
Fix T70109: Crash with the Data Transfer Modifier (with any 'Edge Data' option)
...
The BVHTree was erroneously marked as not cached.
2019-09-20 12:18:22 -03:00
Campbell Barton
7b61fe1638
Cleanup: use BLI_assert
2019-08-26 14:32:35 +10:00
mano-wii
8d03e04493
Fix assert restricting allowed operation
2019-08-26 01:18:40 -03:00
mano-wii
3437fcf2f1
BKE_bvhutils: implement hiden check
...
Accidentally unused in rB7c3bbe93aaa2
2019-08-24 09:20:55 -03:00
Campbell Barton
c9923baf84
Fix BKE_bvhtree_from_editmesh_get not setting cached value
...
The stored value was always false because of shadowing.
Also disable unused code.
2019-08-24 12:16:30 +10:00
mano-wii
a68e8ac993
BKE bvhutils: create and use new BKE_bvhtree_from_editmesh_get
...
With this function it is easier to create and have control over editmeshes `BHVtree`s.
2019-08-23 19:51:18 -03:00
mano-wii
7c3bbe93aa
Cleanup/Refactor: Simplify/deduplicate bvhutils code
...
This is a step that allow using `bvh_cache` for `EditMeshe`s.
2019-08-22 14:07:40 -03:00
mano-wii
467b0aa227
Fix T68320: measure tool memoryleak
...
It was a stupid mistake with the wrong pointer being referenced.
It was a serious problem because the memory leak was considerable.
2019-08-06 12:50:08 -03:00
mano-wii
2d8584c15f
Fix T65027: Snap 3D cursor on hidden faces doesn't work in Edit Mode.
...
I'm not very fond of adding new types of bvhtrees.
But this is probably the most efficient solution.
2019-05-29 01:02:04 -03:00
Campbell Barton
aa42da0385
Cleanup: comments (long lines) in blenkernel
2019-04-27 12:07:07 +10:00
Campbell Barton
735515a3f9
Cleanup: style, use braces for blenkernel
2019-04-22 19:48:17 +10:00
Campbell Barton
e12c08e8d1
ClangFormat: apply to source, most of intern
...
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-17 06:21:24 +02:00
Campbell Barton
de13d0a80c
doxygen: add newline after \file
...
While \file doesn't need an argument, it can't have another doxy
command after it.
2019-02-18 08:22:12 +11:00
Campbell Barton
eef4077f18
Cleanup: remove redundant doxygen \file argument
...
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
Campbell Barton
65ec7ec524
Cleanup: remove redundant, invalid info from headers
...
BF-admins agree to remove header information that isn't useful,
to reduce noise.
- BEGIN/END license blocks
Developers should add non license comments as separate comment blocks.
No need for separator text.
- Contributors
This is often invalid, outdated or misleading
especially when splitting files.
It's more useful to git-blame to find out who has developed the code.
See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
Campbell Barton
f20dbc293f
Cleanup: blank lines over doxy headers
2019-01-26 21:43:24 +11:00
Andrew Williams
102631486b
Fix potential invalid memory access in surface force field BVH tree.
...
Free the BVH tree immediately along with the mesh, otherwise we might access
invalid mesh data.
Differential Revision: https://developer.blender.org/D4201
2019-01-22 15:24:06 +01:00
Alexander Gavrilov
d211c9aa0a
BLI_bitmap: add functions operating on the whole bitmask.
...
There is no point having operations that iterate over the whole
bit array as macros, so convert BLI_BITMAP_SET_ALL to a function.
Also, add more utilities for copying and manipulating masks.
Reviewers: brecht, campbellbarton
Differential Revision: https://developer.blender.org/D4101
2018-12-19 15:53:12 +03:00
Campbell Barton
49490e5cfb
Merge branch 'master' into blender2.8
2018-12-12 13:02:09 +11:00
Campbell Barton
e757c4a3be
Cleanup: use colon separator after parameter
...
Helps separate variable names from descriptive text.
Was already used in some parts of the code,
double space and dashes were used elsewhere.
2018-12-12 12:50:58 +11:00
Campbell Barton
0941d99323
Cleanup: remove unused functions
2018-10-15 16:59:27 +11:00
Campbell Barton
881334c499
Cleanup: remove DerivedMesh bvhtree_from_mesh_get
2018-10-15 13:40:46 +11:00
Campbell Barton
0ddf3e110e
Cleanup: comment blocks
2018-09-02 18:51:31 +10:00
Campbell Barton
ae57383648
Cleanup: comment blocks
2018-09-02 18:28:27 +10:00
Germano
59286ddcf8
transform_snap_object: Better bvhtree creation management for editing multiple objects.
...
- Use the object referenced in `BMEditMesh` as the `ghash` key to save the bvhtrees in cache;
- Create a boundbox around edit_mesh to test the snap before creating bvhtree;
- Save the `edit_mesh`s bvhtree in the mesh bvh_cache;
This is a part of the D3504.
2018-07-23 11:04:58 -03:00
Campbell Barton
b633d760a2
Cleanup: style
2018-06-27 22:32:52 +02:00
Campbell Barton
06a1a66a9b
Merge branch 'master' into blender2.8
2018-06-17 17:10:19 +02:00
Campbell Barton
6fc8a74886
Cleanup: trailing space for blenkernel
2018-06-17 17:05:51 +02:00
Sybren A. Stüvel
a9ed50514c
Moved function declarations from BKE_mesh.h → BKE_mesh_runtime.h
2018-06-05 16:59:18 +02:00
Germano
b4648ee379
Cleanup: BKE_bvhuitls: Use a struct rather than re-create each member of it.
2018-05-16 15:26:33 -03:00
Germano
9c212399c6
BKE_bvhutils: allow caching NULL bvh_trees.
...
This prevents zero-leafs bvhtrees from being recalculated multiple times.
2018-05-12 19:43:36 -03:00
Germano
817bb5d40d
Remove unused function: BKE_bvhtree_from_mesh_looptri.
2018-05-12 12:05:54 -03:00
Campbell Barton
83a83a3d4b
Cleanup: whitespace, duplicate includes
2018-05-11 07:43:20 +02:00
Campbell Barton
be1af8d44c
Fix error building
2018-05-10 21:43:15 +02:00
Germano
66636e665b
Cleanup: Remove redundant parameter.
2018-05-10 16:32:13 -03:00
Campbell Barton
e4c7cef748
Cleanup: warnings
2018-05-10 19:10:16 +02:00
Germano
a35b9cc302
BKE: bvhutils: Added support for bvhtrees from loose verts and bvhtree from loose edges
2018-05-10 13:35:48 -03:00
Bastien Montagne
b586c81fbc
Fix (unreported) bug in BVHTree 'free tessfaces' flag setting.
...
Same issue as in DM-based on, so follow up of rBf3efa9e15f58...
2018-05-09 12:36:05 +02:00
Bastien Montagne
21298978f6
Merge branch 'master' into blender2.8
2018-05-09 12:35:16 +02:00
Bastien Montagne
f3efa9e15f
Fix (unreported) bug in BVHTree 'free tessfaces' flag setting.
...
Could lead to atempt to free NULL pointer, and/or memory leak.
2018-05-09 12:33:21 +02:00
Germano
2d2875fc15
BKE: bvhutils: Always return NULL when the BVHtree has no leafs.
...
BLI_bvhkdop functions were not made to work with zero-leaf trees.
Perhaps a better solution would be to modify BLI_bvhkdop to work with zero leaf trees.
But this solution of returning NULL was already used for bvhtrees of looptris.
2018-05-08 20:31:26 -03:00
Germano
7fd19bcbe1
BKE: bvhutils: Port bvhtree_from_mesh_get to take a Mesh param instead of a DerivedMesh.
...
Differential Revision: https://developer.blender.org/D3227
2018-05-08 20:00:51 -03:00
Campbell Barton
305c455ffe
Cleanup: mesh_runtime naming
...
- BKE_mesh_get_looptri_num -> BKE_mesh_runtime_looptri_len
- BKE_mesh_runtime_recalc_looptri -> BKE_mesh_runtime_looptri_recalc
- BKE_mesh_get_looptri_array -> BKE_mesh_runtime_looptri_ensure
2018-05-08 19:26:36 +02:00
Sybren A. Stüvel
abb58eec53
looptri + bvhtree support for Mesh
2018-05-08 11:36:48 +02:00
Germano
b27b4743a2
BKE: bvhuils: remove member sphere_radius.
...
This member currently doubles the value of `ray->radius` or is not even used.
2018-05-04 11:57:01 -03:00
Germano
02788a9d1a
Fix erroe in previous commit.
2018-05-04 11:22:50 -03:00
Germano
e78ef82827
BKE: bvhutils: Unifies static functions oh bvhtrees creation.
2018-05-04 11:15:21 -03:00
Germano
aea637456e
BKE: BVHtree: Replace all external references of bvhtree_from_mesh_looptri with bvhtree_from_mesh_get.
2018-05-04 09:21:42 -03:00