Commit Graph

109555 Commits

Author SHA1 Message Date
Pablo Vazquez
48e3804f3b UI: Make "Text not found" report not a warning
Not finding text should not raise a warning since there's nothing
really critical about it.

Pull Request: https://projects.blender.org/blender/blender/pulls/121794
2024-05-22 12:35:24 +02:00
Jesse Yurkovich
d46ce3eb4e Fix: Test failure after updating test data 2024-05-22 06:13:18 +02:00
Leon Schittek
fac97d6c49 Fix: Nodes: Update multi-socket link positions after duplicating
When not all links connecting to a multi-input socket are duplicated
with the multi-input, the link position needs to be updated to avoid
the links being offset.

Pull Request: https://projects.blender.org/blender/blender/pulls/122074
2024-05-22 05:57:35 +02:00
Jesse Yurkovich
e1211b291a Cleanup: Unnecessary newline in CLOG statement 2024-05-21 22:35:37 +02:00
Charles Wardlaw
36f1a4f94f USD Export: Added option to specify types of XForm ops written.
Different pipelines standardize on different XForm op setups (T-R-S,
T-orient quat-S, Matrix).  Having this options means that this standard
can be chosen at export time instead of having to patch on load.

Speaking from experience, this is a very helpful option.

Co-authored-by: kiki <charles@skeletalstudios.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/121627
2024-05-21 22:33:32 +02:00
Harley Acheson
ac33b9f693 UI: Slight Adjustment to Status Bar Mouse Event Icon Spacing
With #121898 the regular (non-drag) mouse event icons are now centered
and therefore the horizontal padding between them needs a bit of
adjustment.

Pull Request: https://projects.blender.org/blender/blender/pulls/122072
2024-05-21 21:52:35 +02:00
Hans Goudey
d93b27a12e Subdiv: Simplify GPU subdivision loose geometry handling
The main change is avoid storage of redundant data in the subdivision
draw cache, mainly by replacing reverse lookup from subdivided edge to
coarse edge. This way loops are structured as iteration over coarse
edges instead of iteration over subdivided edges with optional behavior
for vertices with matching base mesh faces. With that inversion the
information in the draw cache is trivial (or duplicated from an array
in `MeshRenderData`), so it's all removed, except for the subdivided
loose edge positions. That array is also shrunk though, by not
duplicating positions in between each subdivided edge. Its calculation
is more efficient for the same reason too.

Overall, besides code simplification, the effect should be lower
overhead with loose edges with GPU subdivision. Admittedly this isn't
a very important use case, but it's part of a general refactor trying
to use better data oriented design in this area (#116901).

Pull Request: https://projects.blender.org/blender/blender/pulls/122071
2024-05-21 21:46:11 +02:00
Julian Eisel
20df089341 Assets: Clear asset data by default on all "Make Local" actions
Fixes #107880.

When making a linked asset local, you typically wouldn't want this new
data-block to suddenly be part of the asset libraries this file is in. To the
user it seems like making such a data-block local also implicitly makes it an
asset.  Appending an asset already handles this, and clears the asset data by
default.

This patch modifies the `bpy.types.ID.make_local()` method, as well as all
internal calls to the make local functions, so that asset data is cleared by
default. The Python method has a new `clear_asset_data` parameter (optional,
true by default). Maybe this should not be optional.

Pull Request: https://projects.blender.org/blender/blender/pulls/110197
2024-05-21 20:41:16 +02:00
Clément Foucault
69e4aac784 EEVEE-Next: Volume Light-Probe: Baking shadow not synced with final camera
We call the `shadow.end_sync()` another time when running
the baking pipeline so that the sun shadow maps can
use the correct camera setup and scene bounds.
2024-05-21 20:26:11 +02:00
Clément Foucault
01308713ff Fix: EEVEE-Next: Shadow: Avoid uninitialized grid_shift
This value was previously used for tagging as dirty.
This is not the case anymore so no reason to not
set it.
2024-05-21 20:26:11 +02:00
Clément Foucault
8dcf6f43bf Fix: EEVEE-Next: Disable sun extraction during light baking
Otherwise we record the sun as direct lighting.
The HDRI is still shadowed during baking because
fo the surfel representation.
2024-05-21 20:26:11 +02:00
Clément Foucault
2eda9ce302 Fix: EEVEE-Next: Avoid sun direction being null
This avoids NaN shadow matrices later on.
2024-05-21 20:26:11 +02:00
Nathan Burnham
a7848b820c Docs: PyAPI Fix: RST syntax typos in bmesh Layer Access
Every bmesh layer access attribute except `BMLayerAccessVert.shape` was missing the first colon in `:type:`, resulting in problems for tools that process the RST e.g.: formatting errors in the [PyAPI docs](https://docs.blender.org/api/4.1/bmesh.types.html#bmesh.types.BMLayerAccessVert.shape) and attributes with no type in fake-bpy-module.

Pull Request: https://projects.blender.org/blender/blender/pulls/122060
2024-05-21 19:53:09 +02:00
Jason Fielder
1cf8f64927 Fix #70036: Fixed animation playback scaling issue on retina displays
Authored by Apple: James McCarthy

Pull Request: https://projects.blender.org/blender/blender/pulls/122048
2024-05-21 19:25:23 +02:00
Sean Kim
fe5b3543e9 BLI: Add BitGroupVector copy constructor
Adds copy constructor and related test

Pull Request: https://projects.blender.org/blender/blender/pulls/122026
2024-05-21 18:20:54 +02:00
Brecht Van Lommel
5f9f3116db Libraries: Support editing linked datablocks from some libraries
For the brush assets, this mechanism makes brush, texture, node tree and
image datablocks editable even when library linked.

This commit should introduce no functional change yet, as the code to
actually tag such libraries as editable will come later.

* These libraries and their datablocks are preserved when loading a new
  blend file, much like the UI can be preserved.
* Operators that create new datablocks to be assigned to such datablocks
  will put the datablocks in the same library immediately. This was
  implemented for datablocks relevant for brush assets.
* RNA does not allow assignment of pointers from such linked datablocks
  to local datablocks.

Co-authored-by: Bastien Montagne <bastien@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/121920
2024-05-21 18:16:36 +02:00
Brecht Van Lommel
a1b4d5ecc8 RNA: Better enforce rules about pointers between datablocks
* Linked datablocks should not point to local datablocks.
* Main datablocks should not point to non-main datablocks.

This is checked now both in the poll function for UI lists, and in the
pointer assignment code used by the Python API.
2024-05-21 18:16:34 +02:00
Brecht Van Lommel
b5ef5c3aba Refactor: Make BKE_libblock_rename support renaming linked IDs
It was checked that current callers only pass non-linked IDs.
2024-05-21 18:16:34 +02:00
Brecht Van Lommel
6c9c3cb69b Refactor: Support library reloading without active scene pointer
In this case it will skip collection overrides sync, which is not needed
for brush asset reloading.
2024-05-21 18:16:34 +02:00
Brecht Van Lommel
80b3f9c6c1 Refactor: Add function to find ID with given name and library filepath 2024-05-21 18:16:34 +02:00
Jeroen Bakker
488e74a209 Vulkan: Render graph debug groups
This PR implements debug groups in the render graph. Each node contains
a reference to the debug group they belong to. During scheduling the
nodes can be reordered and the correct debug group needs to be
activated.

This is done by keeping track of the current debug group. When a
different debug group is needed, the needed ends/begins are added
to the command buffer.

This mechanism also cleans up debug groups that are not used at all
as they don't have any nodes associated to it.

Pull Request: https://projects.blender.org/blender/blender/pulls/122054
2024-05-21 17:34:55 +02:00
Sergey Sharybin
a12bd38853 Fix: Non-thread-safe access to metadata in Compositor
Image's render result might get freed from another thread while the
compositor is running.

Add an utility function which invokes callback on the image's stamp
data from a thread-guarded block.

Ref #118337, #121761

Pull Request: https://projects.blender.org/blender/blender/pulls/121907
2024-05-21 17:29:59 +02:00
Sergey Sharybin
58e0ca99a9 Fix: Non-thread-safe access to image in Compositor
Image operation's get_im_buf() function was not thread-safe:
- It had TOCTOU issue around calculating multi-layer indices and
  requesting to load the image buffer.
- It accessed render result, render layer and pass pointers without
  any thread guards.

This change moves all the logic needed to access the image buffer
into a single function with proper guards around the access. The
result is user-counted, so it is usable in a thread even if another
thread modifies the image.

The is still potential TOCTOU in the compositor since the image is
acquired twice: once from init_execution(), and once from the
determine_canvas(). It could cause issues if image resolution is
changed between these calls. It is still to be looked into.

Ref #118337, #121761
2024-05-21 17:29:51 +02:00
Sergey Sharybin
fb6b759513 Cleanup: Avoid reference of RenderLayer and RenderPass in multilayer operation
This is avoids reference to data which can potentially be freed from the main
thread while the compositor job is running.

There is still some direct access to RenderResult and access to its layers
and passes in the operation implementation, but is is all internal and will
be worked on later. The purpose of this patch is to avoid unsafe pointers in
the API of the operation.

Should be no functional changes.

Ref #118337, #121761
2024-05-21 17:29:51 +02:00
Sergey Sharybin
def1e8154e Cleanup: Move multi-layer view logic to the operation
There are a couple of goals achieved with this change:

- The logic itself is de-duplicated between the Image and Cryptomatte
  nodes.

- The logic which accesses render results, images, etc is more local
  to the place where it needs to be used. Currently it does not matter
  too much, but it allows to properly guard the access to be thread
  safe.

Ref #118337, #121761
2024-05-21 17:29:51 +02:00
Sergey Sharybin
9f28189c28 Cleanup: Store ImageUser by value in the image operation
Allows to modify the user without worrying to store/restore old values,
potentially resolving threading conflicts.

Should be no changes on user level.

Ref #118337, #121761
2024-05-21 17:29:51 +02:00
Falk David
cf72499919 Fix: GPv3: Layer::get_frame_duration_at
The `Layer::get_frame_duration_at` was not working for frames
with a fixed duration. While this is not an issue at the
moment (because fixed duration frames are not exposed
yet), this would have been broken in the future.

This fixes the issues, cleans up the code a bit, and also
adds regression tests.

Pull Request: https://projects.blender.org/blender/blender/pulls/122052
2024-05-21 17:22:41 +02:00
Omar Emara
f0c379e1d3 Realtime Compositor: Implement Fog Glow Glare node
This patch implements the Fog Glow Glare node by porting the CPU
implementation, so it is not GPU accelerated and is not expected to be
realtime. However, after d4bf23771d, it is now fast enough to be usable,
see that commit for more information on the implementation.

The only difference is that the kernel part of the convolution is cached
in the realtime compositor, so it should be about 30% faster than CPU
for interactive editing.

In the future, this implementation will be replaced by a proper GPU
implementation, likely based on VkFFT.
2024-05-21 18:11:01 +03:00
Bastien Montagne
82f9501a4a Collada: Mark the I/O operators as legacy in the UI.
Ref. https://devtalk.blender.org/t/moving-collada-i-o-to-legacy-status/34621
2024-05-21 17:02:00 +02:00
Jacques Lucke
528d946858 Nodes: change node auto offset default from 80 to 40
This was discussed in the last workshop.

Pull Request: https://projects.blender.org/blender/blender/pulls/121974
2024-05-21 16:59:00 +02:00
Omar Emara
429c3f3c7f Compositor: Optimize Fog Glow glare code
Optimize the Fog Glow glare code by making sure TBB is used for
threading, it only uses the needed space for the frequency domain, and
only load the TLD storage once for every threaded invocation.
2024-05-21 17:49:23 +03:00
Jacques Lucke
0ce1c34e25 Fix #122051: crash when node overlay tooltip has allocated argument 2024-05-21 16:39:18 +02:00
Hans Goudey
ab7b4bc7d3 Cleanup: Sculpt: Return transform symmetry matrices by value 2024-05-21 10:20:45 -04:00
Hans Goudey
860c3b43cb Fix #121936: NaN position values with sculpt transform in some cases
Initialization of `pivot_rot` in `SculptSession` was missing. Initialize all
the pivot values just to be safe.
2024-05-21 10:10:07 -04:00
Jeroen Bakker
bce3d363a4 Vulkan: Shader Interface Lifetime
Previously the VKShaderInterface was constructed twice. This was
due to a limitation of the Shader api. Specialization constants
introduced an Shader::init function which allows to pre-initialize
the shader interface before a shader is finalized.

Pull Request: https://projects.blender.org/blender/blender/pulls/122049
2024-05-21 15:17:36 +02:00
Hans Goudey
5c44f9bddc Cleanup: Use references in mesh draw cache 2024-05-21 09:09:07 -04:00
Jeroen Bakker
cdd5fd4522 Cleanup: Make format 2024-05-21 14:36:50 +02:00
Hans Goudey
ff4948fc08 Fix #122036: Preview image crash with asset browser
I can't reproduce this on release or debug builds. But from the strack
traces provided in a couple reports, it looks like the runtime pointer
is null. This makes sense because BKE_previewimg_blend_read is not
called here which is what allocates the runtime struct on file read.
To maintain a "valid" PreviewImage in more code and avoid the
complexity of making the runtime pointer optional, just allocate
it in BLO_blendhandle_get_preview_for_id.
2024-05-21 08:31:10 -04:00
Falk David
125617dc82 GPv3: Replace uses of Layer::frame_key_at
There were multiple places in the GPv3 code that assumed that the
frame key is equivalent to the start frame of the frame with that key.
But this is not the case. The `FramesMapKeyT` is either the start frame
*or* the end frame (for frames with fixed duration).

This adds a new function `start_frame_at` that returns the start frame
number of the frame at `frame_number` or -1 if no such frame exists.

One place needed the index into sorted keys (for onion skinning) so
this was replaced with a new function `sorted_keys_index_at`.

With these changes, `Layer::frame_key_at` is now a private method.

Pull Request: https://projects.blender.org/blender/blender/pulls/122045
2024-05-21 14:25:41 +02:00
Sebastian Parborg
7ff8a7b173 Fix #100115: Show non "Relative" animation keys in the shapekey action editor
Because the shapekey editor is trying to have a more fancy UI with
sliders on each "Relative" shapekey value, all other animatible
properties were not drawn.

This patch now makes it possible to easily work with actions that have
non "Relative" keys. Before this was almost impossible as the user could
not see what action they had selected or which non relative keys were in
them as the UI would think that the action was empty.

While working on this I also noticed that there are some other
properties in relative mode that is not in the action editor either
(Range Min/Max). I added a TODO about that in the code as one would
probably want to group those together in a nice way with either
respective shapekey.

Pull Request: https://projects.blender.org/blender/blender/pulls/121829
2024-05-21 14:05:36 +02:00
Falk David
ba1356e339 Cleanup: GPv3: Rename FramesMapKey to FramesMapKeyT
Other code also uses the suffix `T` to indicate that this is a type.
Note that `FramesMapKeyT` is just an `int` but with a very specific
meaning. Hence the alias to avoid confusions.
2024-05-21 13:16:53 +02:00
Lukas Tönne
fe401aa5d6 GPv3: Allow re-filling an area by ignoring fill materials
Filling an area is typically done with a "Fill"-only material. It should
be possible to fill the same area again (paint "over" the fill stroke)
and get the exact same shape. The draw code for the fill tool, however,
was rendering all strokes with a "Stroke" material, creating a thick
boundary that shrinks the fill area with every iteration.

Image render code for the fill tool now ignores any strokes that don't
have a stroke material.

Pull Request: https://projects.blender.org/blender/blender/pulls/122034
2024-05-21 11:14:33 +02:00
Christoph Lendenfeld
3a40d2813f Anim: Pose Library - Allow blending flipped from the context menu
This adds the `Blend Pose Flipped` option to the
context menu of the pose library.
The operator already accepted a flipped property,
it was just missing a dedicated menu entry for that.

In order for this to work, the modal operator had to be modified.
Instead of setting the flipped state, pressing `Ctrl` now acts as a toggle.
That means that if the operator has been started in flipped mode,
pressing and holding `Ctrl` will unflip it.

This has been a point of discussion in the A&R module meeting
https://devtalk.blender.org/t/2024-05-14-animation-rigging-module-meeting/34614#ux-quirks-in-the-pose-library-shelf-5

Pull Request: https://projects.blender.org/blender/blender/pulls/121857
2024-05-21 11:08:22 +02:00
Philipp Oeser
58f5b128c9 Fix #102872: Custom Normals Average operator ui shows wrong properties
`Weight` & `Threshold` sliders should **not** show in case of `Type` :
`Custom Normal` and **should** show for both `Type` : `Face Area` &
`Type` : `Corner Angle`

In code, it looks like we are gathering `loop_weight` with `val`.
- this is always 1.0 for `EDBM_CLNOR_AVERAGE_LOOP`
- this is taken from `BM_face_calc_area` for
`EDBM_CLNOR_AVERAGE_FACE_AREA`
- this is taken from `BM_loop_calc_face_angle` for
`EDBM_CLNOR_AVERAGE_ANGLE`

Code then compares not equal those values with given threshold, but for
`EDBM_CLNOR_AVERAGE_LOOP` this will never trigger (since all values are
the same), thus `count` is always zero which makes the effective
`n_weight` always 1. So all loop split normals are averaged for a vertex
with the same weight (seems to make sense to me -- at is just plain
average)

Long story short: the condition to show `Weight` & `Threshold` sliders
is just flipped (these only apply for the methods that take neighbor
faces into account).

Pull Request: https://projects.blender.org/blender/blender/pulls/121864
2024-05-21 10:38:11 +02:00
Falk David
82f509a1a4 Cleanup: GPv3: Use Layer::is_empty()
Also adds a docstring for the `is_empty()` method.
2024-05-21 10:33:28 +02:00
Omar Emara
9fd37cf31b Fix #122005: Sun Beams node produces NaNs
The Sun Beams node produces NaNs when the ray length option is zero.
This is due to zero division in the code, which we avoid by skipping
computation altogether when the ray length is zero.
2024-05-21 09:53:15 +03:00
Campbell Barton
3fd05386fc Unbreak error in last commit 2024-05-21 13:20:36 +10:00
Campbell Barton
57707ca9ae Cleanup: const pointers for FCurves where possible 2024-05-21 13:17:35 +10:00
Campbell Barton
9fdd31d331 Cleanup: quiet redundant move warning 2024-05-21 13:17:35 +10:00
Hans Goudey
e5d3ee2b04 Cleanup: Allocate mesh batch cache subdiv cache as non-trivial struct
For future use of RAII types like `Array` and `Vector`.
2024-05-20 23:07:14 -04:00