Commit Graph

108096 Commits

Author SHA1 Message Date
Campbell Barton 98a8ed2002 Cleanup: forward event to WM_operator_name_call_ptr
In general it's best practice to forward events when available.
2024-03-21 11:46:56 +11:00
Campbell Barton f64f3e8524 Extensions: recursively remove custom-directories on repo removal
Even though there is a dialog users must accept when removing a
repository & directory being removed is shown, it's possible users
assume this only removes files which are part of the repository after
pointing the custom-directory to their home directory or similar.

Removing repositories which point to a custom-directory now only
remove packages and server meta-data to prevent accidents.

Resolves #119481.
2024-03-21 11:43:00 +11:00
Pratik Borhade 2df06a05ae GPv3: Show stats in edit mode
GPv3 uses `OB_MODE_EDIT` so it falsely shows empty mesh data in stats.
This worked in legacy gp because it had special edit_mode type.
To show correct grease pencil data in edit mode, rearrange if conditions and
add special check for `OB_GREASE_PENCIL`

Pull Request: https://projects.blender.org/blender/blender/pulls/119689
2024-03-21 01:15:18 +01:00
Campbell Barton 57dd9c21d3 Cleanup: spelling in comments 2024-03-21 10:02:53 +11:00
Campbell Barton 116264c310 Cleanup: use full scentences for code-comments & minor corrections 2024-03-21 09:49:19 +11:00
Campbell Barton fbe16bc1eb BLI_delete: assert that dir is true when recursive is true
While this isn't an error avoid ambiguity for recursive deletion
as it's not meaningful to delete a file.
2024-03-21 09:43:40 +11:00
Campbell Barton 4e3771124d Docs: BLI_delete parameters & behavior with symbolic-links 2024-03-21 09:35:40 +11:00
Hans Goudey ddcfc46ee6 Fix #119544: Cage modifier deformation ignored in next modifier
When the edit mesh modifier stack first deforms the original edit mesh,
it creates deformed positions in a separate array. That array is copied
to the mesh's vertex positions if a subsequent modifier requires an
actual mesh rather than a mesh wrapper.

However, if that last deform modifier is the last "on cage" modifier
and the next modifier requires a real Mesh, we hit a code path that
didn't copy the temporary position array, since it was contained in the
separate `EditMeshData` struct that must be handled manually.

This was a regression in 91b27ab637. In the future I hope to
make this simpler by expanding the use of implicit sharing and making
the conversion from original BMesh to a Mesh more lazy / const correct.

Pull Request: https://projects.blender.org/blender/blender/pulls/119718
2024-03-20 23:16:02 +01:00
Miguel Pozo 9b1ba4fced Fix: EEVEE-Next: Metal compilation
Compilation errors after #119436

Pull Request: https://projects.blender.org/blender/blender/pulls/119709
2024-03-20 19:09:31 +01:00
Miguel Pozo 81ceff8e73 Fix: Missing subversion update
Missing from #119436
2024-03-20 18:39:46 +01:00
Harley Acheson d0eacbd6ba Merge branch 'blender-v4.1-release' 2024-03-20 09:07:40 -07:00
Harley Acheson afbd733047 Fix #119635: File Browser Horizontal Display Never Compact
File Browser listings can clip content, remove columns, etc as the
available space narrows. This PR just makes this never happen for
the horizontal display mode, where files are shown in multiple columns,
as this is not applicable.

Pull Request: https://projects.blender.org/blender/blender/pulls/119673
2024-03-20 17:06:38 +01:00
Sergey Sharybin e0b413f818 Merge branch 'blender-v4.1-release' 2024-03-20 16:06:36 +01:00
Sergey Sharybin 4eab8fae5a Fix #119697: Incorrect update after disabling light linking
The issue was caused by 29aaa2922d.

With the change from the offended commit there was nothing that
would have informed objects previously linked to a light that they
need to re-calculate their light linking collections.

This change makes it so scene's hierarchy is tagged for update,
which propagates to all dependencies which do depend on hierarchy
of objects and collections in the scene.

This brings behavior closer to what it used to be, without causing
slowdown with full re-evaluation (which was fixed by the offending
commit).

Pull Request: https://projects.blender.org/blender/blender/pulls/119698
2024-03-20 16:06:06 +01:00
Miguel Pozo 3888bdf8b2 EEVEE-Next: Fix transparent shadows convergence
Replace the hashed alpha function in shadows for a fully random one.
Add pcg functions to `gpu_shader_common_hash.glsl`
(Split from #119480)

Pull Request: https://projects.blender.org/blender/blender/pulls/119526
2024-03-20 16:05:07 +01:00
Hans Goudey 3f10ba244a Cleanup: Use C++ types in view3d_navigate.cc, restore fix from merge
Also restore a fix that was lost in the merge commit from 4.1.
2024-03-20 11:00:25 -04:00
Miguel Pozo 881fd2dbd5 EEVEE-Next: Jittered Shadow Transparency
Smooth transparent shadows by jittering their opacity threshold every
sample.
Always enabled on final renders, optionally enabled in the viewport with
`scene.eevee.shadow_jittered_transparency`.

Pull Request: https://projects.blender.org/blender/blender/pulls/119480
2024-03-20 15:55:58 +01:00
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 354915cf3c.
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]: a180314ac5
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 fd92647f34.
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 23ebc45f70 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
Sybren A. Stüvel 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 02379f3200
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 02379f3200
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 a96f1208cc

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 745fd2a2cb.
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
Sybren A. Stüvel 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
Sybren A. Stüvel 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 a96f1208cc.
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
Sybren A. Stüvel 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 f57e4c5b98.

After this one more fix was committed, this one is preserved as well:
67bd678887.
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 62bd0ea5fd. 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
(2cfcb8b0b8). 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 c6497dd9f7.

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 4a78d7dc4c 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
Sybren A. Stüvel 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 f2bcd73bd2.

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]: 060174cf14
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]: 060174cf14
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 bd4c310a19.

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 b40a9ce60b.

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