Commit Graph

108375 Commits

Author SHA1 Message Date
Germano Cavalcante
115a925ffe Fix: Incremental snap not matching grid resolution
Caused by f0479e915f

`t->snap_spatial` is still required for Incremental snap.
2024-04-07 10:26:21 -03:00
Harley Acheson
e5e6aa0bbf UI: Menu Status Text Clears Incorrectly
When we open dropdown (and context) menus we often show "Press spacebar
to search..." or "Type to search..." in the status bar. The status text
is set when menus are opened, and cleared when closed, but this means
that they are cleared when closing a submenu. This PR corrects this to
only clear then the base menu is freed.

Pull Request: https://projects.blender.org/blender/blender/pulls/120351
2024-04-07 03:02:01 +02:00
Lukas Tönne
68060a9ccf GPv3: Implement UV rotation mode for the noise modifier
UV rotation in the noise modifier was a todo since UVs were not
supported yet at the time the modifier was added. This patch adds the
missing UV rotation feature.

Pull Request: https://projects.blender.org/blender/blender/pulls/120336
2024-04-06 14:25:18 +02:00
Lukas Tönne
ee1714136e Fix #119554: Remove links to and from unsupported socket types
#114401 added forward compatibility code to remove unsupported socket
types and avoid crashing with unknown default_value data. However, this
did not update link pointers (which haven't been read at that point),
so the tree can end up with dangling pointers.

To fix this, removal of unsupported sockets is moved further back to a
point where links have been read and can be fixed accordingly.

Ported to main from #119630

Pull Request: https://projects.blender.org/blender/blender/pulls/119650
2024-04-06 11:23:53 +02:00
Hans Goudey
61b28227bb Fix #120309: Remove from Vertex Group operator broken
This check for whether there is vertex group data was mistakenly
reversed in b52a071e7a.
2024-04-05 13:41:59 -04:00
Pablo Vazquez
4e90501377 UI: Fix label in Particle System modifier
Fix two issues with the current label:
1. "particle tab" should be "Particles tab" since that's the actual name
    of the tab.
2. "Settings are in..." is inconsistent with similar labels where the
   word used is "inside" instead of "in".

Pull Request: https://projects.blender.org/blender/blender/pulls/120319
2024-04-05 18:50:57 +02:00
Harley Acheson
5bed08fc56 Fix #120133: Incorrect BG color Hovering Inactive
Hovering on inactive menu items combines the colors in a way that does
not work correctly with light themes. This PR changes nothing but how
colors are mixed for hover + inactive, doing so similarly to hovering
active.

Pull Request: https://projects.blender.org/blender/blender/pulls/120262
2024-04-05 18:08:45 +02:00
Clément Foucault
70bd907855 Fix: EEVEE-Next: Broken volume integration shader on Metal 2024-04-05 17:52:59 +02:00
Clément Foucault
4a7e98be40 EEVEE-Next: Volume: Fragment shader voxelization
This replaces the compute shader pass for volume material properties
voxelization by a fragment shader that is run only once per pixel.
The fragment shader then execute the nodetree in a loop for each
individual froxel.

The motivations are:
- faster evaluation of homogenous materials: can evaluate nodetree
  once and fast write the properties for all froxel in a loop.
  This matches cycles homogenous material optimization (except that
  it only considers the first hit).
- no invocations for empty froxels: not restricted to box dispach.
- support for more than one material: invocations are per pixel.
- cleaner implementation (no compute shader specific paths).

Implementation wise, this is done by adding a stencil texture when
rendering volumetric objects. It is populated during the occupancy
phase but it is not directly used (the stencil test is enabled but
since we use `imageAtomic` to set the occupancy bits, the fragment
shader is forced to be run). The early depth-test is then turned
on for the material properties pass, allowing only one fragment to
be invoked.
This fragment runs the nodetree at the desired frequency: once per
direction (homogenous), or once per froxel (heterogenous).

Note that I tried to use the frontmost fragment using a depth equal
test but it was failing for some reason on Apple silicon producing
flickering artifacts. We might reconsider this frontmost fragment
approach later since the result is now face order dependant when
an object has multiple materials.

Pull Request: https://projects.blender.org/blender/blender/pulls/119439
2024-04-05 16:33:58 +02:00
Philipp Oeser
5f23e0fa8d Fix #120012: 3D Viewport sidebar not updating when playback stops
Since d8388ef36a, updates were missing after stopping playback.
As a followup, c774cc0cc0 added a notifier which we can also listen to
from the sidebar.

Pull Request: https://projects.blender.org/blender/blender/pulls/120300
2024-04-05 16:26:27 +02:00
Philipp Oeser
bdf11c7344 Fix #120211: Dynamic paint surface format change resets surface type too
There is no need to reset this since most types are supported for both
formats:
- if format is image sequence: `Paint`, `Displace`, `Waves` are
supported
- if format is vertex: `Paint`, `Displace`, `Weight`, `Waves` are
supported

So the only combination that needs a reset is when we change from vertex
format (weight type) to image sequence.

Pull Request: https://projects.blender.org/blender/blender/pulls/120248
2024-04-05 16:25:50 +02:00
Julian Eisel
3e71cec988 Fix slightly increased layout height for tree-view item rows
Since 427bdc8dcf there is some trickery going on to make the underlying
view-item button slightly bigger, but that unintentionally also scaled
up the layout drawn on top of it. This would be visible whenever the
background is drawn, e.g. by using a different emboss type or when an
animated property was displayed.
2024-04-05 16:15:03 +02:00
Pratik Borhade
129d5a1067 Fix #120278: Anim properties are not highlighted in tree view
Animation state of any property is not colored in tree-view structure.
This is due to wrong emboss value. `widget_color_blend_from_flags`
returns correct theme value if emboss is not `UI_EMBOSS_NONE`.

`UI_EMBOSS_NONE_OR_STATUS` is preferred for animating properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/120298
2024-04-05 16:13:04 +02:00
Jacques Lucke
619ab92c77 Cleanup: quiet warning 2024-04-05 15:38:49 +02:00
Falk David
1c0a278abd Fix: GPv3: Crash on conversion
This was introduced by d7230516c1.
The wrong API was used.
2024-04-05 15:34:26 +02:00
Falk David
d7230516c1 Cleanup: GPv3: Add drawing API for fill color
This adds two functions to the `Drawing` class: `fill_colors()`
and `fill_colors_for_write()`.
In places where the attribute API was used directly, these
functions are now used instead.

This is part of #119080. The point is that developers
shouldn't need to remember the name, type, default value,
and domain of built-in attributes (e.g. used by the renderer).

Pull Request: https://projects.blender.org/blender/blender/pulls/120296
2024-04-05 15:28:28 +02:00
Hans Goudey
3ed4e51437 Fix #117338: Texture paint sampling broken with modifiers
e64b3c8212 worked to complete a transition started during 2.8
development to avoid dynamically re-evaluating objects outside of the
dependency graph's control. However, that behavior was used to make
sure the original index mapping was available for the texture paint
sample operator.

Conceptually, sampling a texture on an arbitrary evaluated mesh should
not require original indices at all. All we need to know is the UV map
value under the mouse. This commit changes from using GPU index textures
to a BVH tree raycast. This significantly simplifies the code and makes
it work with GPU subdivision too. Though it may be slower to build the
BVH tree, that should be okay because it's cached and only needs to be
built once, and that's something we're want to optimize anyway.

Removing the reliance on original indices also means we could paint
textures on completely procedurally generated meshes, which may be
an interesting feature in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/120259
2024-04-05 14:17:43 +02:00
Jacques Lucke
548df007a5 Curves: add subdivide curves edit mode operator 2024-04-05 13:50:09 +02:00
Jacques Lucke
6c25c66194 Curves: add switch direction edit mode operator 2024-04-05 13:23:22 +02:00
Sybren A. Stüvel
d6863d43da Cleanup: Anim, re-word the explanation of the term 'binding'
Re-word the explanation of 'binding', as the old explanation was still
based on the old name 'output'.

No functional changes.
2024-04-05 12:45:26 +02:00
Sybren A. Stüvel
85d77b79a6 Refactor: Anim, use eBezTriple_KeyframeType in more code
Instead of using `short key_type`, use `eBezTriple_KeyframeType key_type`,
so that it's clear which type it is, and so that a `switch()` can cause
compiler warnings when it's incomplete.

This also adds missing `case`s to `switch`es where necessary, in a way
that doesn't affect the outcome. There is one change that looks like it
is a functional change, but it should provide the same result:

```diff
- size -= 0.8f * key_type;
+ size *= 0.8f;
```

Since `size = 12` and in this case `key_type = 3`, the numerical values
are the same, but now the code is consistently multiplying and thus should
scale properly.

Furthermore some overly obvious comments are removed and some missing
`const` keywords have been added.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/120178
2024-04-05 11:53:57 +02:00
Campbell Barton
ea567c76ec Unbreak build WITH_GPU_BUILDTIME_SHADER_BUILD
This was valid C++ but not GLSL.

Own error in a00843d560.
2024-04-05 19:27:46 +11:00
Omar Emara
0dc98f784c Fix: Vector Blur slightly differs between CPU and GPU
The Vector Blur implementation slightly differs between CPU and GPU due
to different precision in the sqrt2 constant, so use the float variant
in CPU to make it closer to GPU.
2024-04-05 10:25:27 +02:00
Jacques Lucke
ceccb6f50e Cleanup: remove scary warning about reading Library data-block
From what I can tell, this was fixed a long time ago already in 42057481fb.
See the change from `(Library *)(bheadlib+1)` to `read_struct(fd, bheadlib, "Library")`.

The warning was added 5 months before that in f1a217c5f9.

Pull Request: https://projects.blender.org/blender/blender/pulls/120272
2024-04-05 09:54:57 +02:00
Omar Emara
b229d32086 Compositor: Port GPU Vector Blur to CPU
This patch ports the GPU Vector Blur node to the CPU, which is in turn
ported from EEVEE. This is a breaking change since it produces different
motion blur results that are more similar to EEVEE's motion blur.
Further, the Curved, Minimum, and Maximum options were removed on the
user level since they are not used in the new implementation.

There are no significant changes to the code, except in the max velocity
computation as well as the velocity dilation passes. The GPU code uses
atomic indirection buffers, while the CPU runs single threaded for the
dilation pass, since it is a fast pass anyways. However, we impose
artificial constraints on the precision of the dilation process for
compatibility with the atomic implementation.

There are still tiny differences between CPU and GPU that I haven't been
able to solve, but I shall solve them in a later patch.

Pull Request: https://projects.blender.org/blender/blender/pulls/120135
2024-04-05 09:48:03 +02:00
Jeroen Bakker
4574de1092 Revert "Overlay: Wireframe: avoid using custom depth bias with xray enabled"
This reverts commit 14500953ed.

The commit has introduced multiple drawing regressions in xray mode and
was already reverted in 4.1. A different solution has to be found or
the current one should make sure these regressions are fixed.

Finding the correct solution isn't priority.

* #120208
* #119527

Pull Request: https://projects.blender.org/blender/blender/pulls/120285
2024-04-05 08:08:09 +02:00
Aras Pranckevicius
4cb1d7242a Tests: extend ghash performance tests to cover blender::Map
Clean up the GHash performance testing suite (more C++ constructs), and
extend to cover blender::Map equivalents of the same functionality.

Pull Request: https://projects.blender.org/blender/blender/pulls/120252
2024-04-05 08:04:52 +02:00
Jesse Yurkovich
14e0547da9 Fix: OBJ failing to create a proper .mtl filepath
The MTLWriter was using a BLI_assert to check user-provided data, which
is incorrect and would only work in Debug builds. Release builds would
end up using too small of a buffer and would needlessly fail to append
the `.mtl` extension in some cases.

Instead, we now allow the path manipulation code to just use the full
max size available to it.

Pull Request: https://projects.blender.org/blender/blender/pulls/120275
2024-04-05 04:43:28 +02:00
Campbell Barton
c9130ad460 Python: support a null context for BPY_run_string_{exec/eval}
This was only used for accessing the CTX_wm_reports and isn't needed
for running scripts.
2024-04-05 12:33:48 +11:00
Bastien Montagne
cb66cc3028 Fix #120058: Undoing a rename while in edit mode crashes Blender.
The root of the issue, as identified by Jake-Faulkner in his PR
(!120099), was that after changes in commit 195bb4f8f5,
`BKE_libblock_ensure_unique_name` would not always correctly set
`bmain->is_memfile_undo_written` to false when an ID name was actually
modified.

However, after analyzing a bit more the code in ID renaming, it appeared
that `BKE_libblock_ensure_unique_name` was not needed and only made
things more confusing. Some ID renaming code (from RNA, the Outliner,
and some do_version areas) would then do some manual ID renaming
operations and then call it, instead of simply using the existing 'all
in one' `BKE_libblock_rename` function.

This commit removes `BKE_libblock_ensure_unique_name` and all of its
usages, and simplify all code previously using it by calling
`BKE_libblock_rename` instead.

NOTE: The only non-trivial (not-so-nice) aspect of this commit is the
changes needed in the Outliner renaming code, since here the name of the
ID is directly edited, before calling the rename function, so this edit
needs to be undone to allow calling the generic ID rename API.

Pull Request: https://projects.blender.org/blender/blender/pulls/120196
2024-04-05 03:19:35 +02:00
Campbell Barton
800e470ced Fix crash running a script without any context data
While calling into scripts with an empty `Main` shouldn't be possible
under normal circumstances, I ran into this during development.

This situation is meant to print an error, add a null check so it works
as expected.
2024-04-05 11:43:00 +11:00
Campbell Barton
06dcd264ea Python: assert Python start/end/reset are used properly 2024-04-05 11:41:12 +11:00
Campbell Barton
204d282c75 Refactor: generalize deferred command line argument execution
Making arguments call into Python was impractical because Python
is only initialized for ARG_PASS_FINAL.

Replace "--command" specific logic with a general method of arguments
requesting to be executed once all sub-systems have been initialized.

Without this, the `main()` function needs hard coded logic to support
any time an argument needs to use Python internally.
2024-04-05 11:31:56 +11:00
Campbell Barton
a00843d560 Cleanup: use const references instead of values 2024-04-05 11:31:53 +11:00
Hans Goudey
4db6cbfbe0 Cleanup: Improve comment for Mesh::runtime::mesh_eval 2024-04-04 16:52:00 -04:00
Hans Goudey
b195014e05 Cleanup: Clarify modifier depends_on_normals handling
Because normals are calcualted lazily for all cases "depends_on_normals"
except for BMesh original normals, this is mostly unnecessary. It's actually
probably not necessary at all, because in practice there is always a separate
positions array stored in `EditMeshData` during mesh edit mode modifier
evaluation, bringing us back to the lazy calculation. But anyway, removing
the usage for topology-changing modifiers and modifiers  which don't
accept BMesh as input anyway simplifies things.

Pull Request: https://projects.blender.org/blender/blender/pulls/120274
2024-04-04 22:46:41 +02:00
Jacques Lucke
23265a2b6d Curves: add edit mode operator to convert curve types
This operator shares the underlying code with the corresponding node.

Pull Request: https://projects.blender.org/blender/blender/pulls/120269
2024-04-04 21:04:51 +02:00
Clément Foucault
7f68026990 EEVEE-Next: Allow raytacing for translucent BSDF without refraction
This was an oversight. It was working when adding refraction
which made the check pass.
But this only allows raytracing using screen tracing with
raytraced refraction turned on.
Horizon Scan is still not compatible with transmission.
2024-04-04 21:02:52 +02:00
Hans Goudey
274d7c6d12 Cleanup: Remove unused BVH tree function 2024-04-04 14:49:01 -04:00
Jacques Lucke
d315a6a793 Curves: add toggle cyclic edit mode operator
This operator also exists in legacy edit mode and allows changing
whether the curve is cyclic. If all curves are non-cyclic, the attribute
is removed because it does not contain any useful information.

Pull Request: https://projects.blender.org/blender/blender/pulls/120266
2024-04-04 19:39:14 +02:00
David-Haver
68d948efb9 Fix #119958: Crash when baking during animation
Sometime when baking during an animation blender could crash.
WM_set_locked_interface(job->wm, true) was inside the wm thread.
This caused a race condition between the check and the lock.

Pull Request: https://projects.blender.org/blender/blender/pulls/120258
2024-04-04 18:42:44 +02:00
Falk David
398c4471ec Cleanup: GPv3: Const parent functions for tree nodes
This resolves #120220.

The `parent_group()` and `parent_node()` functions would be
callable on `const` instances but return a non-`const` pointer/reference.

This introduces `const` and non-`const` variants of these
methods.

Pull Request: https://projects.blender.org/blender/blender/pulls/120261
2024-04-04 18:41:38 +02:00
Nate Rupsis
298c9276e9 Anim: Update NLA "make single user" popup dialog
Update the `NLA_OT_make_single_user` dialogue and confirmation modal to make explicitly clear what's happening for the selected strips.

Pull Request: https://projects.blender.org/blender/blender/pulls/120082
2024-04-04 18:34:08 +02:00
Hans Goudey
7ba8fc1768 Fix: Duplicate auto smooth modifier added by versioning in one case
When an object uses linked mesh data and the object and the modifier
node group are made local after versioning runs for the first time,
a new modifier is added every time the file is opened. An obvious
fix is to check whether there is already a modifier with the versioning
node group. In that case we can skip the object.

This doesn't fully fix the scenario from #120030; it requires that
the node group is made local so it doesn't leave a reference to
a non-existent library data-block.
2024-04-04 11:57:27 -04:00
YimingWu
11556bb994 Fix #120152: Clear mesh runtime after validation
The cache for triangles and other runtime caches could
be out of date after `mesh.validate()` is called.

Pull Request: https://projects.blender.org/blender/blender/pulls/120159
2024-04-04 17:21:21 +02:00
Sebastian Parborg
a9fff1f22f Fix: Missing include in BLI_implicit_sharing.hh 2024-04-04 17:13:31 +02:00
Germano Cavalcante
1180a25c23 Fix #120245: Grid snap not working when constraining axis before moving
`sctx->grid.size` was only updated while the constraint was not
enabled.

This was causing division by zero.
2024-04-04 11:42:27 -03:00
Christoph Lendenfeld
ed2408400d Fix #117927: Limit rotation constraint flipping
The issue from the bug report mentions that the `Limit Rotation` constraint snaps
back to 0 when reaching 180 degrees with a min and max of 0 / 180.

The root cause of this goes a bit deeper though. Because the following also snaps back to 0.
* min max of 0 / 360
* angle of 185

The reason for this is that the clamping logic in the constraint was very simple.
It just took the matrix, decomposed it to euler and clamped the values directly.
However in that process, the euler angles are bound to a range of -180 / 180,
which means that any angle >= 180 would snap back to the min.

Pull Request: https://projects.blender.org/blender/blender/pulls/118502
2024-04-04 16:30:51 +02:00
Jason Fielder
93cc55889c EEVEE Next: Horizon scan Metal compiler tuning
Tune Metal compilation parameters for horizon scan
shaders for optimal performance. Selectively unrolling
loops and modifying compilation heuristics results in a
~25% uplift in tracing shader performance, due to
improved latency management.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/119737
2024-04-04 16:24:20 +02:00
YimingWu
022e46a7e2 Fix #120213: GPv3: Tint modifier not working correctly
The GPv3 tint modifier will give incorrect result in fill tint due to
two reasons: 1) The material index being wrong; 2) The default value
for `fill_color` attribute needs to be explicitly assigned as
`ColorGeometry4f(float4(0.0f))` to ensure correct color mixing and
switching between fill/material color in the tint modifier.

Pull Request: https://projects.blender.org/blender/blender/pulls/120249
2024-04-04 15:08:10 +02:00