Campbell Barton
12eb29fe35
Cleanup: whitespace, duplicate includes
2018-05-20 08:52:56 +02:00
Germano
4b18858660
BLI_math_geom: Separate the isect_ray_seg_v3 from dist_squared_ray_to_seg_v3.
2018-05-16 21:36:41 -03:00
Germano
2ba0951e52
Snap system: Adds support to Clip Planes and uses a clip plane to simulate occlusion
...
This patch adds support for clip_planes (ie ignore what is behind a face)...
The idea is to first execute a raycast to get the polygon to which the mouse cursor points.
Then a snap test is done on the vertices or edges of the polygon.
Then with the normal and location obtained in raycast a new clip_plane is created and the snap over the whole scene is processed ignoring the elements behind the clip_plane.
Here 2 gif of how the previous patch would work on blender2.79:
{F497176}
{F497177}
Reviewers: mont29, campbellbarton
Reviewed By: campbellbarton
Subscribers: bliblubli
Tags: #bf_blender_2.8
Differential Revision: https://developer.blender.org/D2527
2018-05-16 10:32:54 -03:00
Germano
7a69c59b35
Revert "BLI_kdopbvh: Reference clip_planes callback to find nearest projected."
...
This reverts commit 717dd4cecd .
It was causing problems in the protactor ruler.
I'll think of a better solution.
2018-05-15 14:37:45 -03:00
Germano
717dd4cecd
BLI_kdopbvh: Reference clip_planes callback to find nearest projected.
...
Clip_planes are an important parameter to be used in callbacks.
2018-05-15 14:14:25 -03:00
Germano
439ccd27e6
BLI_math: Added isect_point_planes_v3_negated function.
2018-05-15 14:10:41 -03:00
Campbell Barton
e159ec8bc1
Cleanup: compiler warnings, use const
2018-05-14 23:12:51 +02:00
Germano
8cbf402eb6
New function for BLI_kdopbvh: BLI_bvhtree_find_nearest_projected.
...
This patch does not make any difference for a user's POV. But it is a step for adding the occlusion test for snapping functions.
This new function finds the node(aabb) whose projection is closest to a screen coordinate.
Reviewers: campbellbarton
Reviewed By: campbellbarton
Tags: #bf_blender_2.8
Differential Revision: https://developer.blender.org/D3180
2018-05-14 16:01:36 -03:00
Germano
894639f9a5
Cleanup: BLI_math: Simplify dist_squared_to_projected_aabb functions.
2018-05-12 18:18:32 -03:00
Campbell Barton
1813f00b94
Fix missing fallback in recent aabb precalc func
...
Also comment unused vars
2018-05-12 08:19:20 +02:00
Germano
be8add5d50
Refactor: Move functions to get the distance to a projected aabb to BLI_match and remove confusing parameters.
2018-05-11 20:20:51 -03:00
Campbell Barton
b49184b608
Merge branch 'master' into blender2.8
2018-05-07 18:02:48 +02:00
Campbell Barton
f62b826533
Merge branch 'master' into blender2.8
2018-05-07 17:54:10 +02:00
Campbell Barton
f74d85ffc8
Cleanup: rename char/float conversion functions
...
- FTOCHAR -> unit_float_to_uchar_clamp
- F3TOCHAR3 -> unit_float_to_uchar_clamp_v3 (swap args)
- F4TOCHAR4 -> unit_float_to_uchar_clamp_v4 (swap args)
- FTOUSHORT -> unit_float_to_ushort_clamp
- USHORTTOUCHAR -> unit_ushort_to_uchar
2018-05-07 17:51:40 +02:00
Campbell Barton
905eeb0bc7
Cleanup: move unit char/short/float to functions
...
This caused GCC 8.1 to crash at build time,
but was also not very nice use of macros.
2018-05-07 17:50:25 +02:00
Germano
a9d264f5ca
Merge branch 'master' into blender2.8
2018-05-03 14:33:52 -03:00
Germano
ac19483e63
BKE bvhtree: Add tree_type parameter to bvhtree_from_mesh_get.
...
This will allow greater control of the bvhtrees that are obtained, and helps identify problems.
It is also an additional step to unify the functions.
2018-05-03 14:26:39 -03:00
Campbell Barton
d09920687c
Merge branch 'master' into blender2.8
2018-05-02 12:46:14 +02:00
Aaron Carlisle
128506eeb1
BLI Color: YUV to/from rgb colorspace option
...
This commit does two things:
- Adds an option to do the calculation in different color spaces (BT601
or BT709).
- Changes the default caluclation from legacy BT601 to BT709.
This affects several areas:
- UI areas (mainly scopes)
- ViewLevelsNode
- Several other nodes that use `COM_ConvertOperation.h`
2018-04-29 18:00:45 -04:00
Dalai Felinto
dfd82b18df
Merge remote-tracking branch 'origin/master' into blender2.8
2018-04-25 09:31:25 +02:00
Germano
bb92d9a946
BLI BVHTree Walk DFS: Decreases the size of the stack space used for the recursive function.
...
Each parameter of the function is copied into the memory stack.
This also brought an improvement in peformance of snapping functions between 5% and 12% in my tests.
2018-04-24 09:48:14 -03:00
Campbell Barton
4b544e857c
Merge branch 'master' into blender2.8
2018-04-24 08:01:21 +02:00
Campbell Barton
92f36586e3
BLI_math: avoid assert with non-finite numbers
2018-04-23 21:09:01 +02:00
Campbell Barton
1de7a0c0dc
Merge branch 'master' into blender2.8
2018-04-22 10:51:23 +02:00
Campbell Barton
122d0d1504
Cleanup: style
2018-04-21 20:42:27 +02:00
Campbell Barton
46a9038f60
Cleanup: variable naming
2018-04-21 20:22:12 +02:00
Campbell Barton
112540da62
Merge branch 'master' into blender2.8
2018-04-21 20:17:41 +02:00
Campbell Barton
1e9fb355bf
BLI_bitmap: 2D triangle drawing function
...
Matching polygon filling but no need for allocation or qsort.
2018-04-21 18:34:34 +02:00
Campbell Barton
83cb387944
BLI math: clamped barycentric weight calculation
2018-04-21 18:34:20 +02:00
Campbell Barton
36773e35f6
Remove Armature Sketching & Retarget
...
While the feature is interesting, it's not much from what we can tell.
Retargeting is an important feature but needs
to fit in better with typical animation work-flows.
See: T52809
2018-04-20 10:34:48 +02:00
Campbell Barton
9a301978bd
Merge branch 'master' into blender2.8
2018-04-19 08:18:42 +02:00
Campbell Barton
fcac9e8410
Cleanup: style
2018-04-19 08:18:16 +02:00
Sergey Sharybin
8ad93dd009
Merge branch 'master' into blender2.8
2018-04-16 10:19:03 +02:00
Sergey Sharybin
5bfe6126f8
Added lock-free single linked list implementation
...
Only supports lock-free insertion for now, can not delete element
or traverse the list at the same time.
2018-04-16 10:18:43 +02:00
Campbell Barton
e52beb3733
Merge branch 'master' into blender2.8
2018-04-03 18:12:39 +02:00
Campbell Barton
bfdb88f3f4
Cleanup: rename list count_ex -> count_at_most
2018-04-03 17:05:21 +02:00
Campbell Barton
b65ea517eb
Merge branch 'master' into blender2.8
...
- Undo that changes modes currently asserts,
since undo is now screen data.
Most likely we will change how object mode and workspaces work
since it's not practical/maintainable at the moment.
- Removed view_layer from particle settings
(wasn't needed and complicated undo).
2018-04-01 11:03:25 +02:00
Campbell Barton
91d0825b55
BLI_sort_utils: add pointer sorting callback
...
Also rename Pointer -> Ptr
2018-03-31 19:25:27 +02:00
Dalai Felinto
11130970c6
Merge commit 'origin/master^' into blender2.8
2018-03-29 10:36:01 -03:00
Campbell Barton
e49d66f22c
Cleanup: typo in function name
2018-03-28 11:23:38 +02:00
Campbell Barton
a970ac5d55
BLI_array: utility to check memory is zerod
2018-03-28 11:13:54 +02:00
Campbell Barton
8eb8aa4939
Merge branch 'master' into blender2.8
2018-03-23 12:05:55 +01:00
Campbell Barton
7cc2b27099
Cleanup: stray tabs
...
Tabs in middle of code (mostly for no reason / by accident).
2018-03-23 11:51:19 +01:00
Sergey Sharybin
e0388bc61a
Merge branch 'master' into blender2.8
2018-03-20 16:55:16 +01:00
Campbell Barton
1782abf6e2
Fix BLI_assert for MSVC
...
Also use `_BLI_ASSERT` prefix for internal defines.
2018-03-20 11:56:11 +01:00
Joshua Leung
c8a7c4f245
Merge branch 'master' into blender2.8
2018-03-20 16:13:37 +13:00
Joshua Leung
8e5c407fc4
Fix compile error with MSVC2013 - Can't use __func__ (from BLI_assert) in inlined functions
...
ERROR: blenlib/intern/math_base_inline.c:371 - '__func__' : undeclared identifier (C:\blenderdev\master2\blender\source\blender\editors\lattice\editlattice_tools.c) [C2065]
2018-03-20 16:03:43 +13:00
Bastien Montagne
e95282e783
Merge branch 'master' into blender2.8
2018-03-18 16:05:02 +01:00
Campbell Barton
2a9f000806
Cleanup: kdopbvh, only set parent nodes once
2018-03-18 05:08:12 +01:00
Campbell Barton
995ccf8168
BLI_assert: extract from BLI_utildefines
...
BLI_utildefines is quite large, defining many unrelated things.
Add BLI_assert to include in inline headers, so math defines don't
pull in too much.
2018-03-16 06:03:29 +11:00