Commit Graph

99343 Commits

Author SHA1 Message Date
80feb13665 Allow select range in animation editor
This patch will add support to select all channels between active channel
and last-clicked channel without deselecting previous selection. `Shift` key is
now assigned for the range selection and `ctrl` key to extend the selection. This
changes will make multi-selection similar as outliner tree-elements. New function is
created `animchannel_select_range` to handle the range selection of channels.

Old Differential revision: https://archive.blender.org/developer/D17079

Pull Request: blender/blender#104565
2023-05-05 17:46:05 +02:00
c9b51591da Refactor: Allow to explicitly set the range on the slider UI element
The current implementation goes like this
* default to a 0-1 range
* you can set `is_bidirectional` to get a -1/1 range
* if the slider is bidirectional the overshoot goes both ways, otherwise only on the positive side

The issue is that it is not possible to have a 0-1 range but overshoot both ways.
This is useful for example on the "Blend to Default" operator, where 0 means current position and 1 default.
But overshoot also makes sense for this operator since the other way just scales away from default.

So this patch:
* removes `is_bidirectional`
* adds `float range[2]` to `tSlider` and a setter for it
* rewrite some logic to handle arbitrary ranges
* split the `allow_overshoot` flag into one flag for either side

Pull Request: blender/blender#107406
2023-05-05 17:22:39 +02:00
c796cbebef Metal: Add atomicExchange and mat3x4 support 2023-05-05 16:18:24 +02:00
9654b96ffa Refactor: pose_slide.c
* add const where possible
* reduce calls to `ED_slider_factor_get` and instead store that in `const float factor`
* rename variables from camel case to snake case, using full words, to conform to naming convention
* use interpf where possible

no functional changes

Pull Request: blender/blender#107610
2023-05-05 15:30:29 +02:00
878477f250 Fix broken UI view notifier listening
(UI views: https://wiki.blender.org/wiki/Source/Interface/Views)

Noticed while working on asset UIs with views, when async loading of
assets wouldn't trigger redraws.
2023-05-05 15:20:05 +02:00
48abc09d84 Cleanup: format 2023-05-05 23:44:56 +12:00
29053c5c02 EEVEE-Next: Fix validation layer errors on Metal
This only fixes the culling tile group size.
2023-05-05 12:52:47 +02:00
5a88afeaec DRW: Fix mixed type comparison warning 2023-05-05 12:52:47 +02:00
eab0cd475a EEVEE-Next: Fix wrong texture usage flag 2023-05-05 12:52:47 +02:00
c11ac86e03 Cleanup: Metal: Better function name and comments for buffer bindings 2023-05-05 12:52:47 +02:00
2f1bf2ff1e EEVEE-Next: World: Fix missing SSBO bind 2023-05-05 12:52:47 +02:00
95fa4d73d6 Cleanup: Avoid nested conditional blocks in WM-jobs code
Conditional blocks introduce scopes that need to be kept track of,
linear code is easier to follow. So use early exiting (`continue`s in
this case) to reduce cognitive load, a number of devs consider this good
practice.
2023-05-05 12:15:38 +02:00
8284bb1ff4 Fix potentially missing redraws when file browser loads recursively
The `do_update` boolean would be overridden with false whenever a single
directory didn't add new items. It should not modify it in this case.
2023-05-05 11:52:54 +02:00
70cd2a9741 RNA: use memcpy for copying strings when the length is known
There is no advantage in using BLI_strncpy/BLI_strncpy_utf8 when the
destination string has been allocated and won't be concatenated.

Also no need to calloc memory which is filled by strcpy afterwards.
2023-05-05 15:36:50 +10:00
c80e9641ed Cleanup: replace UTF8 string copy macro with function 2023-05-05 14:36:09 +10:00
dc4e48fca0 Cleanup: quiet clang-tidy char subscript warning 2023-05-05 14:21:13 +10:00
b0aa8fb16a Cleanup: quiet warning 2023-05-05 14:09:38 +10:00
f665b73c89 RNA: replace BLI_strncpy with strcpy/memcpy when the size is known
Follow up on [0] handle remaining cases where BLI_strncpy was used
it RNA string get callbacks.

[0]: c891dbd162
2023-05-05 14:01:57 +10:00
6796cce11d Refactor: add a function to access images extensions from it's format
Previously accessing the extension needed to ensure an extension
on an empty path.

This conflicted with DEBUG_STRSIZE as it was assumed the input was
FILE_MAX, where as it was a small buffer with RNA, see: !107602.

Resolve by separating the function that ensures the extension
with the function that finds valid extensions for a format.

Also pass the size of the filepath to functions that ensure the
extension.
2023-05-05 14:01:57 +10:00
f15889a9f9 Sculpt: Split face set visibility invert into its own operator
Visibility invert should not use OPTYPE_DEPENDS_ON_CURSOR.
2023-05-04 17:49:40 -07:00
e5598d067b BKE_image: simplify UDIM tile label access, return string length 2023-05-05 10:26:17 +10:00
a79272a790 Sculpt: fix broken pbvh draw
foreach_faces now passes looptri index instead of a
MLoopTri pointer.
2023-05-04 17:09:53 -07:00
8cbb42c640 Cleanup: de-duplicate internal function for file/directory split
Also note that BLI_path_basename can be used in place of
BLI_path_split_file_part when a copy isn't needed.
2023-05-05 10:02:46 +10:00
831bacec92 Cleanup: use function style casts & nullptr in C++ code 2023-05-05 09:46:28 +10:00
ba3d7499fa Cleanup: spelling, use term polygons in polygon callbacks 2023-05-05 09:46:28 +10:00
49c09d7640 Cleanup: remove inline pointcache extension stripping
No need to perform inline, and it would not have worked properly for
*.blend1 files.
2023-05-05 09:46:28 +10:00
f2bbcc317f Cleanup: format 2023-05-05 09:46:04 +10:00
e858aa7181 Fix #107623: Do not allow dragging search menu from custom socket
To prevent invalid links, simply disable them for this socket type.
Other nodes with such sockets may appear in the future.

Pull Request: blender/blender#107628
2023-05-04 19:27:55 +02:00
93d464dcd1 Fix snapping with constraint flickering
Flickering observed when snapping to edge or face with axis constraint.

It was probably introduced in 4eda60c2d8

The snapping code has a timer, so `t->tsnap.snapElem` isn't always set.

So avoid changing the value of `t->tsnap.snapElem`.
2023-05-04 14:05:47 -03:00
730b11034f Cleanup: Move remaining modifier files to C++
See #103343

Pull Request: blender/blender#107626
2023-05-04 18:35:37 +02:00
eca8e6bf5e Refactor: Convert mask module to C++
Pull Request: blender/blender#107615
2023-05-04 17:36:01 +02:00
5aa51cf607 EEVEE-Next: Fix warning when using Metal backend 2023-05-04 17:01:28 +02:00
78d2f162e8 Metal: Fix EEVEE-Next shader compilation errors 2023-05-04 17:01:28 +02:00
aa31d9be80 Metal: Fix Workbench-Next shader compilation errors 2023-05-04 17:01:28 +02:00
6b5b777ca3 UI: add Proportional Size to Proportional Edit popover
Rather than forcing the user to initiate a transform operation to edit the `Proportional Size`, allow editing of the `Proportional Size` through the UI.

The affected headers are:
- View 3D
- Dop Sheet
- Image Editor
- Graph Editor
- Mask Editor

Pull Request: blender/blender#107507
2023-05-04 16:39:22 +02:00
239c1194a0 Fix #107545: Mistakes in recent node.cc cleanup
1. Early return needs inverted null checking.
2. `BLO_expand` macros expect value, not a pointer.

Pull Request: blender/blender#107622
2023-05-04 16:32:15 +02:00
42d3df25f3 Cleanup: pass a const context to menu UI funcitons 2023-05-05 00:19:31 +10:00
fc6418ae94 Cleanup: quiet "undef" compiler warning 2023-05-05 00:19:23 +10:00
2e7b896928 Fix strict compiler warning in ImBuf
Solves the warning C4060: switch statement contains no 'case'
or 'default' labels warning with lite builds.

Pull Request: blender/blender#107619
2023-05-04 15:51:24 +02:00
d0705bd697 Mesh: Split MLoopTri poly indices into a separate array
For derived mesh triangulation information, currently the three face
corner indices are stored in the same struct as index of the mesh
polygon the triangle is part of. While those pieces of information are
often used together, they often aren't, and combining them prevents
the indices from being used with generic utilities. It also means that
1/3 more memory has to be written when recalculating the triangulation
after deforming the mesh, and that the entire triangle data has to be
read when only the polygon indices are needed.

This commit splits the polygon index into a separate cache on `Mesh`.
The triangulation data isn't saved to files, so this doesn't affect
.blend files at all.

In a simple test deforming a mesh with geometry nodes, the time used
to recalculate the triangulation reduced from 2.0 ms to 1.6 ms,
increasing overall FPS from 14.6 to 15.

Pull Request: blender/blender#106774
2023-05-04 15:39:10 +02:00
bf77d3436d Cleanup: Comment formatting for preview image enums definitions 2023-05-04 15:22:49 +02:00
9d422f2fbc Cleanup: Avoid nesting (use early exit) in icon code
Conditional blocks introduce scopes that need to be kept track of,
linear code is easier to follow. So use early exiting to reduce
cognitive load, a number of devs (including myself) consider this good
practice.
2023-05-04 15:05:49 +02:00
1049f11cc0 Fix #107566: Gesture face set respect hidden faces
Gesture face set selection (box and lasso selection) didn't respect hidden
faces, causing selection to bleed unexpectedly, now fixed.

Pull Request: blender/blender#107575
2023-05-04 14:51:36 +02:00
22e4e97310 macOS: Reduce Edit Mode Drawing Artifacts
Apple Silicon uses tile rendering and can discard tiles if it
is covered. The retopology overlay made some changes to the
shader that introduced some blocking and striping artifacts when
the overlay was disabled.

This PR changes the minimum used offset to reduce the drawing
artifacts. Tweaking the GLSL shader itself didn't work.

Fix #105830

Pull Request: blender/blender#107611
2023-05-04 12:42:37 +02:00
e674e32aa1 Fix: missing null check leads to crash when rendering
The simulation cache is allocated lazily during evaluation when the
depsgraph is active. However, during rendering, the depsgraph is not
active, so it's not created.
2023-05-04 11:04:42 +02:00
9d6659bf07 Metal: Shader: Remove assertion of compilation success
This allow the compilation tests to finish even on failure.
2023-05-04 10:59:26 +02:00
2815f46883 Metal: ShaderLog: Add initial implementation
This is a really rough implementation. Since the MSL sources
do not correspond 1:1 to the GLSL sources, some mapping is
needed to retreive the GLSL source file for a given generated
line. This will be implemented in a later commit.
2023-05-04 10:59:26 +02:00
e39c3c600c GPU: ShaderLog: Add more const correctness & notes supports
The metal shader compiler can produce `note` reports.
Treat them as warnings.
2023-05-04 10:59:26 +02:00
b0c7e83805 Cleanup: formatting
In recent changes to vulkan.
2023-05-04 10:23:15 +02:00
1c57ac6ce7 Cleanup: remove unused member variable 2023-05-04 10:19:40 +02:00