Compare commits

...

524 Commits

Author SHA1 Message Date
Dilith Jayakody
bb44667a2e Merge branch 'master' into soc-2021-curves 2022-04-03 08:08:54 +05:30
Dilith Jayakody
2579367c93 Select distance refactor 2022-04-03 07:39:14 +05:30
Dilith Jayakody
42fc2cf6fd Fix FOREACH_SELECTED_BEZT_BEGIN 2022-04-03 07:10:16 +05:30
Dilith Jayakody
2f88066754 Merge branch 'master' into soc-2021-curves 2022-04-02 07:15:04 +05:30
Dilith Jayakody
1b09af60be Fix shift behavior for linked handles 2022-04-02 07:12:39 +05:30
Dilith Jayakody
e3bacffac0 Fix handle move when moving hidden segments 2022-04-01 23:13:09 +05:30
Dilith Jayakody
3effa66995 Merge branch 'master' into soc-2021-curves 2022-04-01 19:32:12 +05:30
Dilith Jayakody
78a44ab6bd Fix handle move when moving hidden segments 2022-04-01 19:30:12 +05:30
Dilith Jayakody
69367ec968 Move delete point functionality to Ctrl 2022-03-31 16:17:07 +05:30
Dilith Jayakody
0e13b652d2 Add keyIndex_delCV to delete point 2022-03-31 16:08:14 +05:30
Dilith Jayakody
b092128ce3 Merge branch 'master' into soc-2021-curves 2022-03-31 07:57:20 +05:30
Dilith Jayakody
238a08ec13 Move "delete_point" to Shift-LMB 2022-03-26 19:33:15 +05:30
Dilith Jayakody
bb17c3fb32 Change license header to the SPDX header 2022-03-26 19:29:34 +05:30
Dilith Jayakody
b38be50617 Merge branch 'master' into soc-2021-curves 2022-03-26 19:13:28 +05:30
Dilith Jayakody
ec0c136d10 Fix bug in freeing handles for move segment 2022-03-26 18:49:40 +05:30
Dilith Jayakody
8c9c936855 Refactor hide check 2022-03-26 18:10:05 +05:30
Dilith Jayakody
5fafbe299a Fixed setting invalid nurbs as active 2022-03-26 18:07:52 +05:30
Dilith Jayakody
078ec10520 Move insert_point to Ctrl LMB 2022-03-26 17:28:40 +05:30
Dilith Jayakody
9985368035 Move PRESS logic to the curve_pen_invoke method 2022-03-26 17:24:05 +05:30
Dilith Jayakody
fd980df3a6 Change uint to int 2022-03-26 17:21:40 +05:30
Dilith Jayakody
59e570bcd2 Add braces to FOREACH_SELECTED_BEZT_END uses 2022-03-26 14:22:29 +05:30
Dilith Jayakody
989d1fdba5 Fix incorrect argument passing 2022-03-26 11:26:50 +05:30
Dilith Jayakody
b83c9980b6 Fix doxygen comments 2022-03-26 11:08:26 +05:30
Dilith Jayakody
1197db2fe9 Make ed_editcurve_extrude function private 2022-03-26 10:45:48 +05:30
Dilith Jayakody
b6b0491a90 Set active vert 2022-03-26 09:11:47 +05:30
Dilith Jayakody
3a98227b97 Fix move segment behavior for selected splines 2022-03-26 00:46:06 +05:30
Dilith Jayakody
d2451eccd5 Comment fix 2022-03-26 00:18:37 +05:30
Dilith Jayakody
3694bee22d Fix modifying hidden vertices 2022-03-25 23:49:08 +05:30
Dilith Jayakody
df5a1f2f82 Remove KM_PRESS condition for drag 2022-03-24 16:00:26 +05:30
Dilith Jayakody
0cfb32510a Merge branch 'master' into soc-2021-curves 2022-03-24 12:25:58 +05:30
Dilith Jayakody
b6e5650269 Merge branch 'master' into soc-2021-curves 2022-03-18 15:56:30 +05:30
Dilith Jayakody
154ecaa71c Cleanup 2022-03-18 15:54:25 +05:30
Dilith Jayakody
4a9d471bf4 Merge branch 'master' into soc-2021-curves 2022-03-17 17:01:58 +05:30
Dilith Jayakody
02f34ba8eb Rename close_spline_opts to close_spline_method 2022-03-17 16:59:34 +05:30
Dilith Jayakody
255e1da82d Merge branch 'master' into soc-2021-curves 2022-03-17 09:41:09 +05:30
Dilith Jayakody
02ba154d6d Remove ed prefix from ed_curve_toggle_cyclic 2022-03-16 12:38:44 +05:30
Dilith Jayakody
d5b8f97772 Merge branch 'master' into soc-2021-curves 2022-03-16 12:18:28 +05:30
Dilith Jayakody
fdb6896815 Incorrect fomatting fix 2022-03-16 12:13:15 +05:30
Dilith Jayakody
8308ba89ad Merge branch 'master' into soc-2021-curves 2022-03-16 12:07:08 +05:30
Dilith Jayakody
4942559946 Change prev_click_xy to prev_press_xy 2022-03-16 09:08:02 +05:30
Dilith Jayakody
f6048156ec Add new curve pen icon 2022-03-16 09:07:36 +05:30
Dilith Jayakody
8f242fcb9e Merge branch 'master' into soc-2021-curves 2022-03-15 19:30:03 +05:30
Dilith Jayakody
6f6f607910 Merge branch 'master' into soc-2021-curves 2022-03-12 10:34:08 +05:30
Dilith Jayakody
6c6c4db477 Merge branch 'master' into soc-2021-curves 2022-03-05 18:13:51 +05:30
Dilith Jayakody
3af0920feb Change free-align toggle to activate on hold 2022-03-05 18:11:26 +05:30
Dilith Jayakody
1a4a6ce598 Merge branch 'master' into soc-2021-curves 2022-03-02 16:10:57 +05:30
Dilith Jayakody
c9b7240c24 Removed const from header 2022-03-02 08:58:53 +05:30
Dilith Jayakody
f88903881c Removed select distance multiplier 2022-03-02 08:53:44 +05:30
Dilith Jayakody
6be8b11495 Merge branch 'master' into soc-2021-curves 2022-03-01 19:43:58 +05:30
Dilith Jayakody
f8e6f1fa42 Fixed name and description 2022-02-26 12:15:52 +05:30
Dilith Jayakody
16eb78f49b Merge branch 'master' into soc-2021-curves 2022-02-26 11:34:10 +05:30
Dilith Jayakody
c9881f7ebd Moved extra functionalities to modal keymap 2022-02-26 11:23:21 +05:30
Dilith Jayakody
b394aabb42 Hard coded multi select to shift click 2022-02-25 23:04:22 +05:30
Dilith Jayakody
607a32fc4b Removed Extrude internal functionality 2022-02-25 22:41:19 +05:30
Dilith Jayakody
bf9e783058 Made changes as per review feedback 2022-02-25 22:11:10 +05:30
Dilith Jayakody
0e66cc9473 Merge branch 'master' into soc-2021-curves 2022-02-25 19:30:58 +05:30
Dilith Jayakody
e584809e55 Updated wmEvent->modifier usage 2022-02-25 14:14:58 +05:30
Dilith Jayakody
3650935d58 Merge branch 'master' into soc-2021-curves 2022-02-25 13:35:00 +05:30
Dilith Jayakody
5c95960224 Merge branch 'master' into soc-2021-curves 2022-02-25 07:43:37 +05:30
Dilith Jayakody
e36c619699 Merge branch 'master' into soc-2021-curves 2022-02-24 21:21:33 +05:30
Dilith Jayakody
626cb71134 Merge branch 'master' into soc-2021-curves 2022-02-24 08:14:00 +05:30
Dilith Jayakody
4bd6d9fa33 Merge branch 'master' into soc-2021-curves 2022-02-23 23:48:20 +05:30
Dilith Jayakody
1e280654f7 Merge branch 'master' into soc-2021-curves 2022-02-23 23:41:03 +05:30
Dilith Jayakody
2553f91c0f Set close spline default to On Click 2022-02-14 12:29:25 +05:30
Dilith Jayakody
4521abbc92 Merge branch 'master' into soc-2021-curves 2022-02-14 11:58:14 +05:30
Dilith Jayakody
be76b89114 Reverted file mode of tests/performance/benchmark 2022-02-14 11:54:25 +05:30
Dilith Jayakody
d43e43f669 Reverted addons delete 2022-02-14 11:49:56 +05:30
Dilith Jayakody
9047c03688 Fixed bug: moving handle moves entire point 2022-02-14 11:45:22 +05:30
Dilith Jayakody
d3170f5251 Fixed descriptions 2022-02-13 18:02:15 +05:30
Dilith Jayakody
a3ef770762 Fixed unused bezt_only param 2022-02-13 17:22:17 +05:30
Dilith Jayakody
33f7b7d4d0 Merge branch 'master' into soc-2021-curves 2022-02-13 16:43:28 +05:30
Dilith Jayakody
693311adc7 Clean up, refactoring and commenting 2022-02-13 16:33:22 +05:30
Dilith Jayakody
13c212076d Added "Close Spline" checkbox to tool header 2022-02-12 20:04:48 +05:30
Dilith Jayakody
13f64394fc Refactoring 2022-02-09 13:07:46 +05:30
Dilith Jayakody
b300a33411 Fixed bug with extruded point selection 2022-02-05 20:44:19 +05:30
Dilith Jayakody
ca96b348d1 Cleanup 2022-02-05 17:58:17 +05:30
Dilith Jayakody
81be53bf88 Improved insert point algorithm 2022-02-05 17:49:39 +05:30
Dilith Jayakody
f66e9ce5ae Cleanup 2022-02-05 09:46:28 +05:30
Dilith Jayakody
b51db68ed4 Fixed struct rename error 2022-02-05 07:28:38 +05:30
Dilith Jayakody
0588b2e229 Merge branch 'master' into soc-2021-curves 2022-02-04 22:56:10 +05:30
Dilith Jayakody
28fef09b13 Preserve link handles state when switching from free toggle 2022-02-04 22:47:29 +05:30
Dilith Jayakody
7d22dd0e1f Added ON_CLICK & ON_PRESS options for close spline 2022-02-04 22:13:44 +05:30
Dilith Jayakody
a9a7d8680e Support for moving adjacent handles on both sides 2022-02-03 23:04:45 +05:30
Dilith Jayakody
622567511e Lock angle works with hold rather than toggle 2022-02-03 22:43:02 +05:30
Dilith Jayakody
1904dc8a83 Fixed bug moving newly inserted points 2022-02-03 22:33:41 +05:30
Dilith Jayakody
8f6c81b067 Refactoring 2022-01-30 18:07:06 +05:30
Dilith Jayakody
aa03554f70 Refactoring 2022-01-30 17:06:44 +05:30
Dilith Jayakody
3cb09cfed0 Insert point to cyclic NURBs 2022-01-30 08:36:24 +05:30
Dilith Jayakody
f1ba579c8c Changed key bindings for the handle functions 2022-01-29 20:51:57 +05:30
Dilith Jayakody
1d1f70238f Added functionality to lock handle angle 2022-01-29 19:56:50 +05:30
Dilith Jayakody
70932b1935 Added several settings to toolbar 2022-01-29 17:09:35 +05:30
Dilith Jayakody
d805d14f4d Merge branch 'master' into soc-2021-curves 2022-01-29 12:29:23 +05:30
Dilith Jayakody
d02a5c625a Fix issue when merging master 2022-01-29 12:27:43 +05:30
Dilith Jayakody
d0ade3c819 Merge branch 'master' into soc-2021-curves 2022-01-28 19:44:42 +05:30
Dilith Jayakody
c3a6ec1b08 Fixed link handles snapping bug 2022-01-25 21:57:55 +05:30
Dilith Jayakody
3ee9a8528e Merge branch 'master' into soc-2021-curves 2022-01-23 19:33:33 +05:30
Dilith Jayakody
97c5fa31a2 Removed commented code 2022-01-23 19:26:20 +05:30
Dilith Jayakody
ef64ec491a Fixed bug - accumulated move error in persp view 2022-01-23 19:15:09 +05:30
Dilith Jayakody
d0f3045236 Merge branch 'master' into soc-2021-curves 2022-01-22 13:40:31 +05:30
Dilith Jayakody
46105b2507 Fix link handles not working as toggle 2022-01-22 10:41:28 +05:30
Dilith Jayakody
6b579ce7b0 Merge branch 'master' into soc-2021-curves 2022-01-22 00:02:55 +05:30
Dilith Jayakody
a39cbf3229 Reduced grab threshold 2022-01-21 23:59:02 +05:30
Dilith Jayakody
93df43a7f2 Cleanup and refactoring 2022-01-21 23:58:38 +05:30
Dilith Jayakody
6fbc8fe987 Fixed inconsistent new spline type 2022-01-21 23:32:11 +05:30
Dilith Jayakody
86a5a8aab2 Added option to choose extruded point type 2022-01-21 22:33:32 +05:30
Dilith Jayakody
a881af2a7c Make cyclic only if poly has more than 2 points 2022-01-21 07:58:08 +05:30
Dilith Jayakody
34d58b74a5 Change link handles functionality to toggle 2022-01-21 07:39:15 +05:30
Dilith Jayakody
bd8723d0f3 Recalc NURBS after extrusion 2022-01-19 08:16:12 +05:30
Dilith Jayakody
02d9a00693 Merge branch 'master' into soc-2021-curves 2022-01-18 17:30:18 +05:30
Dilith Jayakody
2f87f3ae40 Double click to cycle handle types 2022-01-18 17:22:55 +05:30
Dilith Jayakody
f3ce86918b Bug fixes 2022-01-18 16:59:05 +05:30
Dilith Jayakody
668c1bccae Merge branch 'master' into soc-2021-curves 2022-01-17 23:14:31 +05:30
Dilith Jayakody
9881c85123 Fixed - Invisible handles selectable 2022-01-17 23:12:42 +05:30
Dilith Jayakody
a0915d3ba6 Fixed new point wrong handle being dragged 2022-01-17 22:55:47 +05:30
Dilith Jayakody
419714a40c Support for closing 2 point splines 2022-01-17 22:40:46 +05:30
Dilith Jayakody
ce0689088f Merge branch 'master' into soc-2021-curves 2022-01-17 12:25:09 +05:30
Dilith Jayakody
e51090a343 Fixed position bug with 2D curves. 2022-01-17 12:23:34 +05:30
Dilith Jayakody
401e0a4946 Merge branch 'master' into soc-2021-curves 2022-01-16 18:34:32 +05:30
Dilith Jayakody
fdbaffa1f6 Fixed insert bug 2022-01-16 18:32:08 +05:30
Dilith Jayakody
beb1dfe221 Fixed extrude bug 2022-01-16 18:28:05 +05:30
Dilith Jayakody
1de784517c Refactored extrude for when internal disabled 2022-01-15 19:34:12 +05:30
Dilith Jayakody
e0469df8ae Merge branch 'master' into soc-2021-curves 2022-01-15 11:50:56 +05:30
Dilith Jayakody
4c5c323b21 Used UNPACK2 where possible 2022-01-15 11:38:23 +05:30
Dilith Jayakody
a14e1f3a9e Fixed select and recalc bugs 2022-01-15 10:47:47 +05:30
Dilith Jayakody
48ebc11dce Removed unused curve pen modal map 2022-01-08 07:28:06 +05:30
Dilith Jayakody
a7be3add5b Merge branch 'master' into soc-2021-curves 2022-01-08 07:20:00 +05:30
Dilith Jayakody
11885cd282 Extra comment during merge 2022-01-08 07:18:44 +05:30
Dilith Jayakody
315766e202 Merge branch 'master' into soc-2021-curves 2022-01-07 23:58:36 +05:30
Dilith Jayakody
ca6802b435 Added additional key-bindings 2022-01-07 23:56:06 +05:30
Dilith Jayakody
85f2a51e6a Cleanup 2022-01-07 22:47:25 +05:30
Dilith Jayakody
4bd7f7d6e6 Fixed bug with selection while moving 2022-01-07 08:40:11 +05:30
Dilith Jayakody
91a70ee848 Support for move_entire of multiple points 2022-01-06 22:08:49 +05:30
Dilith Jayakody
86965750d3 Fixed bezt select bug 2022-01-06 08:18:27 +05:30
Dilith Jayakody
cb537a4900 Move handles of all extruded points 2022-01-06 07:41:35 +05:30
Dilith Jayakody
f5cb8da816 Check if bezt exists before moving adjacent handles 2022-01-05 19:41:53 +05:30
Dilith Jayakody
5247a110a5 Fixed bug - handles don't recalculate 2022-01-05 13:00:00 +05:30
Dilith Jayakody
1ee127c444 Merge branch 'master' into soc-2021-curves 2022-01-04 17:39:32 +05:30
Dilith Jayakody
d9ba7065af Added option to link handles 2022-01-04 16:34:31 +05:30
Dilith Jayakody
be91e42a09 Separated the extra functionalities 2022-01-04 07:59:35 +05:30
Dilith Jayakody
3b0c770808 Added functionality to move entire points by handle 2022-01-04 07:16:38 +05:30
Dilith Jayakody
7e8efaf196 Fixed - Extrude from center when multiple splines 2022-01-03 23:18:16 +05:30
Dilith Jayakody
a60401b4a9 Fixed bug - Move segment beyond threshold 2022-01-03 23:05:12 +05:30
dilithjay
218e9aadd0 Revert changes to ED_curve_nurb_vert_selected_find 2022-01-02 18:02:36 +05:30
dilithjay
c22e8998f5 Switched make vector to toggle 2022-01-02 17:51:06 +05:30
dilithjay
5098fe1e4f Renaming, commenting and cleanup 2022-01-02 15:43:26 +05:30
dilithjay
0074becf73 Fixed bug - improper extrusion for 2d curves 2022-01-02 15:32:43 +05:30
dilithjay
a931836c55 Merge branch 'master' into soc-2021-curves 2022-01-02 14:45:04 +05:30
dilithjay
9a6cc25a8b Added support to enable move point & select multi 2022-01-02 14:33:03 +05:30
dilithjay
b14f7ae8f4 Make cyclic only by clicking center of endpoints 2022-01-02 11:53:54 +05:30
dilithjay
5437ceeeb3 Minor refactoring 2022-01-02 10:26:08 +05:30
dilithjay
665a722fa7 Added multiple select functionality 2022-01-02 08:33:32 +05:30
dilithjay
83bdbf2607 Fixed build warnings 2022-01-02 00:20:01 +05:30
dilithjay
5164a6018c Added support for converting to vector handles 2022-01-02 00:15:24 +05:30
dilithjay
33083dab58 Fixed bug, extrusion from internal point 2022-01-02 00:00:02 +05:30
dilithjay
34f4fc6119 Added functionality to move all selected points 2022-01-01 23:49:29 +05:30
dilithjay
b764b26d5a Set close spline to be enabled by default 2021-12-31 23:04:17 +05:30
dilithjay
166b1cb20d Fixed bug when attempting to move Poly edges 2021-12-26 08:09:04 +05:30
dilithjay
93c549870c Added functionality to create a new spline 2021-12-25 22:42:35 +05:30
dilithjay
2fe7a4cf72 Set delete to override select if both enabled 2021-12-25 22:16:19 +05:30
dilithjay
ec0e00ae49 Fixed bug: Added extruding for BPoint 2021-12-25 22:07:01 +05:30
dilithjay
f201b703d6 Added option to disable extra functionality 2021-12-25 17:13:49 +05:30
dilithjay
6808218d49 Renamed "Extra Functionality" to "Extra" 2021-12-25 15:55:32 +05:30
dilithjay
12cb8eea43 Set close spline default to false 2021-12-25 15:50:34 +05:30
dilithjay
64e13561f4 Fixed move point bug 2021-12-25 14:51:00 +05:30
dilithjay
2a45405fe2 Support for enabling functionalities from Properties 2021-12-25 09:45:33 +05:30
dilithjay
16e7573169 Merge branch 'master' into soc-2021-curves 2021-12-24 21:08:34 +05:30
dilithjay
6722a57633 Added property to switch between free handle
toggle and adjacent handle moving.
Also added option to choose key for the functionality.
2021-12-19 23:12:13 +05:30
dilithjay
b07c0499f8 Added option to define select threshold 2021-12-19 18:55:27 +05:30
dilithjay
9edd3299bc Clamped t between 0.1 and 0.9 2021-12-19 17:31:39 +05:30
dilithjay
0d5266d624 Merge master 2021-12-19 17:01:18 +05:30
dilithjay
1b2aa3a080 Clamped t to not let curves go to infinity 2021-12-19 16:36:04 +05:30
dilithjay
96a6d42fb2 Fixed error due to no selected beztriples 2021-12-12 22:28:51 +05:30
dilithjay
2dbaa30898 Added functionality to control handle of
adjacent `BezTriple`
2021-12-12 21:47:43 +05:30
dilithjay
9952fa66b8 Removed close curve functionality. 2021-12-12 06:50:26 +05:30
dilithjay
56e104b819 Reduced select distance threshold 2021-12-11 23:21:02 +05:30
dilithjay
10b1bfc4bf Merge branch 'master' into soc-2021-curves 2021-12-11 17:20:37 +05:30
dilithjay
477efa9297 Merge branch 'master' into soc-2021-curves 2021-12-09 07:02:46 +05:30
dilithjay
0ea727173e Fixed 2 warnings 2021-12-08 06:48:04 +05:30
dilithjay
be3fae6984 Fixed bug where move segment gives weird
results when adjusted from different 3D views.
2021-12-05 22:46:30 +05:30
dilithjay
22e5dfde3a undo point select threshold 2021-12-05 21:18:27 +05:30
dilithjay
6882b8e8d8 Threshold optimization 2021-12-04 22:04:43 +05:30
dilithjay
c500497ef7 Fixed segment jump when dragged 2021-12-04 21:14:28 +05:30
dilithjay
7d476a3af0 Fixed segment jump issue 2021-12-04 15:13:06 +05:30
dilithjay
341613e479 Shift click insert followed by transform operation 2021-12-04 07:59:06 +05:30
dilithjay
3a9f8ce94f Reduced move segment threshold 2021-12-03 23:27:10 +05:30
dilithjay
cd56e076df Changed free handle to hold from toggle 2021-12-03 22:48:46 +05:30
dilithjay
3ac022d328 Minor cleanup 2021-12-03 22:17:26 +05:30
dilithjay
6943362043 Merge branch 'master' into soc-2021-curves 2021-12-03 20:48:02 +05:30
dilithjay
98fe54b98f Merge branch 'master' into soc-2021-curves 2021-11-16 07:53:33 +05:30
dilithjay
65dc68c1b6 Merge branch 'master' into soc-2021-curves 2021-11-12 14:27:24 +05:30
dilithjay
71a9394fc6 Merge branch 'master' into soc-2021-curves 2021-11-11 21:40:15 +05:30
dilithjay
8bd4889556 Changed curve pen add to curve pen 2021-11-07 10:58:41 +05:30
dilithjay
5aeedbceec Changed to use nu->type 2021-11-07 09:04:37 +05:30
dilithjay
285f7ee9f9 Separated the single operator into 3 operators:
Add, Delete, Insert
2021-11-07 08:50:53 +05:30
dilithjay
d541820d27 Reverted curve pen add 2021-11-06 13:29:19 +05:30
dilithjay
4f877e831f Reverted curve pen add 2021-11-06 13:18:55 +05:30
dilithjay
4a5a53bac9 Removed unused Cancel mode in Curve Pen 2021-11-06 13:15:00 +05:30
dilithjay
a5bbe94819 Refactored by removing get_vertex_select() 2021-11-06 08:45:16 +05:30
dilithjay
0c45a5edcf Rename improper function name 2021-11-06 08:33:05 +05:30
dilithjay
40d374631d BPoint cut change 2021-11-06 08:31:46 +05:30
dilithjay
21c4e8944b Minor cleanup 2021-11-06 07:48:02 +05:30
dilithjay
b096af9e0e Fixed issue with select
Set shift to toggle free handles
2021-11-05 23:36:24 +05:30
dilithjay
12c07361a8 Added ed_ prefix to exposed functions 2021-11-05 19:55:45 +05:30
dilithjay
fbfc1fee98 Changed comments to adhere to style guide 2021-11-05 19:51:25 +05:30
dilithjay
0c0b275f4f Cleanup and minor refactoring 2021-11-05 19:29:06 +05:30
dilithjay
aad124859a Curve pen description change 2021-11-05 19:05:38 +05:30
dilithjay
7bf4990239 Fixed bug with making cuts near a point 2021-11-05 18:54:39 +05:30
dilithjay
0dc59490ec Fixed ASAN issue (memcpy-param-overlap):
Switched from memcpy to memmove
2021-11-05 17:57:57 +05:30
dilithjay
73dfcbff57 Merge branch 'master' into soc-2021-curves 2021-11-05 16:43:26 +05:30
dilithjay
bb1dcb8e94 Merge branch 'master' into soc-2021-curves 2021-11-04 17:13:33 +05:30
dilithjay
d7a92bc559 Merge branch 'master' into soc-2021-curves 2021-10-31 07:51:56 +05:30
dilithjay
105b39031d Merge branch 'master' into soc-2021-curves 2021-10-22 07:09:34 +05:30
dilithjay
04a8d09cfb Alterations according to changed event properties 2021-10-21 21:05:57 +05:30
dilithjay
a205195cac Merge branch 'master' into soc-2021-curves 2021-10-21 19:02:58 +05:30
dilithjay
1490b2159e Merge branch 'master' into soc-2021-curves 2021-09-30 18:17:21 +05:30
dilithjay
a4c46575ec Cleanup and refactoring 2021-09-30 18:16:16 +05:30
dilithjay
a80055d318 Merge branch 'master' into soc-2021-curves 2021-09-29 18:20:42 +05:30
dilithjay
5eb4209167 Merge branch 'master' into soc-2021-curves 2021-09-22 11:17:55 +05:30
dilithjay
b9b46a7439 Merge branch 'master' into soc-2021-curves 2021-09-01 11:39:17 +05:30
dilithjay
4e69306dd0 Minor refactoring of curve pen 2021-09-01 11:36:50 +05:30
dilithjay
73d36710db Reverted mid vertex extrude prevention 2021-08-28 08:23:29 +05:30
dilithjay
86b6fc63e6 Merge branch 'master' into soc-2021-curves 2021-08-27 18:01:08 +05:30
dilithjay
c2ccd11aea Removed several unnecessary comments. 2021-08-27 17:21:51 +05:30
dilithjay
95ddd4054b Changes according to revision suggestions 2021-08-27 17:10:25 +05:30
dilithjay
a088285d42 Curve Pen: Make cyclic only if more than 2 points 2021-08-25 08:57:09 +05:30
dilithjay
4aabb0664b Merge branch 'master' into soc-2021-curves 2021-08-24 23:25:35 +05:30
dilithjay
acdf8253a3 Merge branch 'master' into soc-2021-curves 2021-08-19 17:10:16 +05:30
dilithjay
c20e336835 Cleanup and bug fix 2021-08-19 14:24:19 +05:30
dilithjay
b69dd450d1 Fixed bug with moved handles snapping 2021-08-18 07:30:59 +05:30
dilithjay
86be1307a6 Fixed build warning 2021-08-15 19:00:32 +05:30
dilithjay
0cee6179d8 Merge branch 'master' into soc-2021-curves 2021-08-15 18:36:03 +05:30
dilithjay
517a5af157 General refactoring of curve pen 2021-08-14 08:20:38 +05:30
dilithjay
73fa5827d1 Merge branch 'master' into soc-2021-curves 2021-08-14 00:33:44 +05:30
dilithjay
0f2f114be9 Added vertex dissolve support for curve pen 2021-08-14 00:32:34 +05:30
dilithjay
7154dda6aa Merge branch 'master' into soc-2021-curves 2021-08-13 17:40:28 +05:30
dilithjay
4ebce492f3 Merge branch 'master' into soc-2021-curves 2021-08-12 00:07:15 +05:30
dilithjay
fb124208ce Merge branch 'master' into soc-2021-curves 2021-08-08 18:39:22 +05:30
dilithjay
8796f7e0a0 Merge branch 'soc-2021-curves' of git.blender.org:blender into soc-2021-curves 2021-08-08 18:27:29 +05:30
dilithjay
41550a1578 Curves: Curve Pen
This tool can be used to rapidly edit curves. It follows the design proposed here with the inclusion of a few changes. The final set of functionalities for Bezier splines are as follows:

* Add point: Click on empty space to add a new point connected to the currently selected point(s). If no point is currently selected, a new spline is created.
	* Only clicking adds a point with handles of type `vector`.
	* Click and drag to move handles as `auto` type handles.
	* Press Shift while dragging to set handles as `free` type handles.
	* Clicking two endpoints consecutively will close the spline to form a cycle.
* Make cut: Hold Ctrl and click to insert a vertex into the spline at the clicked location.
* Move control points and handles: Click and drag to move control points or handles.
* Alter segment: Click and drag on a curve segment to alter its shape.

All the above functionalities except for alter segment works similarly in the case of Poly and NURBS splines, minus the handle interactions.

Differential Revision: https://developer.blender.org/D12155
2021-08-06 23:04:55 +05:30
dilithjay
e375456758 Merge branch 'master' into soc-2021-curves 2021-08-06 22:55:28 +05:30
dilithjay
3a2d8315d0 Fixed bug with displacement when moving segment 2021-08-06 20:06:28 +05:30
dilithjay
2df5149e3d Merge branch 'master' into soc-2021-curves 2021-08-06 19:18:10 +05:30
dilithjay
f8c9a849f6 Merge branch 'master' into soc-2021-curves 2021-08-05 19:23:57 +05:30
dilithjay
4e8b8f8521 Bug fix: error when selecting NURBS spline 2021-08-05 19:21:39 +05:30
dilithjay
f504422d92 Added support for cutting Poly and NURBS splines 2021-08-05 18:53:26 +05:30
dilithjay
7637083dc3 Bug Fix with close loop on poly splines 2021-08-05 15:55:40 +05:30
dilithjay
b8f4c9eb0e Bug fix: loop closes when same endpoint selected 2021-08-05 15:32:50 +05:30
dilithjay
80454e38ad Removed vertex select when altering segment 2021-08-05 15:25:49 +05:30
dilithjay
0ab1532631 Added comments 2021-08-05 15:23:41 +05:30
dilithjay
2bbbed9f01 Suppressed several build warnings 2021-08-05 15:13:26 +05:30
dilithjay
0e28ba97cc Removed unused include headers 2021-08-05 15:09:44 +05:30
dilithjay
2c380e81cd Merge branch 'master' into soc-2021-curves 2021-08-05 08:10:20 +05:30
dilithjay
aaf029a30c Select adjacent vertices when moving a segment 2021-08-05 08:07:21 +05:30
dilithjay
b04d4b6adb Merge branch 'master' into soc-2021-curves 2021-08-04 11:20:57 +05:30
dilithjay
6c1a1f790b Merge branch 'master' into soc-2021-curves 2021-08-01 20:01:58 +05:30
dilithjay
02ea6e6a4b Merge branch 'master' into soc-2021-curves 2021-07-29 14:58:55 +05:30
dilithjay
35c9af757c Fixed memory leak in curve pen - move segment 2021-07-29 09:06:13 +05:30
dilithjay
3f1a013311 Feature to close splines by selecting endpoints 2021-07-29 09:01:49 +05:30
dilithjay
b659c79b30 Rename TempBeztData struct in curve pen 2021-07-28 19:37:58 +05:30
dilithjay
489457e326 Added feature to alter a segment using curve pen 2021-07-28 17:41:44 +05:30
dilithjay
3a49c928c1 Fix formatting changes due to auto format 2021-07-24 22:40:42 +05:30
dilithjay
44759155a8 Merge branch 'master' into soc-2021-curves 2021-07-24 07:26:50 +05:30
dilithjay
b8bbefb202 Merge 'master' into soc-2021-curves branch 2021-07-23 23:30:51 +05:30
dilithjay
9dcf078ddd Merge branch 'master' into soc-2021-curves 2021-07-23 23:30:13 +05:30
dilithjay
d770c8a38e Interpolate tilt, radius and weight in curve cut 2021-07-23 22:25:23 +05:30
dilithjay
8a51441476 Increased curve pen cut/delete threshold distance 2021-07-23 22:22:00 +05:30
Dilith Jayakody
dab7885807 Merge branch 'master' into soc-2021-curves 2021-07-21 01:01:25 +05:30
Dilith Jayakody
227e1429e8 Merge branch 'master' into soc-2021-curves 2021-07-20 20:23:34 +05:30
dilithjay
71ef45f142 Removed unnecessary memory allocation when deleting a point 2021-06-27 17:24:44 +05:30
dilithjay
561d3f3b98 Explicitly mentioned array lengths in method signatures for clarity 2021-06-27 17:19:14 +05:30
dilithjay
9c3fa785fb Fixed bug where points were added with a displacement 2021-06-27 14:02:49 +05:30
dilithjay
b8c0929428 Fixed several build warnings 2021-06-27 11:42:51 +05:30
dilithjay
8c17e6fdd7 Fixed bug where making a cut near VECT handles alters shape 2021-06-25 22:55:01 +05:30
dilithjay
f20930b39a Cleanup: Refactoring and commenting methods 2021-06-25 11:04:52 +05:30
dilithjay
202b2650bc Cleanup: Refactoring and commenting methods 2021-06-24 23:58:12 +05:30
dilithjay
2bd457b421 Reverted to cut/delete on press due to bad feel 2021-06-24 23:38:46 +05:30
dilithjay
6a39a8d94b Cleanup: Moved code out of modal method 2021-06-24 23:07:48 +05:30
dilithjay
aecb168b45 Fixed bug where pressing shift while moving bezt makes handles free 2021-06-24 14:41:10 +05:30
dilithjay
684cd42725 Cleanup: Minor refactoring 2021-06-24 14:21:16 +05:30
dilithjay
1714d568d5 Set cut and delete point to work on mouse release 2021-06-24 11:54:33 +05:30
dilithjay
09953ecb32 Fixed bug where cut doesn't work on cyclic curves 2021-06-24 11:04:47 +05:30
dilithjay
8d0f5155de Added support for shape preserving cuts 2021-06-22 08:07:55 +05:30
d368551d61 Fix T89306: GPencil selection doesn't work correctly with modifiers
The problem was introduced with Bezier modification because the selection code was using the original stroke and not the evaluated version.
2021-06-21 20:01:49 +05:30
4965b906e5 Cleanup: improve naming in Compositor 2021-06-21 20:01:48 +05:30
a19ab3233e Cleanup: move function parameter to member
Get current pass only when needed.
2021-06-21 20:01:48 +05:30
c42fefaa13 Add a reason for why an Addon can not be loaded. This change gives a more detailed explanation of the issue and may help the Addon Developer to identify what exactly needs to be changed.
The current message 'addon not loaded' is a bit too sparse.

Differential Revision: https://developer.blender.org/D11655
2021-06-21 20:01:48 +05:30
9a914b99b1 Fix T89122: crash when multi input is connected to multiple group inputs
The early `return` was wrong when there are multiple origin sockets
that need to be loaded.
2021-06-21 20:01:48 +05:30
Daniel Salazar
f544163866 Fix T89329: icosphere subdivisions can be set to 0
Differential Revision: https://developer.blender.org/D11658
2021-06-21 20:01:48 +05:30
42180bef94 Cleanup: use doxy sections in view3d iterators 2021-06-21 20:01:48 +05:30
91425527f0 Cleanup: variable naming in view3d_iterators
Consistently use a/b instead of 0/1.
2021-06-21 20:01:48 +05:30
80990794d6 Fix T32214: Wireframe edge select fails with verts behind the view
This resolves a long standing bug in edge selection
(picking, circle, box & lasso).

Now when one of the edges vertices fails to project into screen space,
the edge is clipped by the viewport to calculate an on-screen location
that can be used instead.

This isn't default as it may be important for the on the screen location
not to be clipped by the viewport.
2021-06-21 20:01:48 +05:30
94f10e8986 Cleanup: pass objects as const arguments 2021-06-21 20:01:48 +05:30
d789c7858d Cleanup: swap top/bottom args to planes_from_projmat
X & Z were ordered min/max, where as Y was max/min.
2021-06-21 20:01:48 +05:30
1476aa971a Fix T89271: Selecting all vertices doesn't select all edges.
Mistake in recent commit {rBea4309925f1d2d2a224bd1dce12269a58ade9b62}.
2021-06-21 20:01:48 +05:30
396be3d8dd Cleanup: Rename spline interpolation functions
The names were slightly longer than they needed to be clear,
and when they are shorter they tend to fit on one line better.
2021-06-21 20:01:47 +05:30
bac0956d3a Geometry Nodes: Multithread curve resample node
Optimize the node for the case of many splines. In a test file with
14000 splines, the node is 3x faster (72ms to 24ms) on an 8 core CPU.
2021-06-21 20:01:47 +05:30
2e9fa55b5c Cleanup: use early return in view3d iterator callbacks 2021-06-21 20:01:47 +05:30
f06409ffba Docs: improve imbuf.write docstring
The file path wasn't documented as being optional.
2021-06-21 20:01:47 +05:30
e84493af59 Delaunay add support for detecting and removing holes from output.
Adds two new output modes to the CDT api which detect and remove
holes. A hole is a face from which a ray shot to the outside
intersects an even number of constraint edges, except we don't
count constraint edges in the same connected region of faces,
where a region is connected via non-constraint edges.

These modes are useful for filling in outlines meant to represent
text characters and the like.

Original patch was from Erik Abrahamsson, modified by me to work
with the "valid Bmesh" output type too. I also added tests
for the new modes.
2021-06-21 20:01:47 +05:30
427252fb8a Fix T89310: Industry Compatible keymap not working
Caused by improper testing on my part, assuming a helper function
existed in the industry compatible keymap file, and also assuming it
also used the N and T keys for the left and right side-regions.
2021-06-21 20:01:47 +05:30
b5d76b889e Curves: Multithread Curve to CurveEval conversion
A different data structure / implementation is used for curves in the
node tree currently. Converting from the DNA `Curve` structure to this
wasn't slow, but it's nice to decrease overhead. In a test of 14000
splines with 128000 points, this halves the runtime from about 5ms
to about 2.5ms.
2021-06-21 20:01:47 +05:30
5ffb3b1093 Fix: Spreadsheet selection filter crash on non-mesh components
The spreadsheet filter tried to apply the mesh selection filter on non-
mesh geometry components. Add a check for the component type,
and also refactor the function to be more easily readable.
2021-06-21 20:01:47 +05:30
596bfa73f9 Fix T89302: Broken normals after mesh to curve node
The normals were broken because the normal calculation mode wasn't set.
This patch adds a default normal mode so all code creating a spline does
not necessarily have to set it manually. In the future there should be a
way to change this value in the node tree.
2021-06-21 20:01:47 +05:30
fcfc2ed810 Docs: improve poly_to_tri_count doc-string
It wasn't obvious this can be used for calculating the triangle index
from the polygon and loop index.
2021-06-21 20:01:47 +05:30
23779c2964 Cleanup: remove contents of endif() in cmake
This convention is no longer used for Blender's CMake files.
2021-06-21 20:01:47 +05:30
374a22077d Cleanup: use eSpace_Type enum type 2021-06-21 20:01:47 +05:30
c40897414b Cleanup: make BKE_mesh_loops_to_tessdata a static function 2021-06-21 20:01:47 +05:30
07cde1006b Docs: add additional notes on tessellation, update comments 2021-06-21 20:01:46 +05:30
267f238ba5 Mesh: minor optimization to concave quad check for tessellation
Use the face normal (when available) for a faster concave quad test.
2021-06-21 20:01:46 +05:30
5a2a2a59d8 Mesh: optimize object mode face tessellation
- Multi-thread BKE_mesh_recalc_looptri.

- Add BKE_mesh_recalc_looptri_with_normals,
  this skips having to calculate normals for ngons.

Exact performance depends on number of faces, size of ngons and
available CPU cores.

For high poly meshes the isolated improvement to BKE_mesh_recalc_looptri
in my tests was between 6.7x .. 25.0x, with the largest gains seen in
meshes containing ngons with many sides.

The overall speedup for high poly meshes containing quads and triangles
is only ~20% although ngon heavy meshes can be much faster.
2021-06-21 20:01:46 +05:30
c24535a64a Cleanup: clang-format 2021-06-21 20:01:46 +05:30
7cf7442052 Cleanup: use doxy sections 2021-06-21 20:01:46 +05:30
8640777f90 Cleanup: clang-tidy 2021-06-21 20:01:46 +05:30
97eb645267 VSE: Remove seq->tmp usage
Remove `seq->tmp` usage from transform code. It was used to tag strips
that need to be "shuffled". Pass these strips in `SeqCollection`
instead.

Reviewed By: sergey, mano-wii

Differential Revision: https://developer.blender.org/D11631
2021-06-21 20:01:46 +05:30
4ae05040ca Spreadsheet Editor: Row Filters
This patch adds support for filtering rows based on rules and values.
Filters will work for any attribute data source, they are a property
of the spreadsheet rather than of the attribute system. The properties
displayed in the row filter can depend on data type of the currently
visible column with that name. If the name is no longer visible, the
row filter filter is grayed out, but it will remember the value until
a column with its name is visible again.

Note: The comments in `screen.c` combined with tagging the sidebar
for redraw after the main region point to a lack of understanding
or technical debt, that is a point to improve in the future.

**Future Improvements**
* T89272: A search menu for visible columns when adding a new filter.
* T89273: Possibly a "Range" operation.

Differential Revision: https://developer.blender.org/D10959
2021-06-21 20:01:46 +05:30
8460a1f242 Fix T89261: Crash when calculating bmesh tessellation
Error passing `false` instead of a `BMeshCalcTessellation_Params` struct.
2021-06-21 20:01:46 +05:30
361d541fc8 Cleanup: Remove dead code
This code was disabled in 2.8 and all other associated code/comments 
have been removed/cleared. These rna properties have been replaced with 
`seq_prev_type`
2021-06-21 20:01:46 +05:30
d6930228a4 Fix Build Warning
Removal of unused local variable. Calculation of underline thickness
no longer needed with change to text output of underscore character.

Introduced in aee04d4960

Differential Revision: https://developer.blender.org/D11641
2021-06-21 20:01:45 +05:30
b1026e1054 Fix T89259: GPencil Duplicate point doesn't work for last point
The loop was checking the len of the island, but if the island started in the last point the copy was not executed.
2021-06-21 20:01:45 +05:30
6ed3e4e6a1 Armature: add automatic B-Bone Scale toggles.
Currently B-Bone scaling can only be controlled via their
properties, thus requiring up to 8 drivers per joint between
B-Bones to transfer scaling factors from the handle bone.

A Scale Easing option is added to multiply the easing value
by the Y scale channels to synchronize them - this produces a
natural scaling effect where both the shape of the curve and
the scale is affected.

In addition, four toggles are added for each handle, which
multiply each of the X, Y, Z and Ease values by the matching
Local Scale channel of the handle bone, thus replacing trivial
drivers. The Scale Easing option has no effect on this process
since it's easy to just enable both Length and Ease buttons.

Differential Revision: https://developer.blender.org/D9870
2021-06-21 20:01:45 +05:30
d3c0595561 Armature: implement lengthwise scaling of B-Bone segments.
Implement actual behavior for the B-Bone Y Scale channels added
to DNA and UI in the previous commit in addition to the existing
X and Z Scale inputs.

The two length scale inputs control the ratio between the lengths
of the start and end segments of the bone: although for convenience
two inputs are provided, the whole chain is still uniformly scaled
to fit the curve.

Differential Revision: https://developer.blender.org/D9870
2021-06-21 20:01:45 +05:30
3ae5cef82a Armature: add B-Bone Y scale channel and extra flag fields to DNA.
In addition to the base bone transformation itself, B-Bones have
controls that affect transformation of its segments. For rotation
the features are quite complete, allowing to both reorient the
Bezier handles via properties, and to control them using custom
handle bones. However for scaling there are two deficiencies.

First, there are only X and Y scale factors (actually X and Z),
while lengthwise all segments have the same scaling. The ease
option merely affects the shape of the curve, and does not cause
actual scaling.

Second, scaling can only be controlled via properties, thus
requiring up to 6 drivers per joint between B-Bones to transfer
scaling factors from the handle bone. This is very inefficient.

Finally, the Z channels are confusingly called Y.

This commit adds a B-Bone Y Scale channel and extra B-Bone flag
fields to DNA with appropriate versioning (including for F-Curves
and drivers) in preparation to addressing these limitations.

Functionality is not changed, so the new fields are not used
until the following commits.

Differential Revision: https://developer.blender.org/D9870
2021-06-21 20:01:45 +05:30
ede9f0e32c Fix T89246: No Mnemonic Underlines in Dialogs
When drawing mnemonic underlines for hotkeys, use text output of
underscore character instead of direct drawing a line. Otherwise these
are not visible in dialog buttons.

Introduced in 0fcc063fd9

Differential Revision: https://developer.blender.org/D11641

Reviewed by Campbell Barton
2021-06-21 20:01:45 +05:30
95553a376c UI: Sequencer: Use ampersand instead of slash for "Sequencer/Preview"
Using an ampersand here is more semantically correct. A slash indicates "or" while an ampersand indicates "and".
An ampersand here is best because the view type shows both the Sequencer and the Preview.
2021-06-21 20:01:45 +05:30
a09eddc93b GPencil: Missed flag in previous Copy Settings commit 2021-06-21 20:01:45 +05:30
996f09b65a GPencil: Move copy layer settings to function
Better to have a function that can be reused to duplicate the settings that need to be copied.
2021-06-21 20:01:45 +05:30
Jeroen Bakker
67e6fb811e DrawManager: Multithreaded counting of material buckets.
When having multiple materials in a mesh the triangles are sorted based
on material index. This sorting is done single threaded, but needs two
loops over the data. One to count the bucket size and the second one to
add the triangles to the right position in the buckets.

This patch will do the counting in a multithreaded approach that would
speed up the cache creation. It has been measured that this part is the
most blocking part of the cache creation.

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D11615
2021-06-21 20:01:45 +05:30
Jeroen Bakker
bf6d70f51d BMesh: use threading to count total selection.
During selections the total selection is refreshed at the end. This
process was done single threaded. This patch will do a parallel iter
approach.

Master: 0.043612s Threaded 0.017964s.

Master: {F10179586}
This patch: {F10179587}

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D11622
2021-06-21 20:01:45 +05:30
112b6bbe3a Fix T89262: Crash in regular FileBrowser ID listing of 'asset' .blend files.
`ED_fileselect_get_asset_params` would only return actual data pointer
when file browser is in ASSET mode.

Calling that whole section only makes sense if filebrowser is in asset
mode anyway.

Regression introduced in rBf6c5af3d4753 I think.

@Severin committing this fix now as this is a fairly critical bug for
the studio, feel free to revert and do proper fix if this one is not the
best solution.
2021-06-21 20:01:44 +05:30
Jeroen Bakker
cd3cf84e1b Performance: Limit recounting during selection mode flushing.
This patch ensures that selection mode flushing updates total selection
counts internally. This reduces recounting when we are sure that the
input total selection counts were up to date.

For example for circle selection the total selection counts were
correct. But during flushing the selection could have been changed and
therefore the selection was always recounted.

This increased the performance on selected system from 6.90 FPS to 8.25
FPS during circle selection operations.

Before: {F10179981}
After: {F10179982}

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D11647
2021-06-21 20:01:44 +05:30
5cf661e007 Fix error passing in false as instead of a struct
Error in 8a1860bd9a.
2021-06-21 20:01:44 +05:30
3d5df5bd8f Fix T88394: crash when editing animated Alembic properties
When an object, whose mesh gets loaded from Alembic, gets animated in
Blender and the Alembic CacheFile datablock also gets animated, editing
keyframes causes both datablock to be re-copied for evaluation. This
caused a threading issue and a double-free of some memory. This is fixed
by expanding the scope of the spin lock in
`BKE_cachefile_reader_free()`.
2021-06-21 20:01:44 +05:30
4a8197a955 Fix T89240: Crash when moving vertices on a linked duplicate
There is an attempt to free an illegal pointer in `extract_edge_fac_finish`.
2021-06-21 20:01:44 +05:30
13566830f8 Fluid: Clang-format cleanup
Updated fluid source files in extern with clang-format.
2021-06-21 20:01:44 +05:30
b3f5f6dfb9 Fluid: Optimization for FLIP neighbor search radius
Contributed by @erik85 in D11400. The idea from this patch was placed in
a more generic context: A new FOR macro has been added that loops
over the neighbors of a cell within a given radius.
2021-06-21 20:01:44 +05:30
7f56d76b00 Fix T88605: Alembic import crashes when missing arbGeomParams
Add check for the `arbGeomParams` property being valid, before attempting
to access a sub-property from it.
2021-06-21 20:01:44 +05:30
ba757431d2 Cleanup: clang format 2021-06-21 20:01:44 +05:30
435cc48d0c Fix invalid polygon normal array access building bake data
Pre computed normals index wasn't properly aligned.
Regression from 2ec00ea0c1.
2021-06-21 20:01:44 +05:30
0be4dfb070 Cleanup: use 'bmesh' prefix for BMesh tessellation utilities 2021-06-21 20:01:44 +05:30
341f5f2ec0 Cleanup: rename test_index_face -> BKE_mesh_mface_index_validate 2021-06-21 20:01:44 +05:30
6acbddc6b6 Cleanup: remove unused MFace custom-data utilities
Remove:

- BKE_mesh_loops_to_mface_corners
- BKE_mesh_tangent_loops_to_tessdata
2021-06-21 20:01:44 +05:30
4c4d3b2481 Cleanup: move mesh tessellation into it's own file
This matches BMesh which also has tessellation in it's own file.

Using a separate file helps with organization when
extracting code into smaller functions.
2021-06-21 20:01:43 +05:30
db98e9bb7f CMake: remove workaround for version that's no longer supported 2021-06-21 20:01:43 +05:30
479b799df9 Cleanup: clang-tidy 2021-06-21 20:01:43 +05:30
525b5c890c Cleanup: replace 'unsigned in' with 'uint' 2021-06-21 20:01:43 +05:30
9fdcdf9fdd Cleanup: use standard identifier for uint64_t string formatting 2021-06-21 20:01:43 +05:30
fd514255ec Fix undefs from previous commit 2021-06-21 20:01:43 +05:30
a58b3eb5c4 Fix T89210: Box selection can fail in graphics editor
Test the intersection of segment instead of point.
2021-06-21 20:01:43 +05:30
Fen
f15b107d0f Fix T89247: Dereference arguments to comparison function correctly
`bm_face_len_cmp` incorrectly interpreted its arguments as `BMFace *`
instead of `BMFace **`, causing an out-of-bounds read.

Ref D11637
2021-06-21 20:01:43 +05:30
be9de3e202 Fix T89233: Incorrect attribute remove warning for curves
The curve attribute delete function didn't return whether it was
successful or not.
2021-06-21 20:01:43 +05:30
305fe7be86 Raycast geometry node.
The //Raycast// node intersects rays from one geometry onto another.
It computes hit points on the target mesh and returns normals, distances
and any surface attribute specified by the user.

A ray starts on each point of the input //Geometry//. Rays continue
in the //Ray Direction// until they either hit the //Target Geometry//
or reach the //Ray Length// limit. If the target is hit, the value of the
//Is Hit// attribute in the output mesh will be true. //Hit Position//,
//Hit Normal//, //Hit Distance// and //Hit Index// are the properties of the
target mesh at the intersection point. In addition, a //Target Attribute//
can be specified that is interpolated at the hit point and the result
stored in //Hit Attribute//.

Docs: D11620

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D11619
2021-06-21 20:01:43 +05:30
11c594644f Fix T89234: Gpencil Separate doesn't copy settings in Stroke/Point mode
Some values were not copied from the old layer to the new one as Tint or Opacity factor.

The error affected to Strokes and Point mode
2021-06-21 20:01:42 +05:30
db133b568c Geometry Nodes: Add Curve Subdivision Node
This node creates splines with more control points in between the
existing control points. The point is to give the splines more
definition for further tweaking like randomization with white noise,
instead of deforming a resampled poly spline with a noise texture.

For poly splines and NURBS, the node simply interpolates new values
between the existing control points. However, for Bezier splines,
the result follows the existing evaluated shape of the curve, changing
the handle positions and handle types to make that possible.

The number of "cuts" can be controlled by an integer input, or an
attribute can be used. Both spline and point domain attributes are
supported, so the number of cuts can vary using the value from the
point at the start of each segment.

Dynamic curve attributes are interpolated to the result with linear
interpolation.

Differential Revision: https://developer.blender.org/D11421
2021-06-21 20:01:42 +05:30
77b8dbfc3b Geometry Nodes: support minimum twist normal mode
The minimum twist mode is important because it allows creating
normals without sudden changes in direction. The disadvantage
of minimum twist normals is that the normals depend on all control
points. So changing one control point can change the normals
everywhere. The computed normals do not match the existing
code exactly, although they do match quite well on non-cyclic and
on some cyclic curves. I also noticed that the existing implementation
has some fairly simple failure cases that I haven't found in the new
implementation so far.

Differential Revision: https://developer.blender.org/D11621
2021-06-21 20:01:42 +05:30
d3ab663b6e Geometry Nodes: fix ownership issue in spline to points conversion
Previously, `VArray_For_SplineToPoint` did not take ownership of the
virtual array leading to use-after-free errors.
2021-06-21 20:01:42 +05:30
f15a58a7eb Geometry Nodes: improve node locking in evaluator
This makes the parts where a node is locked more explicit. Also, now the thread
is isolated when the node is locked. This prevents some kinds of deadlocks
(which haven't happened in practice yet).
2021-06-21 20:01:42 +05:30
6083639024 Cleanup: use doxy sections for rna_mesh.c 2021-06-21 20:01:42 +05:30
7cf1cc93ce Cleanup: rename rna_Mesh_update_data to rna_Mesh_update_data_deg_all
It's ambiguous what rna_Mesh_update_data does compared with functions
that use `rna_Mesh_update_data_*` as a prefix.

Noticed by @sybren D11377 review.
2021-06-21 20:01:42 +05:30
1485e3359c Cleanup: improved comment for skipping updated with zero user meshes
Noticed by @sybren D11377 review.
2021-06-21 20:01:42 +05:30
edc7f2f0bf Cleanup: split BKE_mesh_copy_settings into two functions
- BKE_mesh_copy_parameters_for_eval to be used for evaluated meshes only
  as it doesn't handle ID user-counts.

- BKE_mesh_copy_parameters is a general function for copying parameters
  between meshes.
2021-06-21 20:01:42 +05:30
122ec3a5cb Cleanup: spelling 2021-06-21 20:01:42 +05:30
b091cc5eea Cleanup: unused argument, function & shadow variable warning 2021-06-21 20:01:42 +05:30
e83f47e4b0 VSE: Refactor transform operator code
Refactor function `freeSeqData` so it is readable.

One strip can have multiple transform operations defined. To prevent
processing strip multiple times, build `SeqCollection` and use
sequencer iterator instead of iterating `TransData` directly.

No functional changes.

Differential Revision: https://developer.blender.org/D11618
2021-06-21 20:01:42 +05:30
63dc720fad VSE: Reduce transform code complexity
Reduce complexity of sequencer transform code by removing recursivity.
This is possible by treating meta strips (mostly) as any other strip and
containing all transform code within SEQ_ functions.

Unfortunately internally meta strips still require special treatment,
but all complexity from code all over transform code seems to be
possible to contain within one function.

Functional change:
Previously adjusting handle of single image strip moved animation.
Now animation is not moved, which is behavior for all other strips.

Reviewed By: sergey, mano-wii

Differential Revision: https://developer.blender.org/D11493
2021-06-21 20:01:41 +05:30
c12f638b7d Revert "Fix T89204: slow repeated rendering with GPUOffscreen.draw_view3d"
This reverts commit d03b26edbd. There is some
refresh issue that needs to be solved before this can be enabled.
2021-06-21 20:01:41 +05:30
c9d534f484 Fix T88342: 'To Sphere' and 'Push/Pull' not working in Pose mode
Some modes don't take into account that `TransData` may be in data space.
2021-06-21 20:01:41 +05:30
5bb86422e5 Fix T89204: slow repeated rendering with GPUOffscreen.draw_view3d
Cache the GPUViewport so the framebuffers and associated textures are not
reallocated each time.
2021-06-21 20:01:41 +05:30
be6858eddc Edge-scrolling for node editor
Starts scrolling when dragging a node or node link and going outside the current window.
Largely copied from the VIEW2D_OT_edge_pan operator.

Edge panning operator customdata and supporting functions now in
UI_view2d.h, so they could be used by operators in other editor
libraries. The VIEW2D_OT_edge_pan operator also uses this customdata and
shared functions now. Operators properties can be used to configure
edge panning margins and speed for each use case, rather than using
hardcoded values.

The speed function for edge panning has been tweaked somewhat:
* "Speed per pixel" has been replaced with a "speed ramp" distance.
  This is more intuitive and also creates an upper bound for the speed,
  which can otherwise become extreme with large cursor distance.
* "Max speed" is reached at the end of the speed ramp.
* Padding the region inside and outside is applied as before, but both
  values are operator properties now.

Node transform operator also supports edge panning. This requires
an offset for changes in the view2d rect, otherwise nodes are "stuck"
to the original view.

Transform operator had cursor wrapping categorically enabled, but this
gets quite confusing with the edge scrolling mechanism. A new TransInfo
option T_NO_CURSOR_WRAP has been introduced to disable this behavior.
The double negative is a bit annoying, but want to avoid affecting the
existing transform modes, so by default it should still set the
OP_IS_MODAL_GRAB_CURSOR flag (which then sets the WM_CURSOR_WRAP_XY
flag during modal execution).

Reviewed By: HooglyBoogly, JacquesLucke

Differential Revision: https://developer.blender.org/D11073
2021-06-21 20:01:41 +05:30
f0357cac93 LineArt: Cached calculation for modifiers in the same stack.
This allows line art to run only once for each modifier stacks,
with an option to toggle a specific line art modifier should
use cache or re-do their own calculations.

Reviewed By: Sebastian Parborg (zeddb), Hans Goudey (HooglyBoogly)

Differential Revision: https://developer.blender.org/D11291
2021-06-21 20:01:41 +05:30
85d5ee1a1f BLI: add C++ wrapper for task isolation
This makes it easier to use task isolation in c++ code.
Previously, one either had to check `WITH_TBB` (possibly indirectly
through `WITH_OPENVDB`) or one had to use the C function which
is less convenient.
2021-06-21 20:01:41 +05:30
f766ee5fa3 BLI: add threading namespace
This namespace groups threading related functions/classes. This avoids
adding more threading related stuff to the blender namespace. Also it
makes naming a bit easier, e.g. the c++ version of BLI_task_isolate could
become blender::threading::isolate_task or something similar.

Differential Revision: https://developer.blender.org/D11624
2021-06-21 20:01:41 +05:30
14e25a7bfe ShaderFX operators: Tweak a bit poll functions, forbid in liboverride cases.
Similar to what we do for constraints and modifiers, except that
currently adding or editing shaderfx in liboverride objects is
completely unsuported.

Fix T88974.
2021-06-21 20:01:41 +05:30
294ce3a20b ShaderFX/LibOverride: Add BKE_shaderfx_is_nonlocal_in_liboverride util.
Used to detect if a shaderfx is purely local, or comes from linked data,
in case of a liboverride.

Not actually used yet since we do not currently support adding
shaderfx's to overrides, but will be in the future, and matches
constraints and modifiers code.
2021-06-21 20:01:41 +05:30
55fddbc363 Tweaks to Constraints operators poll functions.
Mainly:
* Make `ED_operator_object_active_editable_ex` properly report poll
  messages on failure.
* Add `ED_operator_object_active_local_editable_posemode_exclusive` for
  bone constraints requiring pure local Object (non-override one).
* General cleanup and adding more poll messages on failures.
2021-06-21 20:01:41 +05:30
81054071bc Fix: Image node alpha socket converted to operations twice
On selecting a multi-layer image with a combined pass, a "Combined"
socket is created and default combined pass socket "Image" is
disabled by setting `SOCK_UNAVAIL` flag. When converting into
operations, `ImageNode` converts alpha socket on finding any socket with
a combined pass without checking the flag.

Since commit rB93e2491ee724 an assertion fails when mapping sockets
twice because now map `add_new` is used.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11566
2021-06-21 20:01:40 +05:30
8a9d0cf5a4 Compositor: Full frame Value node
Adds full frame implementation to Value node operation.
No functional changes.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11594
2021-06-21 20:01:40 +05:30
da03876fc0 Compositor: Full frame RGB node
Adds full frame implementation to RGB node operation.
No functional changes.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11593
2021-06-21 20:01:40 +05:30
41d1cff5da Geometry Nodes: fix z-up spline normal calculation
Previously it didn't work when the tangents were collinear to the z axis.
2021-06-21 20:01:40 +05:30
9a7551a9ca Alembic procedural: support reading per-vertex UV sets
This adds support for importing UV sets which are defined per vertex,
instead of per face corners. Such UV sets can be generated when the
mesh is split according to UV islands, or when there is only one UV
island, in which cases only a single UV value can be stored per
vertex since vertices will never be on a seam.
2021-06-21 20:01:40 +05:30
38a4c0fb36 Cleanup: minor simplification to status allocation 2021-06-21 20:01:40 +05:30
4ce85df830 Fix pose-mode statistics with multi-object editing
- Include all objects in pose mode.
- Show the number of objects in pose mode.
- Show the number of objects in edit mode for all types of objects
  (not just meshes).
2021-06-21 20:01:40 +05:30
2ca54626fd Cleanup: sculpt mode checks when calculating stats
Sculpting dynamic topology used to code-path for counting object
then never used the result.

Match object mode checks in string access & drawing.
2021-06-21 20:01:40 +05:30
1f1f1d9a8a Alembic: support reading per-vertex UV sets
This adds support for importing UV sets which are defined per vertex,
instead of per face corners. Such UV sets can be generated when the
mesh is split according to UV islands, or when there is only one UV
island, in which cases only a single UV value can be stored per
vertex since vertices will never be on a seam.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D11584
2021-06-21 20:01:40 +05:30
b786aae47a Cleanup: reduce warnings when compiling release builds. 2021-06-21 20:01:40 +05:30
Johnny Matthews
71ded26870 Geometry Nodes: Separate Components Node
Implementation of T86970. This node takes a geometry input with
multiple components and outputs them by component type. Meshes,
Curves, and Point Clouds support combining multiple input instances,
while volumes will only output the first volume component input until
suitable instance realization for multiple volumes is finished.

When direct geometry instancing is implemented it will be possible to
avoid realizing instances in this node.

Differential Revision: https://developer.blender.org/D11577
2021-06-21 20:01:40 +05:30
883889baf1 Screen: simplify internal logic for new full-screen areas
Creating a new full screen area had it's area initialized as empty,
updating the screen then set the area to a 3D view (as a fallback),
before the actual area type was set.

This made setting the intended space-type run the 3D views exit callback
on a 3D view without a View3D struct allocated, which the exit callback
needed to account for.

Resolve by calling ED_screen_change after the area type has been set.
2021-06-21 20:01:40 +05:30
f69039405d Cleanup: unused warning 2021-06-21 20:01:40 +05:30
41173b1776 Cleanup: Fix inconsistent parameter name warning 2021-06-21 20:01:39 +05:30
a774e516d1 UI - LOCAL View3D overlay stats
This patch improves the 3DView statistics overlay to show LOCAL stats
while in local view. This means the stats can vary between 3DViews and
the statusbar when views are in local view, but this gives a much more
accurate count of the objects, and their components, that you are
directly working with rather than just scene values.

Differential Revision: https://developer.blender.org/D8883

Reviewed by Campbell Barton
2021-06-21 20:01:39 +05:30
77054889b7 Fix T88263: Incorrect image offset from old file
Versioning code for converting strip offset property doesn't work, when
property was animated and disabled or when crop was used.

When offset property is animated and offset is enabled, animation is
converted to be used with new transform design. When offset is disabled,
animation is left untouched. New transform design doesn't have option
to disable offset, and therefore old unconverted animation is used
instead of converted static value.

Remove animation from propery if it was unused.

Another issue was that both X and Y offset animation was being corrected
by factor caluclated for X channel.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11370
2021-06-21 20:01:39 +05:30
60f57455b5 VSE: Improve animation evaluation performance
Use lookup string callback function for `sequences_all` RNA property
`rna_SequenceEditor_sequences_all_lookup_string` using a GHash for faster lookups.

When names are changed or strips are added/removed the lookup is tagged invalid.
The next time the lookup is used it will rebuild it.

Reviewed By: sergey, jbakker

Differential Revision: https://developer.blender.org/D11544
2021-06-21 20:01:39 +05:30
31bae3644d Geometry Nodes: Allow int attribute input fields with single value
Just like the way we often have a choice between an attribute input and
a single float, this adds the ability to choose between attribute and
integer input sockets, useful for D11421.
2021-06-21 20:01:39 +05:30
c976be6d4d Cleanup: Expose function publicly, rename
There is no particular reason these two functions shouldn't be used
outside of the bezier spline implementation since they don't do anything
particularly controversial.
2021-06-21 20:01:39 +05:30
7d35176b0e Splines: Add resize method to CurveEval
This helps when adding splines to a new curve in parallel.
2021-06-21 20:01:39 +05:30
Germano Cavalcante
182e7c0a94 DRW: sanitize 'DRW_mesh_batch_cache_dirty_tag'
Create maps that specify which batches have vbo or ibo as a reference
and use these maps to discard batches along with buffers.

Differential Revision: https://developer.blender.org/D11588
2021-06-21 20:01:39 +05:30
072c8b6beb Cleanup: Add files for version independent versioning helpers
Adds `source/blender/blendloader/intern/versioning_common.cc` and
`versioning_common.h` for version independent versioning functions.

I only placed `do_versions_add_region_if_not_found()` in there for now.
`blo_do_version_old_trackto_to_constraints()` could also be added, but
that's so old, I prefer keeping that in `versioning_legacy.c`.
2021-06-21 20:01:39 +05:30
133358f0ab UI: Support right aligned non-shortcut hints in widgets
Widget drawing code already supported drawing right-aligned, grayed out
shortcut strings. This patch generalizes things a bit so this can also
be used to draw other hints in the same way. There have been a few
instances in the past where this would've been useful, D11046 being the
latest one.

Note that besides some manual regression testing, I didn't check if this
works yet, as there is no code actually using it (other than the
shortcuts). Can be checked as part of further development for D11046.

A possible further improvement would be providing a way to define how
clipping should be done. E.g. sometimes the right-aligned text should be
clipped first (because it's just a hint), in other cases it should be
left untouched (like current code explicitly does it for shortcuts).

Removes the `UI_BUT_HAS_SHORTCUT` flag, which isn't needed anymore.
2021-06-21 20:01:39 +05:30
7a4252d461 BLI: use explicit task isolation, no longer part of parallel operations
After looking into task isolation issues with Sergey, we couldn't find the
reason behind the deadlocks that we are getting in T87938 and a Sprite Fright
file involving motion blur renders.

There is no apparent place where we adding or waiting on tasks in a task group
from different isolation regions, which is what is known to cause problems. Yet
it still hangs. Either we do not understand some limitation of TBB isolation,
or there is a bug in TBB, but we could not figure it out.

Instead the idea is to use isolation only where we know we need it: when
holding a mutex lock and then doing some multithreaded operation within that
locked region. Three places where we do this now:
* Generated images
* Cached BVH tree building
* OpenVDB lazy grid loading

Compared to the more automatic approach previously used, there is the downside
that it is easy to miss places where we need isolation. Yet doing it more
automatically is also causing unexpected issue and bugs that we found no
solution for, so this seems better.

Patch implemented by Sergey and me.

Differential Revision: https://developer.blender.org/D11603
2021-06-21 20:01:39 +05:30
Germano Cavalcante
8e0fe740b3 Draw Cache: avoid recalculating 'poly_normals'
Call `BKE_mesh_ensure_normals_for_display` to avoid recalculating
poly_normals.

**Benchmark**
||master:|PATCH:
|---|---|---|
|looptris_test:|Average: 3.995076 FPS|Average: 4.047470 FPS
||rdata 11ms iter 91ms (frame 235ms)|rdata 11ms iter 86ms (frame 233ms)
|subdiv_mesh_cage_and_final:|Average: 1.884492 FPS|Average: 1.900114 FPS
||rdata 7ms iter 42ms (frame 268ms)|rdata 7ms iter 39ms (frame 265ms)
||rdata 7ms iter 44ms (frame 259ms)|rdata 7ms iter 42ms (frame 257ms)
|subdiv_mesh_final_only:|Average: 6.245944 FPS|Average: 6.289000 FPS
||rdata 3ms iter 23ms (frame 153ms)|rdata 3ms iter 21ms (frame 154ms)
|subdiv_mesh_final_only_ledge:|Average: 6.263482 FPS|Average: 6.187218 FPS
||rdata 3ms iter 23ms (frame 156ms)|rdata 3ms iter 22ms (frame 154ms)

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11527
2021-06-21 20:01:38 +05:30
4825964ec2 Cleanup: use back-slash for doxygen comments 2021-06-21 20:01:38 +05:30
27974bc70f CMake: disable TBB when not found 2021-06-21 20:01:38 +05:30
Jeroen Bakker
144fce2be9 DrawManager: Cache material offsets.
When using multiple materials in a single mesh the most time is spend in
counting the offsets of each material for the sorting.

This patch moves the counting of the offsets to render mesh data and
caches it as long as the geometry doesn't change.

This patch doesn't include multithreading of this code.

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D11612
2021-06-21 20:01:38 +05:30
3f90def66a Fix warning treated as an error
"void' function returning a value".
2021-06-21 20:01:38 +05:30
3b224bb7cc Cleanup: Added hierarchy in MeshBufferExtractionCache. 2021-06-21 20:01:38 +05:30
7752e45353 Cleanup: Split mesh_render_data_loose_geom into multiple functions. 2021-06-21 20:01:38 +05:30
8e7f972b2b Fix: wrong size check
This fixes a bad mistake by myself. Thanks Lukas Tönne for telling me.
2021-06-21 20:01:38 +05:30
9ed381b5cd Fix: Sequencer backdrop not updated during playback.
Caused by recent optimization in {7b76a160a4}.
2021-06-21 20:01:38 +05:30
20dfcd99b7 BMesh: assert that face normals have been updated for tessellation
This catches missing normal updates that may cause invalid tessellation.
2021-06-21 20:01:38 +05:30
8116a82fbe Cleanup: remove return value from face normal calculation
This value is always 'sides - 2', no need to return this value.
2021-06-21 20:01:38 +05:30
105208f54f Fix missing normal update in edit-mesh blend-from shape operator 2021-06-21 20:01:37 +05:30
bd0c4d9dcf BMesh: use faster normal update method for edit-mesh coordinates
This wasn't included in the previous fix so it'd be 2.93 compatible.
2021-06-21 20:01:37 +05:30
343d194809 Fix outdated face tessellation use when editing edit-mesh coodinates 2021-06-21 20:01:37 +05:30
45589b2d76 Screen: clear runtime structures on file-read & data-copy
Clear the runtime data structs instead of individual members,
this simplifies adding new runtime members as there are at least
two places they would need to be cleared.

Resolves error in D8883.
2021-06-21 20:01:37 +05:30
3a13f76774 Cleanup: correct incomplete comment 2021-06-21 20:01:37 +05:30
869ec4b5a7 Fix image space missing mask display panel 2021-06-21 20:01:37 +05:30
842c32609e Cleanup: remove "_" prefix for used arguments 2021-06-21 20:01:37 +05:30
3f9a6c5069 Cleanup: unused argument & variable warnings 2021-06-21 20:01:37 +05:30
af92277aba Cleanup: use private methods for internal operator utilities
Also remove unused argument.
2021-06-21 20:01:37 +05:30
417a0b436d Cleanup: use doxygen comments for DNA_color_types
Also use enum instead of defines for Scopes.wavefrm_mode
2021-06-21 20:01:37 +05:30
dea9ac4f55 Win8 cleanup, remove dead function pointer and macro. 2021-06-21 20:01:37 +05:30
4fce0ac5d7 Geometry Nodes: Join dynamic curve attributes in the join geometry node
This commit lets the join geometry node transfer dynamic attributes
to the result, the same way that point cloud and mesh attributes are
joined. The implementation is different though, because of an
optimization implemented for curves to avoid copying splines.

The result attribute is added with the highest priority domain (points
over splines), and the highest complexity data type. If one curve had
the attribute on the spline domain but not others, the point domain
values will be used.

Generally this is a bit lower level than I would have liked this code
to be, but should be efficient, and it's really not too complicated.

Differential Revision: https://developer.blender.org/D11491
2021-06-21 20:01:37 +05:30
65902d2b3d Geometry Nodes: Parallelize curve reverse node
Each spline can be handled separately here. This gives approximately a
2x speedup on my 8 core processor on an input of 80000 2 point splines.
2021-06-21 20:01:37 +05:30
8db34099eb Cleanup: Refactor join geometry node attribute gathering
Instead of building a set and then determining the final domain and
type for every attribute separately in the loop, construct a map with
the necessary data in the first place. This is simpler and should be
slightly more efficient.

Split from D11491
2021-06-21 20:01:36 +05:30
Johnny Matthews
83b67acfa6 Geometry Nodes: Curve Reverse Node
This is an implementation of T88722. It accepts a curve object and
for each spline, reverses the order of the points and all attributes.
This is more of a foundational node to support other nodes in the
future (like curve deform)

Selection takes spline domain attributes to determine which splines
are selected. If no selection is present all splines are reversed.

Differential Revision: https://developer.blender.org/D11538
2021-06-21 20:01:36 +05:30
e1d62d67f3 Geometry Nodes: Curve to Points Node for Evaluated Data
This node implements the second option of T87429, creating points
along the input splines with the necessary evaluated information
for instancing: `tangent`, `normal`, and `rotation` attributes.
All generic curve point and spline attributes are copied to the
result points as well.

The "Count" and "Length" methods are just like the current options
in the resample node, but the output is points instead of a curve.
The "Evaluated" method uses the points you see on the curve directly,
and therefore should be the fastest.

The rotation data is retrieved from a transform matrix built with the
same method that the curve to mesh node uses. The radius attribute is
divided by 10 so the points don't look absurdly huge in the viewport.
In the future that could be an option.

For the implementation, one thing that could use an improvement
is the amount of temporary allocations while resampling to evaluated
points before the final points. I expect that reusing a buffer for
each thread would give a nice improvement.

Differential Revision: https://developer.blender.org/D11539
2021-06-21 20:01:36 +05:30
c1629868c5 Fix Build Warning
Marking unused function argument.

Introduced in bcff0ef9ca

Differential Revision: https://developer.blender.org/D10887
2021-06-21 20:01:36 +05:30
136393265d UI: Windows Blend File Association
This patch allows Windows users to specify that their current blender
installation should be used to create thumbnails and be associated
with ".blend" files. This is done from Preferences / System. The only
way to do this currently is from the command-line and this is sometimes
inconvenient.

Differential Revision: https://developer.blender.org/D10887

Reviewed by Brecht Van Lommel
2021-06-21 20:01:36 +05:30
02a567434d Fix: VSE seeking with proxy strips would fail on certain frames
If the last decoded frame had the same timestamp as the GOP current
packet, then we would skip over this frame when fast forwarding and we
would seek until the end of the file.

This would could only be triggered reliably in single threaded mode.

Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D11601
2021-06-21 20:01:36 +05:30
dc5304a726 Fix possible C-linkage warning on Clang
The warning would appear when using the `ENUM_OPERATORS()` macro inside
of an `extern "C"` block.
Didn't cause a warning in master currently, but in the
`asset-browser-poselib` branch.

After macro expansion, there would be C++ code in code with C linkage
(`extern "C"`). So make sure the expanded C++ code always uses C++
linkage.
The syntax used is totally C++ compliant: the C++ standard requires that
in such nested linkage specifications, the innermost one determines the
linking language (e.g. see
https://timsong-cpp.github.io/cppwp/n4659/dcl.link#4).
2021-06-21 20:01:36 +05:30
d3921f6b3c Error Messages Creating Thumbnail Folders
On the Windows platform there will be some errors printed to the
console if the user's thumbnail cache folder doesn't already exist.
While creating those folders there is an attempt to do so multiple
times and so we get errors when trying to create when exists. This
is caused by paths that have hard-coded forward slashes, which causes
our path processing routines to not work correctly. This patch defines
those paths using platform-varying separator characters.

Differential Revision: https://developer.blender.org/D11505

Reviewed by Brecht Van Lommel
2021-06-21 20:01:36 +05:30
ae81fe6391 Cleanup: rename id to owner_id for python id properties
This is consistent with the naming in `PointerRNA`.
2021-06-21 20:01:36 +05:30
697d1c756a PyAPI: remove deprecated bpy.app.binary_path_python 2021-06-21 20:01:36 +05:30
eeceb82285 BMesh: support face-normal calculation in normal & looptri functions
Support calculating face normals when tessellating. When this is done
before updating vertex normals it gives ~20% performance improvement.

Now vertex normal calculation only needs to perform a single pass on the
mesh vertices when called after tessellation.

Extended versions of normal & looptri update functions have been added:

- BM_mesh_calc_tessellation_ex
- BM_mesh_normals_update_ex

Most callers don't need to be aware of this detail by using:

- BKE_editmesh_looptri_and_normals_calc
- BKE_editmesh_looptri_and_normals_calc_with_partial

- EDBM_update also takes advantage of this,
  where calling EDBM_update with calc_looptri & calc_normals
  enabled uses the faster normal updating logic.
2021-06-21 20:01:35 +05:30
b7a928f76e BMesh: remove unit-length edge-vector cache from normal calculation
Bypass stored edge-vectors for ~16% performance gains.

While this increases unit-length edge-vector calculations by around ~4x
the overhead of a parallel loop over all edges makes it worthwhile.

Note that caching edge-vectors per-vertex performs better and may be
worth investigating further, although in my tests this increases code
complexity with barley measurable benefits over not using cache at all.

Details about performance and possible optimizations are noted in
bm_vert_calc_normals_impl.
2021-06-21 20:01:35 +05:30
e5a931b5bb Edit Mesh: use params arg for update function, add calc_normals arg
Rename function EDBM_update_generic to EDBM_update, use a parameters
argument for better readability.

Also add calc_normals argument, which will have benefits when
calculating normals and tessellation together is optimized.
2021-06-21 20:01:35 +05:30
7eeb3e014a Cleanup: clang-format 2021-06-21 20:01:35 +05:30
Thomas Lachmann
600ed4e99b Python API: option for render engines to disable image file saving
For some custom rendering engines it's advantageous not to write the image files to disk.
An example would be a network rendering engine which does it's own image writing.

This feature is only supported when bl_use_postprocess is also disabled, since render
engines can't influence the saving behavior of the sequencer or compositor.

Differential Revision: https://developer.blender.org/D11512
2021-06-21 20:01:35 +05:30
10099e5aca Fix build error in release builds after recent changes 2021-06-21 20:01:35 +05:30
feb8e633dc BLI_math: Cleanup: Use mul_/madd_ functions.
Better to avoid explicit vectors components direct manipulation when a
generic operation for whole vector exists, if nothing else it avoids
potential mistakes in indices.
2021-06-21 20:01:35 +05:30
d7b2cd6d50 BLI_math: Fix several division-by-zero cases.
Those were caused by various tools used on degenerate geometry, see
T79775.

Note that fixes are as low-level as possible, to ensure they cover as
much as possible of unreported issues too.

We still probably have many more of those hidden in BLI_math though.
2021-06-21 20:01:35 +05:30
Leon Zandman
28d568c8e8 Fix T87867: file open dialog triggers OneDrive file downloads on macOS
Until OneDrive supports macOS's native placeholder file implementation, detect
the com.microsoft.OneDrive.RecallOnOpen extended file attribute.

Differential Revision: https://developer.blender.org/D11466
2021-06-21 20:01:35 +05:30
4d521bc997 Fix T88494: add missing depsgraph relation update tags
Adding e.g. a Collection Info node creates a new depsgraph relation.
Therefore the relations should be updated.
2021-06-21 20:01:35 +05:30
818d717830 Fix T88947: invalid normals when converting point cloud to mesh 2021-06-21 20:01:35 +05:30
Campbell Barton
4857addf01 Nodes: remove redundant increment node tree current socket index
`ntree->cur_index` was being incremented twice in make_socket_interface.

Reviewed By: JacquesLucke

Ref D11590
2021-06-21 20:01:34 +05:30
cb9a24a216 Fix T88807: crash when there are multiple links between the same sockets
This commit does two things:

* Disallows creating more than one link from one socket to a multi socket input.
* Properly count links if there happen to be more than one link between the same sockets.

The new link counting should also be more efficient asymptotically.

Differential Revision: https://developer.blender.org/D11570
2021-06-21 20:01:34 +05:30
74292e2dc5 Cleanup: Reduce indentation from redundant check 2021-06-21 20:01:34 +05:30
63b0e8bf5c Cleanup: Order return argument last 2021-06-21 20:01:34 +05:30
36be7e234f Fix libmv new[]/delete[] mismatch 2021-06-21 20:01:34 +05:30
298b798aa5 Cleanup: allocation size mismatch warning
While harmless, use fixed size int type for pixel data.
2021-06-21 20:01:34 +05:30
54d4bcd714 Cleanup: rename 'unsigned int' -> 'uint' 2021-06-21 20:01:34 +05:30
69b98cdd84 Cleanup: redundant initialization
These were limited to obvious cases. Some less obvious cases
were kept as refactoring might make them necessary in future.
2021-06-21 20:01:34 +05:30
4d811ef027 Cleanup: use ATTR_RETURNS_NONNULL function attribute 2021-06-21 20:01:34 +05:30
611e093841 Cleanup: use return arg prefix for ED_object_add_generic_get_opts 2021-06-21 20:01:34 +05:30
cce19a40a6 Cleanup: avoid the possibility of 'enter_editmode' being left unset
While in practice this isn't an issue currently, always set
'enter_editmode' in ED_object_add_generic_get_opts
to avoid problems in the future.
2021-06-21 20:01:34 +05:30
f7622be8e1 Cleanup: misleading return argument for hair_create_input_mesh
- The argument with named with an `r_` prefix when it was in fact
  also read from.
- The argument passed in had to be 'psys->clmd->hairdata',
  if it was not - the function would not worked.
2021-06-21 20:01:33 +05:30
11956f5f41 Cleanup: remove redundant NULL check, reduce scope 2021-06-21 20:01:33 +05:30
0b4afeb5f6 Cleanup: missing include 2021-06-21 20:01:33 +05:30
6959f3eacd Fix modifier deform by armature check ignoring virtual modifiers
Regression in f00cb93dbe (fix for T63125)
2021-06-21 20:01:33 +05:30
fe834ed539 Fix missing directory in CMakeLists.txt 2021-06-21 20:01:33 +05:30
0227fbd9c8 Fix T88515: Cycles does not update light transform from linked collections
When moving a linked collection, we seem to only receive a depsgraph update
for an empty object so the Blender synchronization cannot discriminate it
and tag the object(s) (light or geometry) for an update through
id_map.set_recalc.

This missing transform update only affects lights since we do not check
manually if the transformations were modified like we do for objects.

To fix this, add a check to see if the transformation is different provided
that a light was already created.

Reviewed By: brecht

Maniphest Tasks: T88515

Differential Revision: https://developer.blender.org/D11574
2021-06-21 20:01:33 +05:30
ca0ef3d03f Fix T88812: Child Windows on Vertical Monitors
This patch improves the positioning of child windows when on monitors
that are arranged vertically (any above any other). When calculating a
window position in Ghost coordinates from GL coordinates we were using
monitor height, which can give incorrect values when desktop is taller
than any single monitor. So use desktop height instead.

See D10637 for more details and examples.

Differential Revision: https://developer.blender.org/D10637

Reviewed by Brecht Van Lommel
2021-06-21 20:01:33 +05:30
4e7757b9a7 Render Window as Non-Child on Win32 platform
This patch makes the "Render" window a top-level window, not a child of
the main window, which was the case in blender versions prior to 2.93.
This means it is no longer "on top", nor is the icon grouped on the
taskbar in the same way, but you can Alt-Tab between it and the main
window. This change only affects the Windows platform as the other
platforms behave this way.

See D11576 for links to negative feedback that prompts this change.

Differential Revision: https://developer.blender.org/D11576

Reviewed by Brecht Van Lommel
2021-06-21 20:01:33 +05:30
Pablo Dobarro
e2d9277e14 Overlays: Make flash on mode transfer an operator property
This moves the flash on mode transfer effect option from the overlays to
an operator property of the mode transfer operator.

- This effect is intended to show the target object when no overlays or
a minimal set of overlays is enabled. Making it part of the whole set of
overlays invalidates this use case.

- The effect is not intended to be configurable per viewport, it should
be a global option.

The effect is still implemented using the overlay engine (instead of a
draw modal callback) due to performance and drawing artifacts. Having it
implemented as an overlay with runtime timer data in the objects makes
also possible to run multiple animations at the same time without any
visual glitches.

Reviewed By: campbellbarton, JulienKaspar

Differential Revision: https://developer.blender.org/D11519
2021-06-21 20:01:33 +05:30
4bb90c2b9d Add option to link assets on drag & drop
Note: Linking in this case as in link vs. append. Easily confused with linking
a data-block to multiple usages (e.g. single material used by multiple
objects).

Adds a drop-down to the Asset Browser header to choose between Link and Append.
This is probably gonna be a temporary place, T54642 shows where this could be
placed eventually.

Linking support is crucial for usage of the asset browser in production
environments. It just wasn't enabled yet because a) the asset project currently
focuses on single user, not production assets, and b) because there were many
unkowns still for the workflow that have big impact on production use as well.
With the recently held asset workshop I'm more confident with enabling linking,
as design ideas relevant to production use were confirmed.

Differential Revision: https://developer.blender.org/D11536

Reviewed by: Bastien Montagne
2021-06-21 20:01:33 +05:30
c3f71243ff Fix object assets getting duplicated after dropping
The operator run when dropping objects would duplicate the dropped object and
place that in the scene, even though that was just appended. Addressed by
making the duplication optional for the operator. If the duplication is not
requested, the object is just added to the scene (if needed), repositioned
based on the drop location and selected (deselecting other objects).
This makes the operator work as expected when using it to drop assets.

Reviewed as part of https://developer.blender.org/D11536.

Reviewed by: Bastien Montagne
2021-06-21 20:01:33 +05:30
6d9e72c4c3 Fix T89001: node search not working anymore 2021-06-21 20:01:33 +05:30
Maxime Casas
e4d07c9ba9 Fix T89033: segfault reordering animation channels
Fix segmentation fault that can occur when reordering animation
channels.

Under some specific conditions, the list "act->curves" is empty in the
"join_groups_action_temp" function. In particular, this happens when a
scene contains an action that has not been pushed down, and with no
keyframe in it.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D11569
2021-06-21 20:01:32 +05:30
db805dee2c Nodes: cache socket identifier to index mapping
While this preprocessing does take some time upfront,
it avoids longer lookup later on, especially as nodes get
more sockets.

It's probably possible to make this more efficient in some cases
but this is good enough for now.
2021-06-21 20:01:32 +05:30
Jeroen Bakker
ab073f87b0 Performance: Use parallel range for ImBuf scanline processor.
Scanline processor did its own heurestic what didn't scale well when
having a multiple cores. In stead of using our own code this patch will
leave it to TBB to determine how to split the scanlines over the
available threads.

Performance of the IMB_transform before this change was 0.002123s, with
this change 0.001601s. This change increases performance in other areas
as well including color management conversions.

Reviewed By: zeddb

Differential Revision: https://developer.blender.org/D11578
2021-06-21 20:01:32 +05:30
Jeroen Bakker
d0212bd8a0 Sequencer: Do not redraw during playback.
When using large sequences including audio the drawing of the audio on
top of the strip takes a lot of time. This effects the playback
performance heavily.

During the animation playback performance there was a solution for this
by only drawing the playhead overlay. This was reverted for the sequence
editor as it didn't update the color strips when they were animated.

This patch checks if there are animated color strips if so the full
screen is redrawn, otherwise only the playhead is redrawn.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D11580
2021-06-21 20:01:32 +05:30
1e1dc1ff54 Refactor: use 'BLI_task_parallel_range' in Draw Cache
One drawback to trying to predict the number of threads that will be
used in the `task_graph` is that we are only sure of the number when the
threads are running.

Using `BLI_task_parallel_range` allows the driver to
choose the best thread distribution through `parallel_reduce`.

The benefit is most evident on hardware with fewer cores.

This is the result on an 4-core laptop:
||before:|after:
|---|---|---|
|large_mesh_editing:|Average: 5.203638 FPS|Average: 5.398925 FPS
||rdata 15ms iter 43ms (frame 193ms)|rdata 14ms iter 36ms (frame 187ms)

Differential Revision: https://developer.blender.org/D11558
2021-06-21 20:01:32 +05:30
Germano Cavalcante
141e5f11c1 Refactor: Draw Cache: use 'BLI_task_parallel_range'
This is an adaptation of {D11488}.

A disadvantage of manually setting the iter ranges per thread is that
we don't know how many threads are running in the background and so we
don't know how to best distribute the ranges.

To solve this limitation we can use `parallel_reduce` and thus let the
driver choose the best distribution of ranges among the threads.

This proved to be especially beneficial for computers with few cores.

**Benchmarking:**
Here's the result on an 4-core laptop:
||master:|PATCH:
|---|---|---|
|large_mesh_editing:|Average: 5.203638 FPS|Average: 5.398925 FPS
||rdata 15ms iter 43ms (frame 193ms)|rdata 14ms iter 36ms (frame 187ms)

Here's the result on an 8-core PC:
||master:|PATCH:
|---|---|---|
|large_mesh_editing:|Average: 15.267482 FPS|Average: 15.906881 FPS
||rdata 9ms iter 28ms (frame 65ms)|rdata 9ms iter 25ms (frame 63ms)
|large_mesh_editing_ledge: |Average: 15.145966 FPS|Average: 15.520474 FPS
||rdata 9ms iter 29ms (frame 65ms)|rdata 9ms iter 25ms (frame 64ms)
|looptris_test:|Average: 4.001917 FPS|Average: 4.061105 FPS
||rdata 12ms iter 90ms (frame 236ms)|rdata 12ms iter 87ms (frame 230ms)
|subdiv_mesh_cage_and_final:|Average: 1.917769 FPS|Average: 1.971790 FPS
||rdata 7ms iter 37ms (frame 261ms)|rdata 7ms iter 31ms (frame 258ms)
||rdata 7ms iter 38ms (frame 252ms)|rdata 7ms iter 33ms (frame 249ms)
|subdiv_mesh_final_only:|Average: 6.387240 FPS|Average: 6.591251 FPS
||rdata 3ms iter 25ms (frame 151ms)|rdata 3ms iter 16ms (frame 145ms)
|subdiv_mesh_final_only_ledge:|Average: 6.247393 FPS|Average: 6.596024 FPS
||rdata 3ms iter 26ms (frame 158ms)|rdata 3ms iter 16ms (frame 148ms)

**Notes:**
- The improvement can only be noticed if all extracts are multithreaded.
- This patch touches different areas of the code, so it can be split into another patch if the idea is accepted.

These screenshots show how threads behave in a quadcore:
Master:
{F10164664}
Patch:
{F10164666}

Differential Revision: https://developer.blender.org/D11558
2021-06-21 20:01:32 +05:30
7a8d0990a9 Nodes: add utilities to check if there are undefined nodes/sockets 2021-06-21 20:01:32 +05:30
064834d6b8 Fix: VSE search in mpegts files would fail
ffmpeg_generic_seek_workaround did work properly and our start pts
calculation was wrong.

Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D11562
2021-06-21 20:01:32 +05:30
837cfd40dd Fix: VSE indexer seeking not working correctly
Because of the added sanity checks in rB14508ef100c9 (D11492), seeking
in proxies would not work correctly any more. This is because it wasn't
working as intended before, but in most cases this wouldn't be
noticeable. However now when the sanity checks are tripped it is very
noticeable that something is wrong

The indexer tried to use dts values for time stamps when we used pts in
our decode functions to get the time positions. This would make it
start in the wrong GOP frames when searching. Now that we enforce no
crossing of GOP frames when decoding after seek, this would lead to
issues.

Now we correctly use pts (or dts if pts is not available) and thus we
don't have any seeking issues because of time stamp format missmatch.

Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D11561
2021-06-21 20:01:32 +05:30
c8d33e30a7 Fix: VSE timecodes being used even when turned off.
Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D11567
2021-06-21 20:01:32 +05:30
e951aa1ff3 LineArt: Fix crash due to empty duplicollection. 2021-06-21 20:01:31 +05:30
84bbcc84b4 Performance: Split ImBuf sampling.
When sampling ImBuf can be a char or a float buffer. Current sampling
functions added overhead by checking which kind of buffer was passed
every pixel that was sampled. When performing image processing this
check can be removed outside the inner loop adding 5% of performance
increase in the `IMB_transform` operator.
2021-06-21 20:01:31 +05:30
Xing Liu
a80126fa91 Fix T88068: Alt+I now respects keying set
Remap {key Alt I} from `anim.delete_key_v3d` to `anim.delete_key`. This
makes it keyframe removal symmetrical with keyframe insertion ({key I}).

Both the default keymap {key Alt I} and the Industry Compatible keymap
{key Alt S} have been updated.

Reviewed By: sybren, #animation_rigging

Maniphest Tasks: T88068

Differential Revision: https://developer.blender.org/D11528
2021-06-21 20:01:31 +05:30
Jeroen Bakker
a884617e93 Sequencer: Transform ImBuf Processor.
Inside the sequencer the cropping and transform of images/buffers were
implemented locally. This reduced the optimizations that a compiler
could do and added confusing code styles. This patch adds
`IMB_transform` to reduce the confusion and increases compiler
optimizations as more code can be inlined and we can keep track of
indices inside the inner loop.

This increases end-user performance by 30% when playing back aa video
in VSE.

Reviewed By: ISS, zeddb

Differential Revision: https://developer.blender.org/D11549
2021-06-21 20:01:31 +05:30
9817f05c5a Cleanup: use sentences for pose slide comments 2021-06-21 20:01:31 +05:30
Christoph Lendenfeld
d14359079b Cleanup: pose slider rename region to region_header
Reviewed By: sybren, campbellbarton

Ref D11365
2021-06-21 20:01:31 +05:30
Christoph Lendenfeld
f07e779565 Cleanup: pose slider use enum types
use enum types in `tPoseSlideOp` instead of `short`

Reviewed By: sybren, campbellbarton

Ref D11364
2021-06-21 20:01:31 +05:30
Christoph Lendenfeld
f4ff2359a5 Cleanup: pose slider use strncpy
use `STRNCPY` instead of `BLI_strncpy`

Reviewed By: sybren, campbellbarton

Ref D11363
2021-06-21 20:01:31 +05:30
Christoph Lendenfeld
cfd9e0b749 Cleanup: pose slider data types
- change vec2f to float[2]
- pass rctf as pointer
- change `const struct rctf` to `const rctf`
2021-06-21 20:01:31 +05:30
Christoph Lendenfeld
442939996a Cleanup: pose slider rename "percentage" to "factor"
This patch changes occurrences of percentage to factor.

There are some usages of percentage left in there on purpose.
They are distinguished as follows:

- factor is 0-1 float
- percentage is 0-100 int

Ref D11361

Reviewed by: sybren, campbellbarton
2021-06-21 20:01:31 +05:30
Charlie Jolly
c7f09a7fe0 Nodes: move mix rgb node to C++
Prepare node for conversion to Geometry Nodes.

There should be no functional changes.

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D11506
2021-06-21 20:01:31 +05:30
bb217a4032 UI: Correct label naming mistake for VSE text strip box background
Seems to be a copy/paste error from 
rB235c309e5f86e84fb08e1ff2c5c11eb0b775c388
2021-06-21 20:01:31 +05:30
5e3e526277 deps/windows: add missing tbbmalloc_debug.lib
This file is being linked by blender without
it existing causing issues for debug builds.
2021-06-21 20:01:30 +05:30
2b3e862602 Fix T86544: better cleanup of path given as command line argument.
When using non-default system separator in filename path, code would end up
with an absolute path mixing regular and alternative separator,
confusing the rest of the path manipulations later on.

So this commit add proper replacements of alternative separators, and
path normalization.
2021-06-21 20:01:30 +05:30
e57fa92f64 Cleanup: BLI_path_slash_native: use separator defines instead of literal values.
Even though this function is alredy using system-specific code, it's
still cleaner to use `SEP` and `ALTSEP` here.
2021-06-21 20:01:30 +05:30
e66b81e5eb Fix T88578: crash when loading value from group output node
It remembered the wrong origin socket and couldn't find the value
anymore later on.
2021-06-21 20:01:30 +05:30
Eitan
3525380da4 Geometry Nodes: Add Texture and Material options to switch node
These new socket types can be supported in the switch node
along with the others.

Differential Revision: https://developer.blender.org/D11560
2021-06-21 20:01:30 +05:30
ade595850a BLI_mempool: split thread-safe iteration into the private API
Splitting out thread safe iteration logic means regular iteration
isn't checking for the thread-safe pointer each step.

This gives a small but measurable overall performance gain of 2-3%
when redrawing a high-poly mesh.

Ref D11564

Reviewed By: mont29
2021-06-21 20:01:30 +05:30
68a7f9bbd0 Fix: Build error with MSVC
rB4f81b4b4ce29 mistakenly left out the changes
to platform_win32.cmake causing a linker error
when WITH_GMP and WITH_TBB_MALLOC_PROXY were on.
2021-06-21 20:01:30 +05:30
19a72a8509 Docs: remove deprecated parameter from bmesh docs
The perimeter itself was removed but the documentation wasn't updated.

Resolves T89013
2021-06-21 20:01:30 +05:30
7c91a434f5 Cleanup: move endian values from BKE_global into BLI_endian_defines
This change was prompted by D6408 which moves thumbnail extraction into
a shared function that happens use these endian defines but only links
blenlib.

There is no need for these defines to be associated with globals
so move into their own header.
2021-06-21 20:01:30 +05:30
3f8bbe432e Cleanup: add comment 2021-06-21 20:01:30 +05:30
12a7ee47e9 Add unit for time stored in seconds
Allows to define properties which will have proper units displayed
in the interface. The internal storage is expected to be seconds
(which matches how other times are stored in Blender).

Is not immediately used in Blender, but is required for the upcoming
feature in Cycles X (D11526)

The naming does not sound very exciting, but can't think of anything
better either.

For test it probably easiest to define FloatProperty with subdtype
of TIME_ABSOLUTE.

Differential Revision: https://developer.blender.org/D11532
2021-06-21 20:01:30 +05:30
96a9a31492 DataTransfer: Fix vertices being wrongly added to vgroup.
Previously, a vertex from destination mesh would always be added to all
transferred vgroup (with a 0.0 weight), even if none of its matching
sources in source mesh belonged to the matching source vgroups.

Now a destination vertex is only added to a given destination vgroup if
at least one of its source vertices belong to the matching source
vgroup.

Issue found and initial investigation by @pls in D11524, thanks!
2021-06-21 20:01:30 +05:30
d25bf675b3 Cleanup: spelling in comments 2021-06-21 20:01:29 +05:30
d39d87e6c1 Cleanup: quiet array-parameter warning from GCC11 2021-06-21 20:01:29 +05:30
2ce3352089 Docs: update oxygen configuration to v1.9.1 2021-06-21 20:01:29 +05:30
33f5892b2e Docs: Add preprocessor define for doxygen
Doxygen by default leaves out any functions inside
#ifdef blocks that it thinks are disabled.

This change adds a DOXYGEN symbol, so you can
still get the functions included in the
documentation even if the #ifdef would
have normally excluded them.

before

#if defined(_WIN32)

after

#if defined(_WIN32) || defined(DOXYGEN)

Patch provided by Campbell Barton on chat.
2021-06-21 20:01:29 +05:30
Erik Abrahamsson
258fc990f7 Windows: Use TBBMalloc for GMP
TBBmalloc_proxy already takes care of any allocations
being done from MSVC compiled code, some of the dependencies
like GMP cannot be build with MSVC and we have to use
mingw to build them. mingw however links against the older
msvcrt.dll for its allocation needs, which TBBMallocProxy
does not hook.

GMP has an option to supply your own allocation functions
so we can still manually redirect them to TBBMalloc.

In a test-file with a boolean geometry node, this patch
uses 32s effective CPU time compared to 52s before.

Differential Revision: https://developer.blender.org/D11435

Reviewed by Campbell Barton, Ray Molenkamp
2021-06-21 20:01:29 +05:30
d3775a02b1 Fix: Point translate and point scale don't execute on curve data 2021-06-21 20:01:29 +05:30
Christoph Lendenfeld
8854a64a78 Fix T88546: Pose slider typed input not working
Remove an unnecessary call to pose_slide_mouse_update_percentage
That call was overriding the typed value

Reviewed By: #animation_rigging, Sybren A. Stüvel

Differential Revision:  https://developer.blender.org/D11395

Ref D11395
2021-06-21 20:01:29 +05:30
d58ed42f6c Geometry Nodes: Copy spline attributes in the curve resample node
Previously only point domain attributes were copied to the result curve.
2021-06-21 20:01:29 +05:30
0d5b517b91 Fix T88799: 3DViewport Stats Column Measurements
To draw the overlay stats in columns the strings must be measured to
find the longest one. In some circumstances this measurement can be
incorrect. We draw the text with a specific size yet do not explicitly
set the size before calling BLF_size. This patch properly sets the size
so that the measurement will match what will be used for output.

See T88799 for examples of measurement failure.

Differential Revision: https://developer.blender.org/D11504

Reviewed by Hans Goudey
2021-06-21 20:01:29 +05:30
e305daeebd Splines: Add API functions for interpolating data
First, expand on the interpolation to evaluated points with a templated
helper function, and a function that takes a GSPan. Next, add a set of
functions to `Spline` for interpolating at arbitrary intervals between
the evaluated points. The code for doing that isn't that complicated
anyway, but it's nice to avoid repeating, and it might make it easier
to unroll the special cases for the first and last points if we require
the index factors to be sorted.
2021-06-21 20:01:29 +05:30
Henrik Dick
fc7b625d84 Geometry Nodes: Add Convex Hull Node
This commit adds a node to output the convex hull of any input geometry
as a mesh, which is an enclosing geometry around a set of points.
All geometry types are supported, besides volumes.

The code supports operating on instances to avoid copying all input
geometry before the operation. The implementation uses the same backend
as the operation in edit mode, but uses Mesh directly instead of BMesh.

Attribute transfer is not supported currently, but would be a point of
improvement for the future if it can work in a predictable way on
different geometry input types.

Differential Revision: https://developer.blender.org/D10925
2021-06-21 20:01:29 +05:30
dilithjay
5846dad216 Exposed 2 functions in editcurve.c and used in curve pen 2021-06-21 12:14:44 +05:30
dilithjay
efc9cb67b7 Changed data initialization to fix warning 2021-06-20 21:20:05 +05:30
dilithjay
0208c836e3 Cleanup: Addressed several build warnings and style guide issues 2021-06-19 19:25:53 +05:30
dilithjay
30c5849c8b Fixed bug where the mouse stops tracking handles 2021-06-18 23:13:14 +05:30
dilithjay
5eace12ac0 Added modal keymaps 2021-06-16 23:05:23 +05:30
dilithjay
2c50c6fd0d Cleanup: Refactoring 2021-06-16 19:46:57 +05:30
dilithjay
2a05e37244 Cleanup: Refactoring delete control point code 2021-06-15 11:48:01 +05:30
dilithjay
3ddb617c95 Cleanup: Refactoring 2021-06-15 00:00:24 +05:30
dilithjay
5013388581 Cleanup: Removed print statements used for debugging 2021-06-14 08:26:55 +05:30
dilithjay
906ff97520 Renamed file from editcurve_tool.c to editcurve_pen.c 2021-06-14 08:11:56 +05:30
dilithjay
4e6bd046d5 Renamed tool from edit tool to pen tool 2021-06-13 20:54:50 +05:30
dilithjay
4174fe540f Cleanup: Minor refactoring 2021-06-12 12:02:08 +05:30
dilithjay
d8fe0d04ff Clean up: Refactored and commented 2021-06-09 23:52:18 +05:30
17 changed files with 2078 additions and 74 deletions

View File

@@ -205,6 +205,7 @@ ForEachMacros:
- FOREACH_SCENE_COLLECTION_BEGIN
- FOREACH_SCENE_OBJECT_BEGIN
- FOREACH_SELECTED_BASE_BEGIN
- FOREACH_SELECTED_BEZT_BEGIN
- FOREACH_SELECTED_EDITABLE_OBJECT_BEGIN
- FOREACH_SELECTED_OBJECT_BEGIN
- FOREACH_TRANS_DATA_CONTAINER

Binary file not shown.

View File

@@ -100,6 +100,7 @@ _km_hierarchy = [
('Paint Stroke Modal', 'EMPTY', 'WINDOW', []),
('Sculpt Expand Modal', 'EMPTY', 'WINDOW', []),
('Paint Curve', 'EMPTY', 'WINDOW', []),
('Curve Pen Modal Map', 'EMPTY', 'WINDOW', []),
('Object Non-modal', 'EMPTY', 'WINDOW', []), # mode change

View File

@@ -6158,6 +6158,25 @@ def km_sculpt_expand_modal(_params):
return keymap
def km_curve_pen_modal_map(_params):
items = []
keymap = (
"Curve Pen Modal Map",
{"space_type": 'EMPTY', "region_type": 'WINDOW', "modal": True},
{"items": items},
)
items.extend([
("FREE_ALIGN_TOGGLE", {"type": 'LEFT_SHIFT', "value": 'ANY', "any": True}, None),
("MOVE_ADJACENT", {"type": 'LEFT_CTRL', "value": 'ANY', "any": True}, None),
("MOVE_ENTIRE", {"type": 'SPACE', "value": 'ANY', "any": True}, None),
("LOCK_ANGLE", {"type": 'LEFT_ALT', "value": 'ANY', "any": True}, None),
("LINK_HANDLES", {"type": 'RIGHT_CTRL', "value": 'PRESS', "any": True}, None),
])
return keymap
# Fallback for gizmos that don't have custom a custom key-map.
def km_generic_gizmo(_params):
keymap = (
@@ -7078,6 +7097,27 @@ def km_3d_view_tool_edit_curve_draw(params):
)
def km_3d_view_tool_edit_curve_pen(params):
return (
"3D View Tool: Edit Curve, Curve Pen",
{"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
{"items": [
("curve.pen", {"type": params.tool_mouse, "value": 'PRESS'},
{"properties": [
("extrude_point", True),
("move_segment", True),
("select_point", True),
("move_point", True),
("close_spline_method", "ON_CLICK"),
]}),
("curve.pen", {"type": params.tool_mouse, "value": 'PRESS', "ctrl": True},
{"properties": [("insert_point", True), ("delete_point", True)]}),
("curve.pen", {"type": params.tool_mouse, "value": 'DOUBLE_CLICK'},
{"properties": [("toggle_vector", True), ("cycle_handle_type", True),]}),
]},
)
def km_3d_view_tool_edit_curve_tilt(params):
return (
"3D View Tool: Edit Curve, Tilt",
@@ -7882,6 +7922,7 @@ def generate_keymaps(params=None):
km_view3d_dolly_modal(params),
km_paint_stroke_modal(params),
km_sculpt_expand_modal(params),
km_curve_pen_modal_map(params),
# Gizmos.
km_generic_gizmo(params),
@@ -7960,6 +8001,7 @@ def generate_keymaps(params=None):
km_3d_view_tool_edit_mesh_rip_region(params),
km_3d_view_tool_edit_mesh_rip_edge(params),
km_3d_view_tool_edit_curve_draw(params),
km_3d_view_tool_edit_curve_pen(params),
km_3d_view_tool_edit_curve_radius(params),
km_3d_view_tool_edit_curve_tilt(params),
km_3d_view_tool_edit_curve_randomize(params),

View File

@@ -1201,6 +1201,22 @@ class _defs_edit_curve:
keymap=(),
)
@ToolDef.from_fn
def pen():
def draw_settings(_context, layout, tool):
props = tool.operator_properties("curve.pen")
layout.prop(props, "close_spline")
layout.prop(props, "extrude_handle")
return dict(
idname="builtin.pen",
label="Curve Pen",
cursor='CROSSHAIR',
icon="ops.curve.pen",
widget=None,
keymap=(),
draw_settings=draw_settings,
)
@ToolDef.from_fn
def tilt():
return dict(
@@ -2881,6 +2897,7 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel):
*_tools_default,
None,
_defs_edit_curve.draw,
_defs_edit_curve.pen,
(
_defs_edit_curve.extrude,
_defs_edit_curve.extrude_cursor,

View File

@@ -25,6 +25,7 @@ set(SRC
editcurve_paint.c
editcurve_query.c
editcurve_select.c
editcurve_pen.c
editcurve_undo.c
editfont.c
editfont_undo.c

View File

@@ -131,6 +131,16 @@ void CURVE_OT_match_texture_space(struct wmOperatorType *ot);
struct GHash *ED_curve_keyindex_hash_duplicate(struct GHash *keyindex);
void ED_curve_keyindex_update_nurb(struct EditNurb *editnurb, struct Nurb *nu, struct Nurb *newnu);
/* exported for editcurve_pen.c */
int ed_editcurve_addvert(Curve *cu, EditNurb *editnurb, View3D *v3d, const float location_init[3]);
bool curve_toggle_cyclic(View3D *v3d, ListBase *editnurb, int direction);
void ed_dissolve_bez_segment(BezTriple *bezt_prev,
BezTriple *bezt_next,
const Nurb *nu,
const Curve *cu,
const int span_len,
const int span_step[2]);
/* helper functions */
void ed_editnurb_translate_flag(struct ListBase *editnurb,
uint8_t flag,
@@ -189,8 +199,23 @@ bool ED_curve_pick_vert(struct ViewContext *vc,
struct BPoint **r_bp,
short *r_handle,
struct Base **r_base);
/**
* \param sel_dist_mul: A multiplier on the default select distance.
*/
bool ED_curve_pick_vert_ex(struct ViewContext *vc,
short sel,
float dist_px,
struct Nurb **r_nurb,
struct BezTriple **r_bezt,
struct BPoint **r_bp,
short *r_handle,
struct Base **r_base);
void ED_curve_nurb_vert_selected_find(
Curve *cu, View3D *v3d, Nurb **r_nu, BezTriple **r_bezt, BPoint **r_bp);
/* editcurve_paint.c */
void CURVE_OT_draw(struct wmOperatorType *ot);
/* editcurve_pen.c */
void CURVE_OT_pen(struct wmOperatorType *ot);
struct wmKeyMap *curve_pen_modal_keymap(struct wmKeyConfig *keyconf);

View File

@@ -111,6 +111,7 @@ void ED_operatortypes_curve(void)
WM_operatortype_append(CURVE_OT_spin);
WM_operatortype_append(CURVE_OT_vertex_add);
WM_operatortype_append(CURVE_OT_draw);
WM_operatortype_append(CURVE_OT_pen);
WM_operatortype_append(CURVE_OT_extrude);
WM_operatortype_append(CURVE_OT_cyclic_toggle);
@@ -150,4 +151,6 @@ void ED_keymap_curve(wmKeyConfig *keyconf)
/* only set in editmode curve, by space_view3d listener */
keymap = WM_keymap_ensure(keyconf, "Curve", 0, 0);
keymap->poll = ED_operator_editsurfcurve;
curve_pen_modal_keymap(keyconf);
}

View File

@@ -4726,6 +4726,14 @@ void CURVE_OT_make_segment(wmOperatorType *ot)
bool ED_curve_editnurb_select_pick(bContext *C,
const int mval[2],
const struct SelectPick_Params *params)
{
return ED_curve_editnurb_select_pick_ex(C, mval, 1.0f, params);
}
bool ED_curve_editnurb_select_pick_ex(bContext *C,
const int mval[2],
const float sel_dist_mul,
const struct SelectPick_Params *params)
{
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ViewContext vc;
@@ -4740,7 +4748,8 @@ bool ED_curve_editnurb_select_pick(bContext *C,
ED_view3d_viewcontext_init(C, &vc, depsgraph);
copy_v2_v2_int(vc.mval, mval);
bool found = ED_curve_pick_vert(&vc, 1, &nu, &bezt, &bp, &hand, &basact);
bool found = ED_curve_pick_vert_ex(
&vc, 1, sel_dist_mul * ED_view3d_select_dist_px(), &nu, &bezt, &bp, &hand, &basact);
if (params->sel_op == SEL_OP_SET) {
if ((found && params->select_passthrough) &&
@@ -5344,10 +5353,7 @@ static bool ed_editcurve_extrude(Curve *cu, EditNurb *editnurb, View3D *v3d)
/** \name Add Vertex Operator
* \{ */
static int ed_editcurve_addvert(Curve *cu,
EditNurb *editnurb,
View3D *v3d,
const float location_init[3])
int ed_editcurve_addvert(Curve *cu, EditNurb *editnurb, View3D *v3d, const float location_init[3])
{
float center[3];
float temp[3];
@@ -5719,7 +5725,7 @@ void CURVE_OT_extrude(wmOperatorType *ot)
/** \name Make Cyclic Operator
* \{ */
static bool curve_toggle_cyclic(View3D *v3d, ListBase *editnurb, int direction)
bool curve_toggle_cyclic(View3D *v3d, ListBase *editnurb, int direction)
{
BezTriple *bezt;
BPoint *bp;
@@ -6502,6 +6508,70 @@ static bool test_bezt_is_sel_any(const void *bezt_v, void *user_data)
return BEZT_ISSEL_ANY_HIDDENHANDLES(v3d, bezt);
}
void ed_dissolve_bez_segment(BezTriple *bezt_prev,
BezTriple *bezt_next,
const Nurb *nu,
const Curve *cu,
const int span_len,
const int span_step[2])
{
int i_span_edge_len = span_len + 1;
const int dims = 3;
const int points_len = ((cu->resolu - 1) * i_span_edge_len) + 1;
float *points = MEM_mallocN(points_len * dims * sizeof(float), __func__);
float *points_stride = points;
const int points_stride_len = (cu->resolu - 1);
for (int segment = 0; segment < i_span_edge_len; segment++) {
BezTriple *bezt_a = &nu->bezt[mod_i((span_step[0] + segment) - 1, nu->pntsu)];
BezTriple *bezt_b = &nu->bezt[mod_i((span_step[0] + segment), nu->pntsu)];
for (int axis = 0; axis < dims; axis++) {
BKE_curve_forward_diff_bezier(bezt_a->vec[1][axis],
bezt_a->vec[2][axis],
bezt_b->vec[0][axis],
bezt_b->vec[1][axis],
points_stride + axis,
points_stride_len,
dims * sizeof(float));
}
points_stride += dims * points_stride_len;
}
BLI_assert(points_stride + dims == points + (points_len * dims));
float tan_l[3], tan_r[3], error_sq_dummy;
uint error_index_dummy;
sub_v3_v3v3(tan_l, bezt_prev->vec[1], bezt_prev->vec[2]);
normalize_v3(tan_l);
sub_v3_v3v3(tan_r, bezt_next->vec[0], bezt_next->vec[1]);
normalize_v3(tan_r);
curve_fit_cubic_to_points_single_fl(points,
points_len,
NULL,
dims,
FLT_EPSILON,
tan_l,
tan_r,
bezt_prev->vec[2],
bezt_next->vec[0],
&error_sq_dummy,
&error_index_dummy);
if (!ELEM(bezt_prev->h2, HD_FREE, HD_ALIGN)) {
bezt_prev->h2 = (bezt_prev->h2 == HD_VECT) ? HD_FREE : HD_ALIGN;
}
if (!ELEM(bezt_next->h1, HD_FREE, HD_ALIGN)) {
bezt_next->h1 = (bezt_next->h1 == HD_VECT) ? HD_FREE : HD_ALIGN;
}
MEM_freeN(points);
}
static int curve_dissolve_exec(bContext *C, wmOperator *UNUSED(op))
{
Main *bmain = CTX_data_main(C);
@@ -6523,8 +6593,8 @@ static int curve_dissolve_exec(bContext *C, wmOperator *UNUSED(op))
LISTBASE_FOREACH (Nurb *, nu, editnurb) {
if ((nu->type == CU_BEZIER) && (nu->pntsu > 2)) {
uint span_step[2] = {nu->pntsu, nu->pntsu};
uint span_len;
int span_step[2] = {nu->pntsu, nu->pntsu};
int span_len;
while (BLI_array_iter_span(nu->bezt,
nu->pntsu,
@@ -6537,61 +6607,7 @@ static int curve_dissolve_exec(bContext *C, wmOperator *UNUSED(op))
BezTriple *bezt_prev = &nu->bezt[mod_i(span_step[0] - 1, nu->pntsu)];
BezTriple *bezt_next = &nu->bezt[mod_i(span_step[1] + 1, nu->pntsu)];
int i_span_edge_len = span_len + 1;
const uint dims = 3;
const uint points_len = ((cu->resolu - 1) * i_span_edge_len) + 1;
float *points = MEM_mallocN(points_len * dims * sizeof(float), __func__);
float *points_stride = points;
const int points_stride_len = (cu->resolu - 1);
for (int segment = 0; segment < i_span_edge_len; segment++) {
BezTriple *bezt_a = &nu->bezt[mod_i((span_step[0] + segment) - 1, nu->pntsu)];
BezTriple *bezt_b = &nu->bezt[mod_i((span_step[0] + segment), nu->pntsu)];
for (int axis = 0; axis < dims; axis++) {
BKE_curve_forward_diff_bezier(bezt_a->vec[1][axis],
bezt_a->vec[2][axis],
bezt_b->vec[0][axis],
bezt_b->vec[1][axis],
points_stride + axis,
points_stride_len,
dims * sizeof(float));
}
points_stride += dims * points_stride_len;
}
BLI_assert(points_stride + dims == points + (points_len * dims));
float tan_l[3], tan_r[3], error_sq_dummy;
uint error_index_dummy;
sub_v3_v3v3(tan_l, bezt_prev->vec[1], bezt_prev->vec[2]);
normalize_v3(tan_l);
sub_v3_v3v3(tan_r, bezt_next->vec[0], bezt_next->vec[1]);
normalize_v3(tan_r);
curve_fit_cubic_to_points_single_fl(points,
points_len,
NULL,
dims,
FLT_EPSILON,
tan_l,
tan_r,
bezt_prev->vec[2],
bezt_next->vec[0],
&error_sq_dummy,
&error_index_dummy);
if (!ELEM(bezt_prev->h2, HD_FREE, HD_ALIGN)) {
bezt_prev->h2 = (bezt_prev->h2 == HD_VECT) ? HD_FREE : HD_ALIGN;
}
if (!ELEM(bezt_next->h1, HD_FREE, HD_ALIGN)) {
bezt_next->h1 = (bezt_next->h1 == HD_VECT) ? HD_FREE : HD_ALIGN;
}
MEM_freeN(points);
ed_dissolve_bez_segment(bezt_prev, bezt_next, nu, cu, span_len, span_step);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -88,13 +88,14 @@ static void ED_curve_pick_vert__do_closest(void *userData,
UNUSED_VARS_NDEBUG(handles_visible);
}
bool ED_curve_pick_vert(ViewContext *vc,
short sel,
Nurb **r_nurb,
BezTriple **r_bezt,
BPoint **r_bp,
short *r_handle,
Base **r_base)
bool ED_curve_pick_vert_ex(ViewContext *vc,
short sel,
float dist_px,
Nurb **r_nurb,
BezTriple **r_bezt,
BPoint **r_bp,
short *r_handle,
Base **r_base)
{
/* (sel == 1): selected gets a disadvantage */
/* in nurb and bezt or bp the nearest is written */
@@ -109,7 +110,7 @@ bool ED_curve_pick_vert(ViewContext *vc,
bool is_changed;
} data = {NULL};
data.dist = ED_view3d_select_dist_px();
data.dist = dist_px;
data.hpoint = 0;
data.select = sel;
data.mval_fl[0] = vc->mval[0];
@@ -143,6 +144,18 @@ bool ED_curve_pick_vert(ViewContext *vc,
return (data.bezt || data.bp);
}
bool ED_curve_pick_vert(ViewContext *vc,
short sel,
Nurb **r_nurb,
BezTriple **r_bezt,
BPoint **r_bp,
short *r_handle,
Base **r_base)
{
return ED_curve_pick_vert_ex(
vc, sel, ED_view3d_select_dist_px(), r_nurb, r_bezt, r_bp, r_handle, r_base);
}
/** \} */
/* -------------------------------------------------------------------- */

View File

@@ -765,6 +765,7 @@ set_property(GLOBAL PROPERTY ICON_GEOM_NAMES
ops.armature.extrude_cursor
ops.armature.extrude_move
ops.curve.draw
ops.curve.pen
ops.curve.extrude_cursor
ops.curve.extrude_move
ops.curve.radius

View File

@@ -53,6 +53,13 @@ void ED_curve_editnurb_free(struct Object *obedit);
bool ED_curve_editnurb_select_pick(struct bContext *C,
const int mval[2],
const struct SelectPick_Params *params);
/**
* \param sel_dist_mul: A multiplier on the default select distance.
*/
bool ED_curve_editnurb_select_pick_ex(struct bContext *C,
const int mval[2],
const float sel_dist_mul,
const struct SelectPick_Params *params);
struct Nurb *ED_curve_add_nurbs_primitive(
struct bContext *C, struct Object *obedit, float mat[4][4], int type, int newob);