Commit Graph

108129 Commits

Author SHA1 Message Date
Miguel Pozo
0c8b96d1e0 EEVEE-Next: Shadow resolution scale and adaptive filtering
Allow the user to scale shadow-map resolution per-light.
Adapt the PCF scale based on shadow-map to pixel footprint ratio,
since we can no longer assume that higher LODs don't need filtering.
This allows using much lower shadow resolutions, which can yield
quite significant performance improvements, with relatively little
perceptual quality loss (at the cost of softening shadow edges).
The per-light resolution scale is a literal scale, so for example 0.5
means half the resolution. The Scene Simplify Shadows setting has
been updated to match this behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/119436
2024-03-20 15:54:41 +01:00
Brecht Van Lommel
dc34e96dc4 Merge branch 'blender-v4.1-release' 2024-03-20 15:49:15 +01:00
Jason Fielder
c584597165 Fix #109363: Resolve GPencil fill in Metal
Resolves an issue with stroke rendering in
Metal using the geometry shader fallback
path. Stroke rendering now matches OpenGL
which should enable the GPencil fill tool to
function correctly at all zoom levels.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/119660
2024-03-20 15:38:44 +01:00
Hans Goudey
6d3ac72a29 Merge branch 'blender-v4.1-release' 2024-03-20 10:19:49 -04:00
Hans Goudey
87de8109b7 Fix: Build error from misplaced const in recent commit 2024-03-20 10:09:06 -04:00
Hans Goudey
cb3975c045 Fix #119642: Orbit around selection ignores geometry bounds
The code tried to retrieve the bounds from the data
synced back to the original object at the end of depsgraph
evaluation. That data is only set on original objects.

Instead just retrieve the bounds directly from the evaluated
object. Also make two variables const now that it's possible.

Pull Request: https://projects.blender.org/blender/blender/pulls/119674
2024-03-20 14:47:27 +01:00
Sergey Sharybin
6dc1cffe33 Merge branch 'blender-v4.1-release' 2024-03-20 14:38:52 +01:00
Sergey Sharybin
03c7191286 Fix #119560: Wanderer Demo Crash in 4.1 and 4.2
Add a null pointer check around CPU processor, matching the rest of the
processor access.

This solves crash in cases when the OCIO configuration exists but is
invalid: i.e. by removing a lookup table. It could lead to an invalid
render result, but is better than a crash.

The original issue with running Blender from within .zip archive might
still need investigation, as there might be a way to make it work.

Pull Request: https://projects.blender.org/blender/blender/pulls/119693
2024-03-20 14:38:23 +01:00
Michael Kowalski
99b845b1fb Fix: USD import: point instancer invalid modifier uid
Initializing the uid of the geom nodes modifier created
by the point instancer reader to prevent an assertion failure
(in a call to to BKE_modifiers_persistent_uids_are_valid())
when reading any USD point instancers in debug builds.

Pull Request: https://projects.blender.org/blender/blender/pulls/119683
2024-03-20 13:59:00 +01:00
YimingWu
3689dfca4f GPv3: Build Modifer migration
Reimplemented build modifier using the new `CurvesGeometry` logic.

Pull Request: https://projects.blender.org/blender/blender/pulls/118739
2024-03-20 13:28:28 +01:00
Pratik Borhade
c250b4bd51 Merge branch 'blender-v4.1-release' 2024-03-20 17:27:43 +05:30
Jacques Lucke
1fadf2251f Nodes: align functions to check if socket type supports fields or grids 2024-03-20 12:55:49 +01:00
Pratik Borhade
f99939e2ff Cleanup: Remove redo panel drawing code of graph select handle
Since there is no special case for drawing redo panel, this callback is
not required. Panel will be generated automatically because `undo` and `register`
flags are added to operator.
This improves alignment in redo panel.

Pull Request: https://projects.blender.org/blender/blender/pulls/119494
2024-03-20 12:55:13 +01:00
Jacques Lucke
25a10c211f Nodes: support accessing socket type directly from declaration
Previously, we haven't added this because there were plans to use these
declarations at a higher abstraction level where one declaration potentially
contains more than one socket. This hasn't happened yet, and we are also using
other ways to achieve dynamic socket amounts (using dynamic declarations).
Therefore, it is reasonable to simplify the code by storing the integer socket
type in the declaration directly.

Pull Request: https://projects.blender.org/blender/blender/pulls/119691
2024-03-20 12:37:37 +01:00
Jacques Lucke
7447666c85 Merge branch 'blender-v4.1-release' 2024-03-20 11:48:42 +01:00
Jacques Lucke
067daec270 Nodes: don't use combined input/output sockets in node tree interface
Those shouldn't really exist at all currently, since we forbid them in 354915cf3c87b.
Unfortunately, not all cases were removed, and many node trees with such sockets
have been created during the development of 4.1 due to the auto-smooth changes.

I'm not entirely sure if it's still possible to properly remove them now. The commit
above mentions that we might lose links due to changed identifiers. Maybe we're
better off just supporting these inlined sockets while also allowing the "align with
previous socket" functionality.

Either way, not creating more of such node trees for now is reasonable, since we
explicitly disabled that functionality for now.

Pull Request: https://projects.blender.org/blender/blender/pulls/119654
2024-03-20 11:26:07 +01:00
Thomas Dinges
31eaa2f5ba Merge branch 'blender-v4.1-release' 2024-03-20 08:38:41 +01:00
Jason Fielder
3c25b079ce Fix #109739: Resolve greyed out UI on MacOS
UI would sometimes disappear with the Metal backend.
This occured in situations where there was only a single
GPUContext within a single GHOST window, meaning
the activation routine for the context was never run.

Context activation is required to ensure the backbuffer
was up to date upon resize. Otherwise, re-sizing the
window would cause the screen to turn grey as the
new drawables would not be rendered to.

Authored by Apple: Michael Parkin-White

Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/119299
2024-03-20 08:33:29 +01:00
Campbell Barton
3135e766ec Cleanup: replace UI_MAX_NAME_STR with BKE_ST_MAXNAME
Since [0] some comments referencing UI_MAX_NAME_STR were incorrect.
Also correct buffer size for preview_id in uiTemplatePreview so newly
created names are guarantee to be the correct size.

[0]: a180314ac5e2aa78067cdf91e5469c4c9d2a88f9
2024-03-20 15:14:08 +11:00
Campbell Barton
ee64778cac Cleanup: code-comments for struct ID's and use backtick quotes
- Prefix comments before members is used practically everywhere,
  remove C99 syntax from inside comments.
- Replace double quotes with backticks for code styling.
2024-03-20 14:43:35 +11:00
Campbell Barton
729949669e Fix #114667: UI List search broken when class names >32 chars
The list identifier includes the class name and an list_id,
see: WM_uilisttype_to_full_list_id

This requires using UI_MAX_NAME_STR (as noted in doc-string).
2024-03-20 14:41:56 +11:00
Sean Kim
130ce5f53d Cleanup: Remove redundant function prefixes in sculpt_trim.cc
This PR strips the `sculpt_gesture_trim` prefix and other similar
prefixes from the `sculpt_trim.cc` code, as it is already contained
within the `blender::ed::sculpt_paint::trim` namespace.

Pull Request: https://projects.blender.org/blender/blender/pulls/119680
2024-03-20 03:41:21 +01:00
Campbell Barton
9edb2784da Fix #117320: UV Sync-select selects faces instead of just edges 2024-03-20 13:39:43 +11:00
Sean Kim
e53d4e423e Cleanup: Convert sculpt_trim.cc to enum class
This PR converts the three `enum` definitions to `enum class` in sculpt_trim.cc

Pull Request: https://projects.blender.org/blender/blender/pulls/119679
2024-03-19 22:38:25 +01:00
Hik
2d49cc597f Fix #119275: Update Sidebar Values with Voxel Size Changes
Add notifier when changing sculpt voxel size so that the new value is
shown in the sidebar.

Pull Request: https://projects.blender.org/blender/blender/pulls/119646
2024-03-19 20:57:28 +01:00
Hans Goudey
76c5587531 Cleanup: Rename mesh render SortedFaceData fields
Try to add a bit more clarity and use more consistent wording.
2024-03-19 15:14:35 -04:00
Hans Goudey
9fe2e34833 Cleanup: Rename MeshRenderData variables
Use more standard _num suffix and standard mesh variable names.
2024-03-19 15:00:58 -04:00
Jacques Lucke
82f434f444 Nodes: cleanup node declaration finalization
* Extract function for building anonymous attribute references.
* Use is-function-node state directly during building instead of during finalization.

Pull Request: https://projects.blender.org/blender/blender/pulls/119677
2024-03-19 19:54:27 +01:00
Hans Goudey
3641b4b884 Fix #119586: Vertex paint mode crash after converting color attribute
Converting a color attribute to a non-color domain or type causes vertex
paint mode to try to change the attribute even though it's unsupported.
That leads to a crash here and unpredictable behavior elsewhere.

This PR modifies some poll functions to check for the proper domain and
data type before continuing. Even if converting an attribute properly
updates the active color attribute, we can still run into situations where
the active name references an attribute with incorrect metadata.

Pull Request: https://projects.blender.org/blender/blender/pulls/119657
2024-03-19 19:49:00 +01:00
Clément Foucault
787818d21d EEVEE-Next: Fix shader compilation error caused by resource macro 2024-03-19 19:23:17 +01:00
Clément Foucault
23dce15f67 EEVEE-Next: Horizon Scan: Use Spherical harmonics
This uses Spherical Harmonics to store the indirect lighting and
distant lighting visibility.

We can then reuse this information for each closure which divide
the cost of it by 2 or 3 in many cases, doing the scanning once.

The storage cost is higher than previous method, so we split the
resolution scaling to be independant of raytracing.

The spatial filtering has been split to its own pass for performance
reason. Upsampling now only uses 4 bilinearly interpolated samples
(instead of 9) using bilateral weights to avoid bleeding.

This also add a missing dot product (which soften the lighting
around corners) and fixes the blocky artifacts seen at lower
resolution.

Pull Request: https://projects.blender.org/blender/blender/pulls/118924
2024-03-19 19:16:21 +01:00
Clément Foucault
893430a2c7 EEVEE-Next: Add correct support for volume anisotropy from probe volumes
This adds the approximation of phase function convolution
of the distant lighting captured inside probe volumes.

This is based on a publication at siggraph from Bartlomiej Wronsky
"Volumetric Fog: Unified compute shader based solution to
atmospheric scattering"

Implementation is quite straightforward. However this isn't as
good as one can expect as there isn't self shadowing from the
volume themself, so the lighting is still quite flat.

To fix this, we have to add support for volumetrics inside
probe volumes baking. But this approach would still be static
so a more general solution is still to be found for dynamic
volumes like smoke simulations.

Pull Request: https://projects.blender.org/blender/blender/pulls/119479
2024-03-19 19:01:05 +01:00
Amine Bensalem
1e478cf169 Fix #118137: Symmetry buttons on-click state change
Buttons for mesh symmetry on the toolbar, and other buttons of the same
functionality located in other areas of the window, weren't updated when
clicking on them.

Pull Request: https://projects.blender.org/blender/blender/pulls/118508
2024-03-19 18:49:40 +01:00
Jacques Lucke
b99c1abc3a BLI: speedup memory bandwidth bound tasks by reducing threading
This improves performance by **reducing** the amounts of threads used for tasks
which require a high memory bandwidth.

This works because the underlying hardware has a certain maximum memory
bandwidth. If that is used up by a few threads already, any additional threads
wanting to use a lot of memory will just cause more contention which actually
slows things down. By reducing the number of threads that can perform certain
tasks, the remaining threads are also not locked up doing work that they can't
do efficiently. It's best if there is enough scheduled work so that these tasks
can do more compute intensive tasks instead.

To use this new functionality, one has to put the parallel code in question into
a `threading::memory_bandwidth_bound_task(...)` block. Additionally, one also
has to provide a (very) rough approximation for how many bytes are accessed. If
the number is low, the number of threads shouldn't be reduced because it's
likely that all touched memory can be in L3 cache which generally has a much
higher bandwidth than main memory.

The exact number of threads that are allowed to do bandwidth bound tasks at the
same time is generally highly context and hardware dependent. It's also not
really possible to measure reliably because it depends on so many static and
dynamic factors. The thread count is now hardcoded to 8. It seems that this many
threads are easily capable of maxing out the bandwidth capacity.

With this technique I can measure surprisingly good performance improvements:
* Generating a 3000x3000 grid: 133ms -> 103ms.
* Generating a mesh line with 100'000'000 vertices: 212ms -> 189ms.
* Realize mesh instances resulting in ~27'000'000 vertices: 460ms -> 305ms.

In all of these cases, only 8 instead of 24 threads are used. The remaining
threads are idle in these cases, but they could do other work if available.

Pull Request: https://projects.blender.org/blender/blender/pulls/118939
2024-03-19 18:23:56 +01:00
Brecht Van Lommel
c12ac94520 Cleanup: make format 2024-03-19 18:20:23 +01:00
Bartosz Kosiorek
18340fa057 UI: Extend description of Grid, Cube, UV Sphere and Ico Sphere
Pull Request: https://projects.blender.org/blender/blender/pulls/119331
2024-03-19 18:19:19 +01:00
Clément Foucault
f646f4c2b4 EEVEE-Next: Refactor world spherical harmonic extraction
This uses parallel reduction when doing the octahedral map re-mapping.

The goal is not the speedup but the accuracy of the computation (temporal
stability) and to pave the way for sunlight extraction.

This weight each individual samples using texel solid angle for correct
energy.

After optimization, the cost is not so expensive (1024px² octahedral map):
- new: 263µs remap + 12µs sum
- old: 75µs remap + 180µs irradiance update

We could optimize it more, but that feels unecessary given that the first
two filter pass are 7ms and a more pressing optimization.

The old irradiance update was fast because it was using the mip2 which
was already pre-filtered and using way less pixels (which already yield a
temporally stable output).

This new implementation does consider all pixel in the LOD0 which will
allow for more precise sunlight extraction.

This also comes with a cleanup of the update tagging.

Pull Request: https://projects.blender.org/blender/blender/pulls/119537
2024-03-19 18:10:24 +01:00
Brecht Van Lommel
f20d9fe5a5 Merge branch 'blender-v4.1-release' 2024-03-19 18:05:33 +01:00
Brecht Van Lommel
f771a8563b Fix #110751: Crash baking grease pencil line art
Ensure depsgraph tag happens when strokes are cleared, otherwise the
next depsgraph evaluation tries to use freed stroke data.

Pull Request: https://projects.blender.org/blender/blender/pulls/119662
2024-03-19 17:59:19 +01:00
Sean Kim
9b5b1f525f Cleanup: Limit sculpt gesture RNA operator properties
This PR limits adding the RNA property `use_limit_to_segment`
to `ShapeType::Line` based sculpt gesture operators, as the
property is inapplicable for the other two types.

Pull Request: https://projects.blender.org/blender/blender/pulls/119670
2024-03-19 17:32:59 +01:00
Falk David
0177c55880 Fix: Curves: Missing check in get_mutable_attribute
Same as fd92647f3457bcd8d8c95d93f7e069c97a6599c4.
Without this check, the function would try to create a new
attribute even if `num` was 0.
2024-03-19 17:09:41 +01:00
Hans Goudey
803c783e52 Merge branch 'blender-v4.1-release' 2024-03-19 11:59:26 -04:00
Hans Goudey
62b484544a Fix: Operator depends on cursor ignores macro operators
The change in 23ebc45f700b7670616 was slightly incorrect.
2024-03-19 11:58:46 -04:00
Hans Goudey
cc0e015a35 Fix #119177: False positive dyntopo attribute detection warning
".sculpt_mask" is handled as a special case for dynamic topology
but wasn't detected that way in the warning.

Pull Request: https://projects.blender.org/blender/blender/pulls/119665
2024-03-19 16:55:21 +01:00
Aras Pranckevicius
a05adbef28 BLF: optimizations and fixes to font shader
Simplifies/optimizes the "font" shader. It runs faster now too, but primarily
this is so that it loads/initializes faster.

* Instead of doing blur via individual bilinear samples (where each sample is 4
  texel fetches), do raw texel fetches of the kernel footprint and compute final
  result by shifting the kernel weights according to bilinear fraction weight.
  For 5x5 blur, this reduces number of texel fetches from 64 down to 36.
* Instead of checking "is the texel inside the glyph box? if so, then fetch it",
  first fetch it, and then set result to zero if it was outside. Simplifies the
  branching code flow in the compiled GPU shader.
* Avoid costly integer modulo/division for "unwrapping" the font texture. The
  texture width is always power of two size, so division/modulo can be replaced
  by masking and a shift. Setup uniforms to contain the needed data.

### Fixes

* The 3x3 blur was not doing a 3x3 blur, due to a copy-pasta typo (one of the
  sample offsets was repeated twice, and thus another sample offset was
  missing).
* Blur towards left/top edges of the glyphs had artifacts, because float->int
  casting in GLSL rounds towards zero, but the code actually wanted to round
  towards floor.

Image of how the blur has changed in the PR.

### First time initialization

* Windows 10, NVIDIA RTX 3080Ti, OpenGL: 274.4ms -> 51.3ms
* macOS, Apple M1 Max, Metal: 456ms -> 289ms (this is including PSO creation
  time).

### Shader performance/complexity

Performance I only measured on macOS (M1 Max), by making a BLF text that is
scaled up to cover most of screen via Python. Using Xcode Metal profiler,
drawing that text with 5x5 shadow blur: 1.5ms -> 0.3ms.

More performance analysis details in PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/119653
2024-03-19 16:29:21 +01:00
cd476226d8 Fix #119402: Bone collections layers fail with pinned object or armature #119434
Don't assume armature of active object is what is displayed in the properties editor, both in C++ and Python code.

Object pointer was left out from some notifiers, as this means only that object was changed. But an armature datablock can be shared by multiple objects.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/119663
2024-03-19 16:27:06 +01:00
Jeroen Bakker
6ceefe4f23 Revert "Fix #119527: Aliased Wireframe In XRay"
This fix should only be committed to blender-v4.1-release branch
Blender 4.2 the pos/nor buffers are separated and doesn't lead
to drawing artifacts.

This reverts commit 02379f3200f52fd51635e6e247bc2e944f0a0d4d
2024-03-19 14:34:54 +01:00
Jeroen Bakker
922c5c679f Merge branch 'blender-v4.1-release' 2024-03-19 14:33:46 +01:00
Jeroen Bakker
162fad716e Revert "Fix #119527: Aliased Wireframe In XRay"
This fix should only be committed to blender-v4.1-release branch
Blender 4.2 the pos/nor buffers are separated and doesn't lead
to drawing artifacts.

This reverts commit 02379f3200f52fd51635e6e247bc2e944f0a0d4d
2024-03-19 14:27:31 +01:00
Jeroen Bakker
02379f3200 Fix #119527: Aliased Wireframe In XRay
This change reverts 14500953ed. This commit improved the performance
but introduced the regression. The wireframe shader checks the normal
buffer to detect if attributes are being rendered. The VBO contains both
positions and normals.

In Blender 4.2 this VBO was separated (#116902)and this solved the rendering. It is
to late and risky to add this separation to 4.1 in the last minute so we
decided to revert the performance improvement as it was already an issue
for several years.

The performance improvement will still be in Blender 4.2 where it doesn't
have these artifacts.

Pull Request: https://projects.blender.org/blender/blender/pulls/119656
2024-03-19 14:27:09 +01:00
Jeroen Bakker
b5168ee771 Fix #119527: Aliased Wireframe In XRay
This change reverts 14500953ed. This commit improved the performance
but introduced the regression. The wireframe shader checks the normal
buffer to detect if attributes are being rendered. The VBO contains both
positions and normals.

In Blender 4.2 this VBO was separated (#116902)and this solved the rendering. It is
to late and risky to add this separation to 4.1 in the last minute so we
decided to revert the performance improvement as it was already an issue
for several years.

The performance improvement will still be in Blender 4.2 where it doesn't
have these artifacts.

Pull Request: https://projects.blender.org/blender/blender/pulls/119656
2024-03-19 14:23:43 +01:00
Philipp Oeser
2dcee3d698 Merge branch 'blender-v4.1-release' 2024-03-19 14:06:11 +01:00
Philipp Oeser
4a7c5d3d3d Fix #119534: Action Editor empty channels region without active action
Caused by a96f1208cc72

For `SPACE_ACTION` (`SACTCONT_ACTION`), `actedit_get_context` will
return true, but `ANIM_animdata_context_getdata` also checks the
`bAnimContext` data [which in this case is the action], so will **not**
return true.

As a result we are skipping drawing the background and the search, which
is now done again.

Pull Request: https://projects.blender.org/blender/blender/pulls/119621
2024-03-19 14:05:42 +01:00
Jacques Lucke
dc762d0914 BLI: avoid compiling same function multiple times for trivial types
For example, copying and moving a trivial type ends is the same.
However, currently we generate the code for both cases independently
instead of reusing the same underlying function.

This reduces the size of the Blender binary from `218.548.896` to
`218.355.552` bytes for me. So it's a reduction of about 200kb.

It's probably possible to reduce this even more, but that's for another day.
The main tricky thing here is telling the compiler that a `const` from a
function parameter can be cast away for trivial types (see code comment).
Maybe there is a better way to do this while making sure the compiler
doesn't generate unnecessary code.

Pull Request: https://projects.blender.org/blender/blender/pulls/119601
2024-03-19 13:45:04 +01:00
Jacques Lucke
3ad4ea81d1 Nodes: rename multi_input_socket_index to multi_input_sort_id
For historical reasons, the `multi_input_socket_index` was actually reversed
(large index comes first). This patch renames it to `multi_input_sort_id` and
adds a comment. This new name makes it less confusing that the id is reversed.

Pull Request: https://projects.blender.org/blender/blender/pulls/119652
2024-03-19 13:42:09 +01:00
Falk David
462437de20 Fix: GPv3: Assert in LayerTreeView::build_tree()
This was caused by 745fd2a2cb58e40337310c28ab1cf4a418335d0c.
The issue was that there was an attempt at calling
`uncollapse_by_default` on a `LayerViewItem`
which can't be collapsed (because it can't have any children).
This then triggered the assert.

The fix removes the call to `uncollapse_by_default` for
`LayerViewItem`.
2024-03-19 11:50:46 +01:00
7ec5dab1df Merge remote-tracking branch 'origin/blender-v4.1-release' 2024-03-19 11:18:31 +01:00
Falk David
3334fff801 Fix compiler error on windows
It seems that the compiler on windows struggled to
correctly assign the namespace of the `LocalMemArena`
destructor because the struct was defined locally
in a lambda.

This moves the struct definition out of the lambda.
2024-03-19 11:09:57 +01:00
c0c7e34bab Fix #119615: Anim, Crash with NLA tweak mode and linked Armatures
Fix a crash when inserting a key with tweak mode enabled, but where
`AnimData::actstrip` was NULL.

The root cause of this is that two pointers in the `AnimData` struct
(`act_track` and `actstrip`) are expected to be set when NLA tweak mode
is enabled, BUT these are not exposed to RNA and thus invisible to the
library overrides system. As such, they are NULL when loading from disk,
while the `ADT_NLA_EDIT_ON` flag still indicates they are to be used.

Rather than adding a NULL pointer check (and having to add that in many
more places), I used this two-pronged approach:

- Extend the 'NLA tweakmode' override apply code, to set the `act_track`
  and `actstrip` pointers when they are incorrectly NULL. This is done
  by lookup of the track and strip by name.
- Add versioning code to exit out of tweak mode whenever the
  `ADT_NLA_EDIT_ON` flag is set, but those two pointers are still NULL.

The last step was necessary with the example file attached to the bug
report, as that was saved with a buggy blender version. New saves work
just fine.

Pull Request: https://projects.blender.org/blender/blender/pulls/119632
2024-03-19 10:45:32 +01:00
laurynas
15dbfe54e4 Curves: draw evaluated curves and handles in edit mode
This makes the edit mode drawing for the new curves data more similar
to the old edit mode. Specifically, it draws the evaluated curves now instead
of just a poly curve. Furthermore, it now draws bezier handles as well as
a separate control curve for nurbs curves.

Pull Request: https://projects.blender.org/blender/blender/pulls/119053
2024-03-19 10:39:05 +01:00
Pratik Borhade
1ef6d1a11b Merge branch 'blender-v4.1-release' 2024-03-19 14:58:56 +05:30
Pratik Borhade
43e968dc78 Fix #119612: Markers bar in NLA blocks view of final track in list
Mistake in a96f1208cc729f2b4cfaf8152f80d49f627c82b5.
When markers are present, offset should be added to the height.
Earlier it was subtracted like so `v2d->tot.ymin -= MarkerMargin` and that worked
because ymin is assigned like so `v2d->tot.ymin = -height`.
Now that the marker margin is added to the height it needs to be additive.

Pull Request: https://projects.blender.org/blender/blender/pulls/119647
2024-03-19 10:26:29 +01:00
Falk David
53b9d77109 Fix build error
This error was introuced by 5e2955d3cd.
Instead of trying to use the function name
with `__func__` use a string literal.
2024-03-19 10:11:44 +01:00
30711d1398 Fix #119623: Anim: unintended API change in keyframe_insert() function
Bring back the `INSERTKEY_XYZ_TO_RGB` enum item for the
`keyframe_insert()` function (it was removed in 30b0c5b225). This way
any Python code that targets Blender 4.x can safely pass this flag,
without having to check specific Blender versions.

Note that the flag is implemented as a no-op, as the behaviour change
introduced in 30b0c5b225 (just looking at the user preference) is still
retained. The purpose of this commit is simply to avoid the `ValueError`
exception that would otherwise be raised.

This should also fix Rigify report blender/blender-addons#105241.

Pull Request: https://projects.blender.org/blender/blender/pulls/119625
2024-03-19 10:05:22 +01:00
Falk David
5e2955d3cd GPv3: Multithread fill triangulation
This became a bottleneck in one of the test files during playback.

A grease pencil object was using an array modifier which tags the triangle
caches to be invalidated. Then it re computed the fills on every frame, which
was slow (when single threaded).

With this patch, the playback went from ~43fps to 60+fps.

Pull Request: https://projects.blender.org/blender/blender/pulls/119531
2024-03-19 09:52:15 +01:00
Campbell Barton
a535524fe1 Fix #119500: Installing an Extension via dragging has no feedback
Call the install operators directly instead of using bpy.app.handlers.
Now reports from installing are in the status bar.
2024-03-19 18:12:10 +11:00
Iliya Katueshenock
5319e6af7b Fix: Geometry Nodes: Separate Transform node
Fix of wrong destination for scale and non-normalized rotation matrix.

Pull Request: https://projects.blender.org/blender/blender/pulls/119602
2024-03-19 05:29:38 +01:00
Campbell Barton
38dc888d7f Cleanup: use ELEM macro, remove redundant "struct" 2024-03-19 14:17:47 +11:00
Campbell Barton
8ac9b4ca46 Cleanup: use full sentences for code-comments
Also correct references source files.
2024-03-19 13:57:00 +11:00
Campbell Barton
076b2ecf70 Fix debug argument detection reading arguments after --command 2024-03-19 13:49:25 +11:00
Hans Goudey
bb4271459f Fix: Build error from missing include in legacy mesh conversion
The include was removed by a cleanup in main, not in 4.1.
2024-03-18 18:35:32 -04:00
Harley Acheson
061a9ee885 UI: Add Optional Flags for Tooltip Image Fields
Add more flexibility to tooltip images by adding the ability to specify
if (one of two) checkerboards are added, border, premultiplied
blending, or recoloring.

Pull Request: https://projects.blender.org/blender/blender/pulls/119437
2024-03-18 22:17:45 +01:00
Hans Goudey
5001a1a4a7 Merge branch 'blender-v4.1-release' 2024-03-18 16:44:47 -04:00
Hans Goudey
51cdf665ab Fix #119520: Auto smooth modifier added unnecessarily with bevel
If the bevel "Harden Normals" option is on, custom normals will be
generated. In that case, the automatic sharp edge tagging based on the
angle shouldn't run. This PR extends the earlier fix to #116395 to
handle this case and also extends the check to not just check the last
modifier, which doesn't work in this test file which has a collision
modifier at the end. That makes sense anyway, since what we really care
about is whether the evaluated mesh has custom normals or not.

Pull Request: https://projects.blender.org/blender/blender/pulls/119638
2024-03-18 21:43:22 +01:00
Miguel Pozo
58eab5e3be EEVEE-Next: Disable viewport motion blur outside of playback
Avoid motion blur on regular scene editing.

Pull Request: https://projects.blender.org/blender/blender/pulls/119484
2024-03-18 20:39:38 +01:00
Hans Goudey
5bfe6ad8f8 Fix: Various issues with auto smooth versioning
This PR fixes several issues with the versioning that replaces the old
auto smooth flag with a modifier.

One issue is that the flag wasn't cleared in the initial versioning
code. That means some objects have the replacement modifier but their
meshes still have the flag set. The fix for that is to make the
versioning idempotent by trying to find an existing node group before
adding a new one. The versioning is now re-run on all objects to clear
the flags. Flags on all meshes are cleared too, even unused meshes.
That could cause loss of the auto-smooth when the mesh is linked from
a different blend-file, but that situation should be very rare.

Another issue was that the versioning wasn't run when linking objects.
That was simple to solve by adding the versioning where the proxy
versioning already existed for that case.

Finally, arguably the largest issue was that the the newly added node
groups were always added as local data-blocks. When linking, having
library data-blocks point to local data-blocks not in that library is
quite bad and breaks assumptions around Blender. This is solved by
having an auto smooth node group per library.

Resolves #119516, #119455, #119447

Pull Request: https://projects.blender.org/blender/blender/pulls/119539
2024-03-18 20:15:36 +01:00
Julian Eisel
0d7ac2542e Merge branch 'blender-v4.1-release' 2024-03-18 19:37:56 +01:00
Julian Eisel
745fd2a2cb Fix: Tree-view items always collapsed by default
Since 660867fa00, having tree-view items uncollapsed by default using
the `set_collapsed()` functions wouldn't work anymore. An attempt to do
this would assert even, so eb71d9f7bc disabled the assert.

I think a function designed to handle exactly this is the best solution,
it makes the intent & behavior more clear than before, and highlights
that this is a special case.

Mitigates #117957, in that it solves the regression, but tree-views still
don't remember their state on screen-layout changes. This is a known
limitation and not supported.

Pull Request: https://projects.blender.org/blender/blender/pulls/119166
2024-03-18 19:32:53 +01:00
Jeroen Bakker
8945b29762 EEVEE: Overscan/Border mixed resolution rendering
Mixed resolution rendering had some issues with overscan and border
rendering.

- `render_offset` was in display space and not in render space. Is
  now replaced by the `overscan_extent`.
- `overscan_extent` introduced that stored the overscan of the render
  extent.
- Fixed issues to determine the film sample weight when `scaling_factor`
  was used. It didn't match decompose the actual offset making the
  length of the same to large, what blurred the final samples.

NOTE: there are some other issues related to border rendering which was
already in main before mixed resolution rendering was added. I assume
that viewport render image in camera view still adds an additional
offset, which should be ignored.

Fixes #119510
Fixes #119511

Pull Request: https://projects.blender.org/blender/blender/pulls/119524
2024-03-18 16:02:57 +01:00
Brecht Van Lommel
7a395e2e7f Revert changes from main commits that were merged into blender-v4.1-release
The last good commit was f57e4c5b98c075f3dfc61faebbcb43c99a778956.

After this one more fix was committed, this one is preserved as well:
67bd678887d7f8aec9f3b23bbf1aaf29f80d0da4.
2024-03-18 15:04:12 +01:00
Jacques Lucke
ce9fee394d Merge branch 'blender-v4.1-release' 2024-03-18 14:43:18 +01:00
Jacques Lucke
67bd678887 Fix #119578: crash when node tool does not have geometry as first output socket
This was simply missing a check and error message. The same error message
is shown when the node group is used as modifier.

Pull Request: https://projects.blender.org/blender/blender/pulls/119604
2024-03-18 14:36:43 +01:00
Jacques Lucke
42093bbe3d Nodes: have either input or output socket in declaration
Support for having an input and output socket in the same socket declaration
builder was added for the original node panels to be able to support inline
sockets. However, those were generally disabled for now. As can be seen in the
simulation and repeat zone, inline sockets can work differently too. Having an
input and output in the same socket declaration builder builder makes some
things simpler but makes other things much harder. For example, the current
design wouldn't work all that well if the input and output socket has different
types. This is easier to do with the `align_with_previous_socket` approach.

I'm not yet entirely sure whether we want to use the same approach for
corresponding sockets in the node tree interface, but that can be tried and
decided separately.

Pull Request: https://projects.blender.org/blender/blender/pulls/119599
2024-03-18 14:36:03 +01:00
Jacques Lucke
5da0363013 Fix #119617: crash because node sockets depend on experimental feature flag
This was caused by 62bd0ea5fde55a696e0a8353249ed4964d62984d. Now the socket is
always created but made unavailable if the feature is disabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/119620
2024-03-18 13:57:16 +01:00
Jason Fielder
661d12aef7 Fix #119195: Ensure Metal uses correct attribute conversion mode
Resolves custom attribute types for ints and booleans by ensuring
conversion mode is correct. Previously, the attribute declarations
were assumed to be linear. However, patch ensures the correct
attribute index is now fetched, ensuring the conversion mode
is correctly specified for non-linear attribute ID's.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/119569
2024-03-18 13:38:09 +01:00
Philipp Oeser
5ba581bd0a Fix #119523: Missing driver bone target doesn't mark driver as invalid
If a bone was specified (but now missing), the driver would fallback to
using the object as a target (which can lead to unintended behavior).

So now check if a bone is specified, if it is missing, mark the driver
invalid. If no bone is specified at all, then use the armature object as
the target.

NOTE: `DTAR_FLAG_INVALID` is not granular enough to distinguish the
object and bone targets, so both will be marked in red in the UI (there
is already comments about it in code). If necessary, we could introduce
an additional DTAR_FLAG_BONE_INVALID and use that in a couple of places.

Pull Request: https://projects.blender.org/blender/blender/pulls/119533
2024-03-18 12:48:43 +01:00
Falk David
a3243172bf GPv3: Switch back to the current grease pencil render engine
This makes it so GPv3 objects are rendered using the current grease pencil render engine.

A new `gpencil_next` engine was added at the beginning of the project, but it couldn't
be finished in time. This commit removes the `gpencil_next` engine as it is no longer
used. The current status of the new engine been pushed to the `gpencil-next` branch on
the `blender` repository.

Note: Onion skinning is not supported yet. This work will be done in a separate PR.

Fixes #115467 and #116347.

Pull Request: https://projects.blender.org/blender/blender/pulls/118664
2024-03-18 12:01:15 +01:00
Pratik Borhade
b3095d9c2e Merge branch 'blender-v4.1-release' 2024-03-18 14:43:15 +05:30
Kamil Galik
d739d27a2d Fix #119203: Change default NDOF Deadzone value
There is a Deadband built in the sensor of SpaceMouse,
therefore the default value of Deadzone field can be equal to 0.0
instead of 0.100.

Pull Request: https://projects.blender.org/blender/blender/pulls/119522
2024-03-18 10:10:21 +01:00
Jacques Lucke
e4e4b51c83 Fix: add missing socket type in forward declaration list
Not quite sure how I missed this before. It's quite unfortunate that this
causes issues like #119179 in Blender 4.0.
2024-03-17 19:08:40 +01:00
Jacques Lucke
ee1fa8e1ca BLI: support set operations on index masks
The `IndexMask` data structure was designed to allow us to implement set
operations like `union`, `intersection` and `difference` efficiently
(2cfcb8b0b805401a0ffb252fd41750fadb0392ab). This patch adds an evaluator for
arbitrary expressions involving the mentioned operations. The evaluator makes
use of the design of the `IndexMask` data structure to be quite efficient.

In some common cases, the evaluator runs in constant time. So it's very fast
even if the mask contains many millions of indices. If possible the evaluator
works on entire segments at once instead of looking at the individual indices.
This results in a very low constant factor even if the evaluation time is
linear. If the evaluator has to look at the individual indices to be able to
perform the operation, it can make use of multi-threading.

The evaluation consists of the following steps:
1. A coarse evaluation that looks at entire segments at once.
2. All segments that couldn't be fully evaluated by the coarse evaluation are
   evaluated exactly by looking at the actual indices. There are two evaluators
   for this case. One that is based on `std::set_union` etc. The other one first
   converts the index masks to bit spans, then does bit operations to evaluate
   the expression, and then converts the bits back into indices. Depending on
   the expression, one or the other can be more efficient.
3. Construct an index mask from the evaluated segments.

Showing the performance of the evaluator is kind of difficult because it highly
depends on the input data. Comparing the performance to something that does not
short-circuit when there are full ranges is meaningless, because one can
construct an example where the new evaluator is arbitrarily faster. I'm still
working on a case where performance can be compared to e.g. using
`std::set_union`. This comparison is only fair when the input data when
constructing a case where the new evaluator can't short-circuit.

One of the main remaining bottlenecks are the calls to `slice_content` on large
index masks. I think the impact of those can still be reduced.

We are not using this evaluator much yet, except through `IndexMask::complement`
calls. I intend to use it when I get to refactoring the field evaluator for
geometry nodes to optimize the evaluation of selections.

Pull Request: https://projects.blender.org/blender/blender/pulls/117805
2024-03-17 09:52:32 +01:00
Jason Fielder
6768ded895 Fix #118868: Metal render pass output for EEVEE Next
Resolves render pass export for EEVEE Next on Metal.
Reads from texture views was previously utilising the
root texture rather than the view variant, resulting
in views into texture arrays being incorrectly sampled.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/119563
2024-03-16 20:16:37 +01:00
Harley Acheson
bec9b4bc4b UI: Update Polls on Single Repository Sync and Upgrade
The buttons to sync and update individual repositories only work for
remote repositories. This PR just updates their poll functions to
disable them for local repos.

Pull Request: https://projects.blender.org/blender/blender/pulls/119568
2024-03-16 20:00:49 +01:00
Brecht Van Lommel
b8ea467475 Merge branch 'blender-v4.1-release' 2024-03-16 19:45:51 +01:00
Guillermo Venegas
1058006e03 Fix #119549: Avoid resetting properties tagged as SKIP_PRESET
Excludes properties tagged as `SKIP_PRESET` from being reset.

Pull Request: https://projects.blender.org/blender/blender/pulls/119550
2024-03-16 19:34:49 +01:00
Harley Acheson
8770299406 UI: Option for Separate Extension Dev Tools
Experimental flag for "Extensions Development Utilities" that can be
enabled separately from "Extensions". Note this PR does not enable the
use of this flag (coming later) as uses are in addons-contrib. This
flag is requested in #119521

Pull Request: https://projects.blender.org/blender/blender/pulls/119562
2024-03-16 17:24:34 +01:00
Clément Foucault
38b180f236 EEVEE-Next: Shadow: Hide banding artifact at projection edges
This affect all local lights (non-sun light).

We hide the artifact caused by different tracing results from
two adjacent projection. This is visible as the shading point
switches projections.

We fix this by randomizing which shadow map projection (face)
to trace. We do that by using the point at half the ray instead
of the shading point to choose the projection. This gives
a soft enough look proportional to the light shape.
This also has the benefit of being stupidly simple.

Pull Request: https://projects.blender.org/blender/blender/pulls/119555
2024-03-16 15:20:46 +01:00
Iliya Katueshenock
62bd0ea5fd Fix: Geometry Nodes: GPv3 component is always in Separate Component node
Makes sure the GPv3 component doesn't show up unless the experimental
flag is set.

Pull Request: https://projects.blender.org/blender/blender/pulls/118915
2024-03-16 14:03:13 +01:00
Harley Acheson
66a40c0e04 UI: Use Internet Icon for Repo Add menu
In Preferences / Extensions / Repositories / Add, show the correct
"Internet" icon on the menu item for remote repository.

Pull Request: https://projects.blender.org/blender/blender/pulls/119541
2024-03-15 21:44:33 +01:00
Brecht Van Lommel
971e82b93a Merge branch 'blender-v4.1-release' 2024-03-15 21:13:19 +01:00
Hans Goudey
ba430d1d22 Revert "Fix #119455: Auto smooth versioning on append applies to existing IDs"
This reverts commit c6497dd9f7632db2035b3c265000c22b8e1b56ed.

This wasn't working the way I expected, it seems the LIB_TAG_NEW isn't
set here. Better to address the fundamental issues anyway. Sorry for
the noise.
2024-03-15 15:25:13 -04:00
Harley Acheson
a4a26bf90d UI: Small Confirmation Position
For small confirmations that appear at mouse position, change the
position slightly so that the mouse pointer is less likely to obscure
the confirm button text.

Pull Request: https://projects.blender.org/blender/blender/pulls/119536
2024-03-15 19:52:46 +01:00
Hans Goudey
e2e26d3872 Merge branch 'blender-v4.1-release' 2024-03-15 13:58:12 -04:00
Hans Goudey
c6497dd9f7 Fix #119455: Auto smooth versioning on append applies to existing IDs
When appending objects from an older file, versioning needs to run to add
an auto smooth modifier if necessary. However, this was running for all
objects rather than just the newly appended objects. It's quite wrong to
modify existing objects here, so add an explicit check for that. This could
improve performance as well, but skipping checks for objects when
the work is unnecessary.

The crash will hopefully be resolved by other improvements to the auto
smooth versioning (making it properly idempotent and running it again
should fix the problem with the hidden legacy flags still set). But I still think
this PR is worth committing, to be very explicit about only modifying new
objects in versioning code.

Pull Request: https://projects.blender.org/blender/blender/pulls/119467
2024-03-15 18:47:39 +01:00
Hans Goudey
a869bae1dc Merge branch 'blender-v4.1-release' 2024-03-15 11:50:04 -04:00
Hans Goudey
1111903416 Fix #119446: Incorrect auto smooth versioning for subsurf modifier
Previously I misunderstood the subsurf modifier's handling of custom
normals. The "use custom normals" check in 4.0 checked if there were
custom normals and whether the auto smooth flag was checked. I wrongly
changed that to check the mesh normals domain instead of whether there
was custom normals. In 4.1, auto smooth isn't required to use custom
normals, but that should be the only change here.

In this PR, that change is done for CPU and GPU subdivision, and for
the versioning which adds a modifier. The versioning now only puts the
new modifier before the subsurf modifier if it would have used the
custom normals interpolation in 4.0.

The last change causes two test failures which I also misunderstood
before. The previous results were arguably incorrect, because the
Cycles experimental adaptive subdivision ignored the auto smooth
angle, which was 5 degrees. It should have been 180 degrees.
I will modify those test files to remove auto smooth from the meshes.

Pull Request: https://projects.blender.org/blender/blender/pulls/119485
2024-03-15 11:32:50 -04:00
Jeroen Bakker
17a70be68d EEVEE-Next: Mixed resolution with orthographic projection
When using mixed resolution rendering with an orthographic projection
the display was not correct. The reason was that the view boundaries
were decomposed from the winmat correctly, but when re-composing
the matrix it assumed to be in perspective.

This is fixed by composing an orthographic winmat when it was sourced
from a orthographic winmat.

Fixes #119514

Pull Request: https://projects.blender.org/blender/blender/pulls/119517
2024-03-15 15:58:27 +01:00
Aras Pranckevicius
ce5f864027 Merge branch 'blender-v4.1-release' 2024-03-15 16:55:41 +02:00
Aras Pranckevicius
52a8bea237 Fix #119505: artifacts in VSE vectorscope
On some GPUs/drivers (seemingly nvidia) and screen sizes, VSE
vectorscope and sometimes waveform have "garbage" artifacts around
them.

Root cause unknown (driver bug?), for now similar fix as a while ago
in #112665: explicitly draw opaque background (with alpha=1), and then
use alpha blending for the scopes texture display on top of that.

Pull Request: https://projects.blender.org/blender/blender/pulls/119512
2024-03-15 15:53:25 +01:00
Hans Goudey
130701763b Fix #119508: Missing update after "Shade Flat" operator
An alternative fix would be calling `update_on_change_` in the
attribute `try_create`function, but sticking with this more
conservative fix seems better for 4.1.

Pull Request: https://projects.blender.org/blender/blender/pulls/119515
2024-03-15 15:36:56 +01:00
Sergey Sharybin
444bc3154a Merge branch 'blender-v4.1-release' 2024-03-15 15:24:52 +01:00
Sergey Sharybin
e2d7bd199e Fix #119427: UI: The Metadata is gone for the rendered image
This is a regression since d579ac2b3f

Ensure that the image buffers used by render passes have metadata at the
end of render, similarly to how stamping happens. This solves the reported
issue, and makes the metadata behave consistently, independent on how the
image buffer is accessed.

Thanks Philipp Oeser for investigation and pin-pointing the bad commit!

Pull Request: https://projects.blender.org/blender/blender/pulls/119503
2024-03-15 15:24:33 +01:00
Philipp Oeser
16015ae507 Merge branch 'blender-v4.1-release' 2024-03-15 15:12:22 +01:00
Philipp Oeser
218c02abc4 Fix #119502: Image metadata misses background box
Since 4a78d7dc4c9b blending is turned ON, but apparently the background
color is not receiving full alpha in this scenario.

Resolve by using immUniformThemeColorAlpha (with 1.0 alpha)

Pull Request: https://projects.blender.org/blender/blender/pulls/119504
2024-03-15 15:11:53 +01:00
Philipp Oeser
e81cf496cf Merge branch 'blender-v4.1-release' 2024-03-15 15:06:11 +01:00
Jacques Lucke
9fc8ce49f5 Fix #119464: missing update after socket reorder
Without the update tag, the tree topology cache is not recomputed.

Pull Request: https://projects.blender.org/blender/blender/pulls/119506
2024-03-15 15:00:53 +01:00
Germano Cavalcante
247524bb35 Fix: UV Edge Slide sometimes fails to detect correct direction
In this case, the situation in which edges share faces connected to
each other could fail as it could pass through a slide edge.
2024-03-15 10:37:59 -03:00
Pratik Borhade
47940cdb5b GPv3: Insert duplicate keyframe when erasing
When drawing is visible in 3d-view and playhead is not over keyframe, in
such case erase tool is erases everything (or let's say it adds empty
keyframe). Erasing works correctly if additive drawing is enabled but
this is also expected to work when additive drawing is disabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/119051
2024-03-15 12:12:21 +01:00
Jeroen Bakker
96a8f5b36c Fix: EEVEE-Next: Quick fix for overscan
With the recent changes introduced by the mixed resolution rendering
overscan and border rendering broke. Overscan is also used by the test
cases and fails the current tests.

This is a quick fix to get the overscan working.

NOTE: overscan + mixed resolution rendering will look blurry.
NOTE: this doesn't fix border rendering.
2024-03-15 12:06:03 +01:00
Aras Pranckevicius
6826efdb02 Fix #119456, #119493: VSE adjustment/text strips do not update in some cases
As part of PR #118396 the "generator" effect strips (color, text,
adjustment) also started to put their "raw" images into the cache.
However, seq_cache_timeline_frame_to_frame_index that has optimization
that tries to use only one cache entry based on how many frames are
present in the strip was not expecting to see effect strips, ever.

As a result, something like adjustment layer would effectively just
cache a single frame, since it has no "source frames" to speak of.

Fixed that by only doing this optimization for non-effect strips.
2024-03-15 10:37:30 +02:00
Campbell Barton
0b9ef9ee2a Fix missing newline from bpy.utils.register_cli_command doc-string 2024-03-15 13:45:06 +11:00
Sean Kim
2e6a8ae49c Cleanup: Add docs to lasso and line gesture
This PR adds an explanation to the Lasso Gesture doxygen
section of the generic `wm_gesture_ops.cc` file.

Pull Request: https://projects.blender.org/blender/blender/pulls/119490
2024-03-15 00:27:12 +01:00
Hans Goudey
15c060548a Fix: Build error in lite build after boolean change 2024-03-14 18:50:25 -04:00
Hans Goudey
972c52feb9 Cleanup: Use enum class for boolean operation
Similar to the recently introduced `Solver` enum. This is just friendlier
and doesn't require including `DNA_node_types.h` in the geometry
module header. There's no strong benefit to declaring these enums in
DNA in practice.
2024-03-14 17:24:27 -04:00
Harley Acheson
a9d5833f29 UI: No Default Icon for Small Python Confirmations
With #118346 we want the new small confirmations to have no icon by
default. I forgot to set this as the default when called via Python.

Pull Request: https://projects.blender.org/blender/blender/pulls/119489
2024-03-14 21:45:07 +01:00
Harley Acheson
3d85765e14 UI: Position of Tooltips for Labels
Move tooltip position to mouse position rather than bottom of the
region for labels that are taller than one line.

Pull Request: https://projects.blender.org/blender/blender/pulls/117879
2024-03-14 21:35:11 +01:00
Howard Trickey
e3f030cce6 Geometry Nodes: Add float solver to mesh boolean node
This adds a "Solver" option to the geo boolean node, with the options
Exact and Float.
The current geo boolean node only uses the Exact solver.
This adds the ability to use the faster original floating point boolean solver.
The float solver has issues with coplanar and other coincident geometry,
but is generally much faster than the Exact solver, and users have asked
for this option (which is available in the Boolean Modifier and edit mode
boolean tool).

Like the modifier, the Float solver needs to convert the Mesh to BMesh,
do the operation, and then convert back to Mesh. It also has to do it
iteratively if more than two operands are supplied.

This is the first of a planned series of commits that will add a
new exact boolean solver, based on the Ember paper, as a solver option.
Ember will be much faster than the current exact solver, but may still not
be as fast as float, and also will not handle some non-volume-enclosing
inputs as well as Float, so it is likely that the Float solver will always remain.
We may eventually retire the old Exact Solver, however.

This commit also prepares for more sensible code in the future by
changing the internal enum names for the solvers to better reflect the
algorithms used: Fast -> Float, and Exact -> Mesh_Arr (which means
"Mesh Arrangments, the name of the paper upon which the current
exact solver is based).

Co-authored-by: Howard Trickey <trickey@google.com>
Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/119294
2024-03-14 20:49:57 +01:00
Harley Acheson
08cd80a284 Fix #118066: File Browser List View Tooltips
In File Browser list view show tooltips for both the icon and the name
portion of the line to consistently show them no matter where you hover

Pull Request: https://projects.blender.org/blender/blender/pulls/118071
2024-03-14 20:20:50 +01:00
Jason Fielder
6b56ed3cd3 Metal: Resolve artifact in EEVEE Next Film Cryptomatte
Cryptomatte passes would generate a feathered outline
in Metal due to missing texture fence in chained
read->modify->write->read->... patterns.

Added imageFence function to explicitly state that
imageStore's should be visible to future imageLoad's.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/119163
2024-03-14 17:48:30 +01:00
Falk David
8b01578826 GPv3: Expose stroke depth order setting in the UI
This exposes the `stroke_depth_order` setting.
The enum is added to a `Settings` panel in the object-data properties.
2024-03-14 17:26:14 +01:00
Falk David
3cc933d024 GPv3: Conversion: Convert some object-data flags
This adds conversion for the following flags:
- `GREASE_PENCIL_ANIM_CHANNEL_EXPANDED`
- `GREASE_PENCIL_AUTOLOCK_LAYERS`
- `GREASE_PENCIL_STROKE_ORDER_3D`

Note: The last two are not expose through the UI yet.
2024-03-14 17:26:14 +01:00
Harley Acheson
7a13f0a14d Merge branch 'blender-v4.1-release' 2024-03-14 09:23:14 -07:00
Harley Acheson
479342b1cf UI: Correct Splash RGB Image Corner Rounding
Our splash screen rounds the top corners of the featured image. However
this requires an alpha channel, so an RGB image will not look rounded.
This PR just ensures a 32 plane count.

Pull Request: https://projects.blender.org/blender/blender/pulls/119473
2024-03-14 17:22:22 +01:00
Sergey Sharybin
74d948097f Merge branch 'blender-v4.1-release' 2024-03-14 17:11:45 +01:00
Raul Fernandez Hernandez
62b0c461fb Fix #87243: Crash after undo "Mask slice to new object"
Fix for a crash after undo "Mask slice to new object"

When creating a new mesh object in the mask slice operator in
sculpt mode it caused a crash when undo to the initial undo step.
Moreover saving the sculpt undo state seems not necessary in
this function since undo/redo doesn't really work reliably for this
operator from the start, but there is nothing can be done about it
without systemic changes.

Note: this PR replaces #119401
Pull Request: https://projects.blender.org/blender/blender/pulls/119443
2024-03-14 17:10:28 +01:00
Sergey Sharybin
6aa21ed752 Fix: incorrect GPU ownership after IMB_dupImBuf
The IMB_dupImBuf() function does not copy the GPU texture as it might
not be possible if the GPU context is not active, but it also was not
clearing the pointer in the result ImBuf. This could potentially lead
to situation when the texture gets freed via IMB_freeImBuf of either
original or copied image buffer, leaving the other pointing to a freed
GPU texture.

It is not known whether it ever was an actual problem for artists,
but it is nice to avoid such possibility.

Pull Request: https://projects.blender.org/blender/blender/pulls/119469
2024-03-14 17:09:33 +01:00
Raul Fernandez
2e7395e07b Fix #87243: Crash after undo "Mask slice to new object"
Fix for a crash after undo "Mask slice to new object"

When creating a new mesh object in the mask slice operator in
sculpt mode it caused a crash when undo to the initial undo step.
Moreover saving the sculpt undo state seems not necessary in
this function since undo/redo doesn't really work reliably for this
operator from the start, but there is nothing can be done about it
without systemic changes.

Note: this PR replaces #119401
Pull Request: https://projects.blender.org/blender/blender/pulls/119443
2024-03-14 17:01:49 +01:00
Falk David
6a320524b9 Fix: GPv3: Function use_masks returns wrong value
This fixes an issue where the `use_masks` functions on layers
and groups returned the wrong value.
The issue was that the root group doesn't have this flag set
which then propagates to all the layers and groups.
To fix this we invert the `GP_LAYER_TREE_NODE_USE_MASKS` flag (now called `GP_LAYER_TREE_NODE_HIDE_MASKS`).

The API still uses the `use_masks` function.
2024-03-14 15:25:23 +01:00
af7a68d31f Refactor: reduce indentation in ANIM_nla_mapping_get()
Flip conditions and use early returns to simplify `ANIM_nla_mapping_get()`.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/119463
2024-03-14 15:10:01 +01:00
Jason Fielder
0ac7dd966c Metal: Chunked loop unroll for lightprobe sample
The Metal shader compiler was previously fully unrolling
lightprobe sampling, resulting in long compile times of
70+ seconds and high instruction counts.

Implementing Chunked unrolling to retain benefits of
unrolling e.g. latency hiding, while reducing register
pressure and improving compile time significantly.
(Only 800ms vs 70,000ms).

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/119333
2024-03-14 14:21:08 +01:00
Brecht Van Lommel
f131709122 Merge branch 'blender-v4.1-release' 2024-03-14 14:12:05 +01:00
Brecht Van Lommel
e9ca817d5f Fix #119419: Crashes with incompatible OpenColorIO configs
* If required roles are not found, refuse to load the config
* Use "default" role as fallback for all roles, following the
  OpenColorIO docs.
* Use bundled config if loading environment config fails,
  instead using very limited fallback config.
* Fix OCIO_exit get called on failed config load, causing
  crash when trying to load the next config.

Pull Request: https://projects.blender.org/blender/blender/pulls/119435
2024-03-14 14:08:56 +01:00
Brecht Van Lommel
a887ec8f38 Cleanup: Move variable definitions closer to use, other style tweaks
Pull Request: https://projects.blender.org/blender/blender/pulls/119435
2024-03-14 14:08:12 +01:00
Falk David
a5229ed125 GPv3: Add layer masks operators and UI
Layer masks were partly already there. This PR completes the implementation and expose them through the UI.

This also adds three operators to:
- add a layer mask
- remove a layer mask
- reorder layer masks

Note: These are not used by the renderer yet. Will be done in a following PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/119433
2024-03-14 14:07:37 +01:00
Falk David
66968e37fa GPv3: Add layer blend mode to the UI
Adds the `blend_mode` property to RNA and exposes it in the UI.

Note: This is not used by the renderer yet. Will be added in a following PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/119460
2024-03-14 14:05:29 +01:00
Hans Goudey
6072a641ee Cleanup: A few small tweaks in asset library code
- Fix a typo
- Remove unnecessary namespace specification
- Use "this" to access class methods
2024-03-14 08:49:21 -04:00
Hans Goudey
961d8ef6d5 Fix #119426: Enabling dyntopo creates duplicate mask attribute
The CustomData API automatically creates a unique attribute with
a unique name for generic data types. Caused by f2bcd73bd25625d6b5c1.

Pull Request: https://projects.blender.org/blender/blender/pulls/119441
2024-03-14 13:22:08 +01:00
Christoph Lendenfeld
fc025abde6 Anim: Use Theme for Motion Path points
This PR changes the motion path appearance by using the
`Vertex` color as defined in the 3D viewport theme settings
instead of hardcoding it to white.

The issue with setting it to white is that it is too visually distracting,
overshadowing the points that are keyframes, which are drawn in
the selection color for vertices (also defined in the Theme)

Pull Request: https://projects.blender.org/blender/blender/pulls/119382
2024-03-14 13:14:20 +01:00
Omar Emara
a3587ee078 Fix: Anti-Aliasing node contrast limit has no effect
The Anti-Aliasing node contrast limit has no effect. This is due to a
typo in the code, where the threshold was used internally as the
contrast limit instead.
2024-03-14 11:53:43 +02:00
Campbell Barton
61dd7cc117 Transform: restore default rotation snapping increments
Use snapping increments matching values used before this was
customizable. [0] changed snapping increments from 5 degrees to 15,
from 1 to 5 degrees with precision enabled.

[0]: 060174cf149c2b05ce09a0dfed33005f1fe15c28
2024-03-14 20:15:28 +11:00
Falk David
a07a558ac5 GPv3: Add view layer name property
This adds the `viewlayername` property to grease pencil v3 layers.
It's exposed as `viewlayer_render` in python.

Note: this is not used in the renderer yet. Will be used in a following PR.
Pull Request: https://projects.blender.org/blender/blender/pulls/119422
2024-03-14 10:15:07 +01:00
Jason Fielder
ecffea86b1 Metal: Fix Storage buffer read sync affecting surfels
Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/119093
2024-03-14 09:40:59 +01:00
Campbell Barton
09666e1498 Fix #119387: Precision transform fails to activate
Regression in [0] caused precision fail to activate in the graph editor
and when pressing shift then control (#119395).

[0]: 060174cf149c2b05ce09a0dfed33005f1fe15c28
2024-03-14 11:20:19 +11:00
Pratik Borhade
847d369fbb Fix #119271: Update stats when switched between workspaces
When workspace is switched, send notifier to clear `view_layer->stats`
then update the stats with repsect to new object interaction mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/119418
2024-03-14 00:42:21 +01:00
Harley Acheson
7852e0a551 Merge branch 'blender-v4.1-release' 2024-03-13 15:02:59 -07:00
Guillermo Venegas
1640121a63 Fix #119183: Use valid style for popup text size calculation
The current font style can be overridden with a input or other widget text style,
this change ensures that the right font style is set so `BLF_width` don't use a
overridden font text style.

Pull Request: https://projects.blender.org/blender/blender/pulls/119442
2024-03-13 23:01:58 +01:00
Iliya Katueshenock
d562a9ce43 Fix #118883: Face Corner component shows in Delete Geometry node
Pull Request: https://projects.blender.org/blender/blender/pulls/118917
2024-03-13 15:38:44 -04:00
Hans Goudey
b5082f6640 Refactor: Simplify BLI_serialize.hh for asset indexer
- Remove the unnecessary `ContainerValue` from the class hierarchy
- Construct `StringValue` with a `std::string` by value to avoid copies
- Remove some indirection by using type names directly instead of aliases
- Use utility methods to lookup/append specific data types for arrays/dicts
- Simplify conversion from unique_ptr to shared_ptr
- Avoid use of `new` and `delete`
- Avoid creating maps of all elements in vector for a single lookup
2024-03-13 14:52:57 -04:00
Hans Goudey
ae12c1bd92 Refactor: Remove unnecessary indirection from classes in asset indexer
The `AssetEntryReader` and `AssetEntryWriter` classes were only used
once and just added indirection hiding the actual logic of reading and writing
asset metadata from the index. It also hid double map lookups and extra
string copies/allocations.
2024-03-13 14:52:57 -04:00
Hans Goudey
24c9f736ff Cleanup: Follow style guide for use of "this" in classes
Also simplify iteration over map keys and slightly simplify string hash.
2024-03-13 14:52:57 -04:00
Germano Cavalcante
f6a581e28a UV: Vert and Edge Slide UI improvements
Changes:
- Add Vert Slide and Edge Slide to 'UV -> Transform' menu.
- Add a separator for Vert Slide and Edge Slide in the context menu.
- Don't display the "Correct UVs" option in the Redo menu of UV Editor.
2024-03-13 12:16:19 -03:00
Germano Cavalcante
31745a53f4 Cleanup: early return & avoid compare strings unnecessarily
`transform_poll_property` can be smarter in the conditions.
2024-03-13 12:16:18 -03:00
Thomas Dinges
51a3c03072 Release: Bump to 4.1 RC.
Splash screen by Lynxsdesign
2024-03-13 15:52:53 +01:00
Hans Goudey
6b671c4b54 Cleanup: Use simpler lambda capture
It's typically only worth specifying specific captures when the lambda
is stored as a function object for use later. Since this is just passed
as a FunctionRef as an iteration callback, we can use a less complex
capture here. That also helps clarify that this isn't a callback.
2024-03-13 10:42:00 -04:00
Germano Cavalcante
03735d0339 Fix #119244: Auto-Depth fails when we have arrow gizmos in the 3D View
Caused by dd0e60fb51

That commit was an optimization attempt to reuse the depth buffer
updated by the engines.

But it fails when `GPU_clear_depth` is called for gizmos.

So, due to error proneness, revert that solution for now.
2024-03-13 10:50:14 -03:00
Jacques Lucke
9a127a967b Merge branch 'blender-v4.1-release' 2024-03-13 13:50:17 +01:00
Jacques Lucke
61aaf95709 Fix #119406: Node tools don't work in edit mode with unselected object
It's possible for an object to be in edit mode without being selected. Use the
`FOREACH_OBJECT_IN_MODE_BEGIN` iterator to find all objects in the mode instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/119412
2024-03-13 13:49:35 +01:00
Jacques Lucke
43dbb98625 Merge branch 'blender-v4.1-release' 2024-03-13 13:29:28 +01:00
Jacques Lucke
297157e1c7 Fix #119241: setting edge selection does not work correctly
This was likely a typo in bd4c310a1905f53645aa0fd969ed8999a6a881e7.

Pull Request: https://projects.blender.org/blender/blender/pulls/119413
2024-03-13 13:25:23 +01:00
Jeroen Bakker
f0f911590e EEVEE-Next: Viewport pixel size with up-sampling
EEVEE-Next performes less on integrated GPUs then discrete GPUs.
Most shaders have been analyzed, but there will always be bottlenecks
related to architectural differences.

In order to make EEVEE-Next run smooth on integrated GPUs this change
will implement viewport pixel size option similar to Cycles. The main difference
is that the samples will still be weighted and up-sampled to the final film
resolution. This makes the pixels not look squared in the viewport but will
resolve to something close to the results without up-scaling.

This improves the performance especially on integrated GPUs. The improvement
for discrete GPUs are less noticeable. See here the stats when playing
`rain_restaurant.blend` back on a RAPHAEL_MENDOCINO iGPU.

| Pixel size | Frames per second |
|------------|-------------------|
| 1x         | 0.25 FPS          |
| 2x         | 4.14 FPS          |
| 4x         | 6.90 FPS          |
| 8x         | 9.95 FPS          |

Related to: #114597
See PR for some example images.

Pull Request: https://projects.blender.org/blender/blender/pulls/118903
2024-03-13 12:00:24 +01:00
Jacques Lucke
f828f5d664 Merge branch 'blender-v4.1-release' 2024-03-13 10:45:13 +01:00
Jacques Lucke
48aec82426 Fix: memory leak when using node tool in mesh edit mode
Caused by b40a9ce60bff490c7cfffe1764654e48621e2430.

For the non-edit mode code path, the mesh is freed as part of
`BKE_mesh_nomain_to_mesh`.
2024-03-13 10:44:39 +01:00
Pratik Borhade
615eceb92e Merge branch 'blender-v4.1-release' 2024-03-13 14:20:48 +05:30
Pratik Borhade
0f751c7e7d Fix #119362: Bone collection visibility when moved to root collection
When bone collection is moved to root collection by drag-drop,
visibility of dropped collection is lost. This is due to missing flags
for the root bone collection which cleared `BONE_COLLECTION_ANCESTORS_VISIBLE`
flag of dropped bcol.

Pull Request: https://projects.blender.org/blender/blender/pulls/119366
2024-03-13 09:48:45 +01:00
Campbell Barton
499a2b2b4b Cleanup: remove double-space in exception message 2024-03-13 17:12:51 +11:00
Campbell Barton
571834457b Extensions: treat a new repo with a blank URL as local
Now there is no difference between omitting remote_path or passing
in an empty string.
2024-03-13 17:10:53 +11:00
Campbell Barton
924561680e WM: suppress prints when G.quiet is set 2024-03-13 15:33:02 +11:00
Harley Acheson
bc70b597fc UI: Use New Internet Icon
We recently added a new "Internet" icon, meant to represent internet
services and protocols generally, in contrast with the existing "url"
icon which can be seen as being http (web link) specifically.  This
PR just uses this icon for cloud storage uses and for remote extension
repository.

Pull Request: https://projects.blender.org/blender/blender/pulls/119409
2024-03-13 02:39:36 +01:00
Harley Acheson
42e7a720c9 UI: Add "Internet" Icon
Add an icon called INTERNET that looks like our current URL without the
mouse cursor, so it looks less specifically like a web document. So can
be used to represent other internet and cloud-based services.

Pull Request: https://projects.blender.org/blender/blender/pulls/119186
2024-03-13 02:13:07 +01:00
Harley Acheson
443ea628c5 UI: Changes to Small Operator Confirmations
Small operator confirmations get separate confirm and cancel buttons,
better descriptions and configurable confirm button text. But still
popup at cursor location and can be cancelled with mouse movement.

Pull Request: https://projects.blender.org/blender/blender/pulls/118346
2024-03-12 23:12:45 +01:00
Hans Goudey
77b6f5d7e3 Merge branch 'blender-v4.1-release' 2024-03-12 17:34:52 -04:00
Hans Goudey
885b116c75 Fix: Socket names in auto smooth versioning node group
The current naming for node groups is "Socket" rather than "Input".
Also remove translation which is unnecessary since these are just identifiers.
2024-03-12 17:33:47 -04:00
Hans Goudey
6cbdb9c242 Merge branch 'blender-v4.1-release' 2024-03-12 17:12:00 -04:00
Hans Goudey
9141a8cb25 Fix #119398: Weighted normal modifier "Keep Sharp" option missing versioning
The Weighted Normal modifier has a "Keep Sharp" option that used to
recalculate the sharp edge tags based on the mesh's smoothing angle.
To keep the same behavior, an auto smooth versioning modifier has to
be added before that modifier when the option is on.

Pull Request: https://projects.blender.org/blender/blender/pulls/119400
2024-03-12 22:08:19 +01:00
Hans Goudey
51c738da1b Cleanup: Mesh: Use updated "corner" name for variables 2024-03-12 14:55:58 -04:00
Hans Goudey
9cafccf004 Cleanup: Sculpt: Unify face PBVH node face index access
Remove one function from the API.
2024-03-12 14:55:58 -04:00
Hans Goudey
b91d0aa0b8 Cleanup: Sculpt: Remove useless comments 2024-03-12 14:55:58 -04:00
Hans Goudey
be2944a6b5 Cleanup: Sculpt: Retrieve data directly from mesh
Remove more use of the redundant storage in SculptSession here.
2024-03-12 14:55:09 -04:00
Sean Kim
08801e8930 Cleanup: Extract project gesture to separate file
This PR extracts the `SCULPT_OT_project_line_gesture` operator into its
own file and namespace out of the `paint_mask.cc` file and
`blender::ed::sculpt_paint::mask` namespace.

Pull Request: https://projects.blender.org/blender/blender/pulls/119394
2024-03-12 19:52:50 +01:00
Sean Kim
40dbe99dd9 Cleanup: Migrate face set gesture operators
This PR moves the `SCULPT_OT_face_set_lasso_gesture` and
`SCULPT_OT_face_set_box_gesture` operator out of the `paint_mask.cc`
file and `blender::ed::sculpt_paint::mask` namespace to
`sculpt_face_set.cc` and `blender::ed::sculpt_paint::face_set`.

Pull Request: https://projects.blender.org/blender/blender/pulls/119392
2024-03-12 19:06:14 +01:00
Germano Cavalcante
a56a975760 UV: Enable 'Set Snap Base' feature
Just like for objects in 3D View, UVs can also benefit from the
`Set Snap Base` feature (key `B`).
2024-03-12 14:35:52 -03:00
Hans Goudey
06bb8bce26 Cleanup: Remove unused includes 2024-03-12 13:32:01 -04:00
Sean Kim
ff34b5f44a Cleanup: Sculpt: Extract trim operators
This PR extracts the `SCULPT_OT_trim_box_gesture` and
`SCULPT_OT_trim_lasso_gesture` into a separate file and
namespace from `blender::ed::sculpt_paint::mask`.

Pull Request: https://projects.blender.org/blender/blender/pulls/119390
2024-03-12 18:24:51 +01:00
Hans Goudey
2c55835c52 Fix: UI: Rename "Bright" property to "Brightness"
"Bright" is an adjective, not a noun.
2024-03-12 13:19:31 -04:00
Hans Goudey
32bc206cc4 Merge branch 'blender-v4.1-release' 2024-03-12 13:18:27 -04:00
Hans Goudey
7d2d590f0e Fix #119307: Anchored multires mask brush broken
I ran into this issue a while ago too, where the vertex iteration
macro didn't process all of the vertices. I didn't figure it out yet,
but it makes more sense in the context of the surrounding code
to specialize this anyway.
2024-03-12 13:17:38 -04:00
Christoph Lendenfeld
1e70c29320 Fix: Slider not respecting bounds when snapping to increments
The issue was that the clamping to the bounds happened before the rounding to the increment step.
In the reported case this led to a divide by 0 error.
The fix is to do the increment first, then the clamp to bounds.

This was reported by Raymond Luc on #117287

Pull Request: https://projects.blender.org/blender/blender/pulls/119367
2024-03-12 17:42:14 +01:00
Jacques Lucke
68c5e35be1 Merge branch 'blender-v4.1-release' 2024-03-12 17:33:59 +01:00
Jacques Lucke
ac8835f18b Fix #119350: shifting text overlay text
The issue was that the object location was taken into account twice using
`object_to_world` and `ob->loc`.

Pull Request: https://projects.blender.org/blender/blender/pulls/119378
2024-03-12 17:32:52 +01:00
Sean Kim
1982cad490 Fix: update comparator for std::sort for NamedAttribute
This PR applies a fix for the comparator being passed into std::sort to
avoid potential Mac / libc++ issues as seen in #119189

Pull Request: https://projects.blender.org/blender/blender/pulls/119385
2024-03-12 17:31:02 +01:00
Hans Goudey
20fbaa455e Merge branch 'blender-v4.1-release' 2024-03-12 12:13:40 -04:00
Hans Goudey
3c3f1e6d62 Fix #117603: Auto smooth replacement versioning skipped for link/append
Unfortunately the only versioning code that can "properly" add data-
blocks is not run when linking or appending (`do_versions_after_setup`
has details). The versioning has to be done manually for this case.
Fortunately that is simple since the versioning function already just
operators on a main database.
2024-03-12 12:09:30 -04:00
Philipp Oeser
6bd97d0477 Merge branch 'blender-v4.1-release' 2024-03-12 17:03:27 +01:00
Philipp Oeser
2886859347 Fix #116262: Modal knife tool can crash if used on hidden object
This could happen if objects were hidden after going to editmode and
knife was used on them.

In that case, raycasting would (rightfully) fail, but there is a
fallback in place using the back-buffer selection method (in which the
hidden object is still present). So a face would be found, but this
makes all following code confusing/wrong since we are working with
coordinates / faces under the assumption there would be a valid/
corresponding object to it in `KnifeTool_OpData` > `objects` -- which is
not the case...

So to resolve, just check if the object is visible before calling
`EDBM_face_find_nearest` in knife code.

Alternativeliy, we could also add a check for Base viewport visibility
to all the bmesh `find_nearest` functions (a bit hesitant though since i
am not sure this would be desired in all cases)

Pull Request: https://projects.blender.org/blender/blender/pulls/119383
2024-03-12 17:02:35 +01:00
Hans Goudey
9d76f93451 Merge branch 'blender-v4.1-release' 2024-03-12 11:43:07 -04:00
Iliya Katueshenock
9ee45646b4 Fix #119239: Use attribute names after free
Fix of error introduced in c31718649dba9308cbd2. Attribute names will
be freed on domain resizing. This mean, ref-names which is attribute
ids is will be invalid. To avoid this, make sure names will be gathered
only after resize. To avoid unnecessary topology map computation before
mesh resize, check if attributes on required domain exists, instead
of gathering them and check if span is not empty.

Pull Request: https://projects.blender.org/blender/blender/pulls/119242
2024-03-12 16:42:16 +01:00
Hans Goudey
53f0c0a7e1 Merge branch 'blender-v4.1-release' 2024-03-12 11:40:41 -04:00
Hans Goudey
39ebd68a46 Fix #119361: Sculpt face set draw broken with multires
`PBVHVertexIter::g` is the grid index within the node, not the the global grid index.
2024-03-12 11:39:39 -04:00
Hans Goudey
daa1739953 Merge branch 'blender-v4.1-release' 2024-03-12 10:54:14 -04:00
Hans Goudey
91466f71f1 Fix #91256, #112646: IDProperty UI data lost when changing type
With some data-type conversions we can do a best-effort conversion of
UI data like default values and min and max to the new data type.
This can help to make Python scripts simpler and to avoid bugs like
#105965.

Pull Request: https://projects.blender.org/blender/blender/pulls/106161
2024-03-12 15:49:20 +01:00
Falk David
3d5e3b60be Fix: GPv3: Add missing call to selection.finish() 2024-03-12 15:48:33 +01:00
laurynas
aa3ffca8dc Fix #119247: Curves: Extra point in evaluated spline of Curves geometry
In bf17fc8d79  after extending buffer to multiple of 4 there appeared trailing
space in buffer not covered by shader's `for` loop.

Pull Request: https://projects.blender.org/blender/blender/pulls/119346
2024-03-12 15:01:10 +01:00
Falk David
986577f4ce Merge branch 'blender-v4.1-release' 2024-03-12 14:59:23 +01:00
megakite
825e662229 Fix #119021: Crash when adding GP object
Added a null check for RE_GetRenderLayer() which could possibly return
null and then stored in `render_layer`, in order to prevent members of
`render_layer` being accessed in RE_pass_find_by_name(), and thus solved
the segmentation fault.

Pull Request: https://projects.blender.org/blender/blender/pulls/119200
2024-03-12 14:58:05 +01:00
Hans Goudey
04de6472b5 Cleanup: Use C++ Array instead of manual allocation 2024-03-12 09:50:32 -04:00
Hans Goudey
c24568ed5c Cleanup: Use trailing underscores for private members 2024-03-12 09:50:32 -04:00
Falk David
ee9510cdc3 Merge branch 'blender-v4.1-release' 2024-03-12 14:48:44 +01:00
Omar Emara
ca65704164 Cleanup: Missing declaration warning 2024-03-12 15:42:35 +02:00
Iliya Katueshenock
29ff84352f Fix #118905: Geometry Nodes: GP3 component and face corner in separate geometry node
Pull Request: https://projects.blender.org/blender/blender/pulls/118916
2024-03-12 14:41:23 +01:00
Falk David
998514af7b Fix #115313: GPencil brush direction is not kept
The core of the issue was that `sculpt_flag` was used by three different enums (`eGP_Sculpt_Flag`, `eGP_Sculpt_Mode_Flag`, and `eBrushFlags`). This resulted in the flag getting overriden because `ENUM_OPERATORS` expected the maximum value of `eGP_Sculpt_Flag` to be `(1 << 3)` which it wasn't.

The `sculpt_flag` was exposed through python as `"direction"`.
In the UI this meant that it was effectively used as `brush.direction`. This fix replaces `brush.gpencil_settings.direction` with `brush.direction`.
It also makes sure `sculpt_flag` is only ever used with values from `eGP_Sculpt_Flag`.

Pull Request: https://projects.blender.org/blender/blender/pulls/119373
2024-03-12 14:22:52 +01:00
Sean Kim
68afd22501 Sculpt: Add Lasso Hide tool
This commit adds the `SCULPT_OT_hide_show_lasso_gesture` and the
corresponding Lasso Hide tool.

* Exposes the selection type for both the lasso and box hide tools
  as a option in the header
* Adds functionality into `sculpt_gesture.cc` for handling lasso
  selections with the `Outside` selection type

For `SelectionType::Outside`, the current implementation opts to not
do any filtering on the PBVH node level due to cases where the node
is mostly covered by a single gesture.

Addresses one of the tools in #80390

Pull Request: https://projects.blender.org/blender/blender/pulls/119140
2024-03-12 14:19:02 +01:00
Melissa
aaadb5005e UV: Support Edge and Vert Slide
This commit adapts the existing Edge Slide and Vert Slide to work with
UVs as well.

It addresses [0] for the addition of an edge slide tool to the UV
Editor.

This feature allows users to slide UVs towards adjacent edges,
providing more convenient ways to edit UV maps.

[0]: https://blender.community/c/rightclickselect/66dbbc

Pull Request: https://projects.blender.org/blender/blender/pulls/119041
2024-03-12 10:15:55 -03:00
Jacques Lucke
03dcc6c211 Merge branch 'blender-v4.1-release' 2024-03-12 14:11:27 +01:00
Iliya Katushenock
7c74a042f2 Fix #119364: capturing attributes on output object instances lose object visibility settings
The regression happened because object instances were turned into normal geometry
instances which don't have object-level visibility settings. Long term, this may not be
something we can support, but it's also not something we should break unnecessarily
and accidentally.

Pull Request: https://projects.blender.org/blender/blender/pulls/119370
2024-03-12 14:10:18 +01:00
Jacques Lucke
82c6678c39 Merge branch 'blender-v4.1-release' 2024-03-12 13:33:18 +01:00
Jacques Lucke
b40a9ce60b Fix #114438: wrong undo after running node tool in mesh edit mode
I think the issue is that the run-node-group operator overwrites the data stored in the
`Mesh` while mesh edit mode operations typically only change the `BMEditMesh`. It
seems like that causes issues because the mesh edit mode undo stack does not
keep track of changes to the `Mesh`. When hitting undo, Blender assumes that the
`Mesh` stored in the object has not changed and therefore it does not have to be
read from the undo step again.

The preliminary fix implemented here is to just not change the `Mesh` but only the
`BMEditMesh` like any other edit mode operator. This seems to solve the issue.
I haven't quite figured out yet how to tell the undo system that the `Mesh` has to be
loaded from the undo step when undoing out of mesh edit mode. Doing that might
provide a better solution.

Pull Request: https://projects.blender.org/blender/blender/pulls/119015
2024-03-12 13:28:26 +01:00
Clément Foucault
a3d0145c93 GPU: Fix usage of char4 in opensubdiv shader
`char4` are defined as `int4` from now on. This
created a compiler error.
2024-03-12 12:46:52 +01:00
Pratik Borhade
40156dfba3 Fix #119309: Face Set from Visible crash with multires
Fix is same as 18912561b5 / 72d324bd81

Pull Request: https://projects.blender.org/blender/blender/pulls/119311
2024-03-12 16:37:07 +05:30
Howard Trickey
17b2ff6119 Refactor: rename files mesh_boolean_convert to mesh_boolean.
A follow-up to previous commit that moved these files to geometry.
The _convert suffix made sense at one point but is now just confusing.
2024-03-12 07:00:33 -04:00
Falk David
6a016ce255 Cleanup: Remove unnecessary check
fd92647f added an early return so now this check is no longer needed.
2024-03-12 11:25:48 +01:00
Falk David
fd92647f34 Fix: GPv3: Add missing check in get_mutable_attribute
The function didn't return early in case the domain was empty.
The fix makes sure we return an empty `MutableSpan` in this case
(add doesn't try to create a new custom data layer).
2024-03-12 11:16:59 +01:00
Campbell Barton
5fd64db1cf Merge branch 'blender-v4.1-release' 2024-03-12 16:39:59 +11:00
Campbell Barton
59cba89f1b Merge branch 'blender-v4.1-release' 2024-03-12 16:39:56 +11:00
Campbell Barton
1fa2a1a74d Fix error freeing bpy_struct sub-classes WITH_PYTHON_SECURITY enabled
Python's behavior changed since this feature was added causing the
object to be tracked when freed by Python's subtype_dealloc even
if Blender has not tracked the data. Detect this case and untrack
the object before freeing.
2024-03-12 16:37:36 +11:00
Campbell Barton
658ef7c730 Fix missing call to PyObject_GC_UnTrack WITH_PYTHON_SECURITY
Untrack all newly created objects, although this code-path only runs
when creating the type fails - which is an exceptional case.
2024-03-12 16:36:12 +11:00
Campbell Barton
6e497434ba Merge branch 'blender-v4.1-release' 2024-03-12 14:59:15 +11:00
Bill Spitzak
4b7cc5b660 Fix #46809: History gets rearranged in Python console
Lines in the history never change, each input line is added to the
end (unless it is a duplicate of the last item).
A new history_index member keeps track of where the up/down arrows have
moved in the history.

Preserved the previous down-arrow behavior of going to the item after
the one that was copied, this is useful in Python for re-entering a
multi-line block.

Ref !119356
2024-03-12 14:56:14 +11:00
Germano Cavalcante
e0c26a19e6 Fix #119305: Edge slide is not working properly
This is a improved solution compared to 20dbcd8814

Caused by 930b11b0fe.

When checking edges that share faces between them, the `find_best_dir`
method cannot use edges that were added in the current loop.
2024-03-12 00:29:00 -03:00
Habib Gahbiche
7512ca18e3 Cleanup: make format 2024-03-11 22:37:39 +01:00
Habib Gahbiche
4231eb482f Fix Flip Node producing corrupt image when used with Translate Node
Previously, all information outside the render area did not get considered because transform operations such as translation and rotation might cause the output area to be smaller.

In this patch, the whole image gets flipped regardless of the output area, which makes the behavior consistent with the GPU compositor.

Pull Request: https://projects.blender.org/blender/blender/pulls/119278
2024-03-11 22:29:43 +01:00
Habib Gahbiche
f64d02ecb1 Fix CPU Compositor: Translate node with wrapping enabled produces corrupt image
Rendering with F12 causes some inconsistencies between canvases and areas of interest. This is due to some corrections of composite node canvas to fit to the render size, which are not necessary for the Viewer Node. This patch fixes the issue by considering the input image as a whole before translating.
Note: this is still consistent with immediate realization of transform nodes in GPU compositor, where nodes are to be evaluated from left to right.

Pull Request: https://projects.blender.org/blender/blender/pulls/119276
2024-03-11 22:08:49 +01:00
Lukas Tönne
054ef616ce Fix #117997: Crash trying to copy vertex group attributes as spans
Grease Pencil provides custom vertex group attributes as VArrays that
are a view on the `MDeformVert` buffer. These attributes are not spans,
which the curve conversion code was expecting. Non-span VArrays must be
materialized first.

Pull Request: https://projects.blender.org/blender/blender/pulls/119212
2024-03-11 20:52:14 +01:00
Hans Goudey
958eeea9a8 UI: Small fixes in tool settings property descriptions 2024-03-11 15:34:10 -04:00
Hans Goudey
68ac54bbcc Fix #119250: Python: World matrix for newly created objects is not identity
Initialize these like other fields in the object runtime struct.
2024-03-11 15:34:10 -04:00
Jacques Lucke
d6829fa7cc Merge branch 'blender-v4.1-release' 2024-03-11 19:49:34 +01:00
Jacques Lucke
9feb02e9ad Fix #113170: node editor background color affects node panel color
The offset `-15` that's passed to `UI_GetThemeColorShade4fv` is chosen so that the color
stays almost the same in the default theme.

Pull Request: https://projects.blender.org/blender/blender/pulls/119283
2024-03-11 19:47:52 +01:00
Hans Goudey
6f4718242e Fix #119304: Assert copying transform data in OBJ and STL export 2024-03-11 14:36:36 -04:00
Jacques Lucke
b4e3a00cd3 Merge branch 'blender-v4.1-release' 2024-03-11 19:35:26 +01:00
Jacques Lucke
c5443ec80d Fix #90999: crash when converting volume grid with high indices to dense volumes
There seems to be an integer overflow in OpenVDB code. For now just avoid rendering
the volume when the indices are very large, which is an extreme case anyway.

Pull Request: https://projects.blender.org/blender/blender/pulls/119279
2024-03-11 19:34:57 +01:00
Hans Goudey
dc9249c97f Fix #110562: Crash animating node property affecting socket visibility
For various reasons, the animation system can't properly update the node tree
so that the socket availability caused by changing node enum properties
propagates completely. So animating node properties that affect
socket visibility to change isn't possible without issues like crashes.
Unfortunately that wasn't disallowed before. In this commit there is
a balance of disabling animation on sockets that could reasonably expected
to affect socket visibility, and minimizing breaking changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/119221
2024-03-11 19:26:58 +01:00