Commit Graph

123778 Commits

Author SHA1 Message Date
Brecht Van Lommel
d1bfda16bb Cycles: re-enable HIP on Linux
Using the new ROCm 5.5 compiler.

Ref #104786

Pull Request: https://projects.blender.org/blender/blender/pulls/107662
2023-05-05 19:36:55 +02:00
Michael Jones
25fe9d74c9 Cycles: Fix hang when MSL->AIR compilation fails
Follow up to [#100066](https://projects.blender.org/blender/blender/pulls/105122/files). Scenes that do pre-render work on the GPU (e.g. the bake unit tests) will still hang if there are MSL compile failures. This patch adds a loop break out in case of an error.

Pull Request: https://projects.blender.org/blender/blender/pulls/107657
2023-05-05 18:52:54 +02:00
Pratik Borhade
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: https://projects.blender.org/blender/blender/pulls/104565
2023-05-05 17:46:05 +02:00
Christoph Lendenfeld
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: https://projects.blender.org/blender/blender/pulls/107406
2023-05-05 17:22:39 +02:00
Brecht Van Lommel
0ffde36fe7 Refactor: flatten light tree in recursive function
This will make further changes for light linking easier, where we want to
build multiple trees specialized for each light linking set.

It's also easier to understand than the stack used previously.

Pull Request: https://projects.blender.org/blender/blender/pulls/107560
2023-05-05 16:32:59 +02:00
Clément Foucault
c796cbebef Metal: Add atomicExchange and mat3x4 support 2023-05-05 16:18:24 +02:00
Christoph Lendenfeld
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: https://projects.blender.org/blender/blender/pulls/107610
2023-05-05 15:30:29 +02:00
Julian Eisel
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
Chris Blackbourn
48abc09d84 Cleanup: format 2023-05-05 23:44:56 +12:00
Clément Foucault
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
Clément Foucault
5a88afeaec DRW: Fix mixed type comparison warning 2023-05-05 12:52:47 +02:00
Clément Foucault
eab0cd475a EEVEE-Next: Fix wrong texture usage flag 2023-05-05 12:52:47 +02:00
Clément Foucault
c11ac86e03 Cleanup: Metal: Better function name and comments for buffer bindings 2023-05-05 12:52:47 +02:00
Clément Foucault
2f1bf2ff1e EEVEE-Next: World: Fix missing SSBO bind 2023-05-05 12:52:47 +02:00
Julian Eisel
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
Julian Eisel
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
Sergey Sharybin
ecb8d7f8ab Tests: Add test for broken EXR files
To make sure non-trivial cases like #106977 are not re-introduced.

Pull Request: https://projects.blender.org/blender/blender/pulls/107643
2023-05-05 11:00:54 +02:00
Campbell Barton
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
Campbell Barton
c80e9641ed Cleanup: replace UTF8 string copy macro with function 2023-05-05 14:36:09 +10:00
Campbell Barton
dc4e48fca0 Cleanup: quiet clang-tidy char subscript warning 2023-05-05 14:21:13 +10:00
Campbell Barton
b0aa8fb16a Cleanup: quiet warning 2023-05-05 14:09:38 +10:00
Campbell Barton
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
Campbell Barton
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
Joseph Eagar
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
Campbell Barton
e5598d067b BKE_image: simplify UDIM tile label access, return string length 2023-05-05 10:26:17 +10:00
Joseph Eagar
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
Campbell Barton
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
Campbell Barton
831bacec92 Cleanup: use function style casts & nullptr in C++ code 2023-05-05 09:46:28 +10:00
Campbell Barton
ba3d7499fa Cleanup: spelling, use term polygons in polygon callbacks 2023-05-05 09:46:28 +10:00
Campbell Barton
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
Campbell Barton
f2bbcc317f Cleanup: format 2023-05-05 09:46:04 +10:00
illua1
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: https://projects.blender.org/blender/blender/pulls/107628
2023-05-04 19:27:55 +02:00
Germano Cavalcante
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
Hans Goudey
730b11034f Cleanup: Move remaining modifier files to C++
See #103343

Pull Request: https://projects.blender.org/blender/blender/pulls/107626
2023-05-04 18:35:37 +02:00
Sergey Sharybin
eca8e6bf5e Refactor: Convert mask module to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/107615
2023-05-04 17:36:01 +02:00
Clément Foucault
5aa51cf607 EEVEE-Next: Fix warning when using Metal backend 2023-05-04 17:01:28 +02:00
Clément Foucault
78d2f162e8 Metal: Fix EEVEE-Next shader compilation errors 2023-05-04 17:01:28 +02:00
Clément Foucault
aa31d9be80 Metal: Fix Workbench-Next shader compilation errors 2023-05-04 17:01:28 +02:00
Germano Cavalcante
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: https://projects.blender.org/blender/blender/pulls/107507
2023-05-04 16:39:22 +02:00
illua1
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: https://projects.blender.org/blender/blender/pulls/107622
2023-05-04 16:32:15 +02:00
Campbell Barton
42d3df25f3 Cleanup: pass a const context to menu UI funcitons 2023-05-05 00:19:31 +10:00
Campbell Barton
fc6418ae94 Cleanup: quiet "undef" compiler warning 2023-05-05 00:19:23 +10:00
Sergey Sharybin
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: https://projects.blender.org/blender/blender/pulls/107619
2023-05-04 15:51:24 +02:00
Hans Goudey
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: https://projects.blender.org/blender/blender/pulls/106774
2023-05-04 15:39:10 +02:00
Julian Eisel
bf77d3436d Cleanup: Comment formatting for preview image enums definitions 2023-05-04 15:22:49 +02:00
Julian Eisel
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
YimingWu
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: https://projects.blender.org/blender/blender/pulls/107575
2023-05-04 14:51:36 +02:00
Christoph Lendenfeld
5e1470d1b3 Animation: Clean up "Key" menu in Graph Editor
* remove "Keyframe" label from the Key menu
* "Jump To Keyframe" -> "Jump to Selected"
* added a new menu "Density" with Decimate, Sample and Clean operators
* removed the "Clean Channels" entry. It does the same as the "Clean" operator but also removes channels IF the remaining keys are at the default value. The feature is still available in the redo panel
* Split the slider operators out by functionality
* Move Euler filter to Channel menu
* Remove "Add F-Curve modifier" from Key menu (it already is in the Channel menu)
* Move Bake/Unbake Curve functions to Channel menu
* Move "Bake Sound to FCurves" to Channel menu

Pull Request: https://projects.blender.org/blender/blender/pulls/106113
2023-05-04 14:10:27 +02:00
Jeroen Bakker
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: https://projects.blender.org/blender/blender/pulls/107611
2023-05-04 12:42:37 +02:00
Jacques Lucke
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