Commit Graph

120055 Commits

Author SHA1 Message Date
Thomas Dinges
eaeaf8322c BLI: Bump SSE check from 4.1 to 4.2
This will be the new minimum for Blender 4.2, so check for the SSE4.2 flag and update the function name.

Pull Request: https://projects.blender.org/blender/blender/pulls/118058
2024-02-09 20:28:46 +01:00
Bastien Montagne
6c6a3b8afc Cleanup: make format. 2024-02-09 19:52:55 +01:00
Bastien Montagne
e71ae3b16c Cleanup: Move BKE_collection.h to CPP header. 2024-02-09 19:42:38 +01:00
Bastien Montagne
deab8c085a Cleanup: Move BKE_callbacks.h and BKE_cachefile.h to CPP headers. 2024-02-09 19:29:34 +01:00
Hans Goudey
d1d3d998ea Fix: LibOverride: Memory leak after recent std::string conversion
An allocated char pointer was reassigned without being freed.
Fix by replacing the error-prone combination of C strings and
std::string with a complete conversion to std::string. Also change
the logic a bit to allow moving the path string in some cases
instead of copying it.

Pull Request: https://projects.blender.org/blender/blender/pulls/118046
2024-02-09 19:29:03 +01:00
Bastien Montagne
a9b2cf8ce6 Cleanup: Move BKE_path.h to CPP header. 2024-02-09 19:23:03 +01:00
Bastien Montagne
b21ceece05 Cleanup: Move BKE_blender.h to CPP header.
Also fix comment in `build_files/cmake/macros.cmake`, CMake blender version
parsing depends in the (still C) `BKE_blender_version.h` header now.
2024-02-09 19:12:23 +01:00
Bastien Montagne
45e7827898 Clenup: Move BLT headers to Cpp.
Noisy but fairly straight forward.
2024-02-09 18:59:42 +01:00
Hans Goudey
f21b5663e2 Cleanup: Update naming in mesh DNA header comments
Also attempt to improve wording on a few of the descriptions.
2024-02-09 12:25:34 -05:00
Hans Goudey
7e13522a4f Merge branch 'blender-v4.1-release' 2024-02-09 11:43:26 -05:00
Harley Acheson
4c50e6992f UI: Configurable Layout Separators
Ability to create vertical bar separators in horizontal layouts,
horizontal lines in popovers, and vertical (non-line) spacers in menus.

Pull Request: https://projects.blender.org/blender/blender/pulls/117310
2024-02-09 17:38:36 +01:00
Hans Goudey
93e72912e1 Fix #118014: Sculpt: Some brushes don't work with dyntopo
After bb080140c0, `SCULPT_pbvh_calc_area_normal` returned
std::nullopt when it didn't sample any vertices, instead of returning
an ignorable boolean return value. There was a false negative failure
though, because it didn't keep track of when it sampled BMesh "orco"
vertices.
2024-02-09 11:37:40 -05:00
Aras Pranckevicius
6f7ac2be53 VSE: Simplify and speedup sequencer cache drawing
5 years ago (18b693bdbd) part of cache rendering was converted to not
draw one quad at a time. However the other part (drawing strip
backgrounds when cache visualization is on) was left still drawing one
quad at a time.

Now that sequencer timeline drawing code has SeqQuadsBatch that batches
arbitrary number of things for drawing fairly easily, the existing
cache drawing batching code can be simplified to just use that, and
the background code changed from immediate quad drawing to use the
batcher.

Sprite Fright edit, whole timeline visible, all caches visualized and
full: `draw_cache_view` on Windows/Ryzen5950X goes 2.40ms -> 0.16ms.
And there's less code.

Pull Request: https://projects.blender.org/blender/blender/pulls/118027
2024-02-09 17:17:54 +01:00
Bastien Montagne
0fd8f29e88 IDManagement: Update the Purge operator to display an interactive popup.
Make the 'purge' operation show an interactive popup by default, with
a preview of the type and amount of data-blocks to be deleted.

Idea and initial UI/UX design are from @Harley (see PR !117242).

Pull Request: https://projects.blender.org/blender/blender/pulls/117304
2024-02-09 17:01:33 +01:00
Bastien Montagne
09a2688684 Refactor BKE_lib_query_unused_ids API.
Add a new `BKE_lib_query_unused_ids_amounts` to query expected amounts
of deleted IDs. This function does not tag IDs in main anymore.

Factorize most parameters (and output data) into a new struct
`LibQueryUnusedIDsData`.

Part of PR https://projects.blender.org/blender/blender/pulls/117304.
2024-02-09 17:01:31 +01:00
Sybren A. Stüvel
899b53e9d8 Cleanup: Anim, add explanation to bone collection code
I had questions about my own code, so I answered them in a comment.

No functional changes.
2024-02-09 16:58:01 +01:00
Lukas Tönne
b8bb5a0700 Fix: GPv3: Read/write of the parsubstr (parent bone name)
This is now an allocated string and needs to be mapped on file read.

Pull Request: https://projects.blender.org/blender/blender/pulls/118048
2024-02-09 16:51:32 +01:00
Miguel Pozo
98231ea880 GPU: Optimize GLStorageBuf::read performance
Add a separate persistent mapped buffer where the main SSBO can be
copied, so its contents can be read from the CPU without stalling the
GPU.

Pull Request: https://projects.blender.org/blender/blender/pulls/117521
2024-02-09 16:11:33 +01:00
Bastien Montagne
c065ef94ee Readfile: Make 'alloc name' for ID type automatically generated.
Avoids having yet another `switch` case over all ID types.

Note that we could also add a string to the IDTypeInfo, but imho this is
a bit too limited in scope/interest to expose this outside of the readfile
code.

Pull Request: https://projects.blender.org/blender/blender/pulls/117958
2024-02-09 16:04:53 +01:00
Philipp Oeser
c5659e56c5 Merge branch 'blender-v4.1-release' 2024-02-09 15:40:01 +01:00
Damien Picard
990c0ad42c Fix #113803: some cloth weight groups change on reordering
When reordering vertex groups on a mesh, some cloth properties would
get affected by another group, because they were based on group index
instead of name.

This issue was already handled by
`BKE_object_defgroup_remap_update_users()` for some properties, but
not all.

This commit extends the function for missing properties: Shrinking,
Shear, Internal Springs, Pressure, Self Colllisions and Object
Collisions.

Pull Request: https://projects.blender.org/blender/blender/pulls/114032
2024-02-09 15:39:09 +01:00
Philipp Oeser
568c99d191 Fix #117989: GPv3: Cannot move Node(s) in Geo Node Editor in 'Edit Mode'
The transform system reacts to `CTX_GPENCIL_STROKES` in a special way
that is only useful in `SPACE_VIEW3D`.
There was a similar case fixed in 23e9ebfdbd, but there would be
multiple other places to also check the spacetype.

So now do this more generalized and only ever set `CTX_GPENCIL_STROKES`
if we are in editmode (that check existed before) **and** in
`SPACE_VIEW3D`.

Pull Request: https://projects.blender.org/blender/blender/pulls/118042
2024-02-09 15:11:32 +01:00
Hans Goudey
91e54fdd83 Cleanup: Move BLO_readfile.h to C++
I added a new BLO_userdef_default.h header to contain declarations of
two global variables that are still defined in C files. Use of designated
initializers for large structs make those files harder to change.
Arguably this is a better header for them anyway.

Pull Request: https://projects.blender.org/blender/blender/pulls/118015
2024-02-09 13:41:30 +01:00
Pratik Borhade
84aed88b91 Merge branch 'blender-v4.1-release' 2024-02-09 17:34:25 +05:30
Pratik Borhade
8250502b77 UI: Merge Spin and spin duplicate tools
Both tools calls the same operator, only difference is "dupli" bool
property value. So expose the property in tool settings and remove the
spin duplicate tool

Resolves #98094

Pull Request: https://projects.blender.org/blender/blender/pulls/117880
2024-02-09 13:01:55 +01:00
JonasDichelle
f2e27ef7b6 Cycles: Override World option per View Layer
This feature is useful for many production scenarios as it allows for the
creation of separate render passes with specific worlds. This would help
workflows that require different skies or other backgrounds for compositing.

Ref #117919

Pull Request: https://projects.blender.org/blender/blender/pulls/117920
2024-02-09 12:16:16 +01:00
Omar Emara
9743d6992c Compositor: Unify Variable Size Bokeh Blur node
This patch adjusts the Variable Size Bokeh Blur node such that it
matches between CPU and GPU. The GPU implementation is mostly followed
for the reasons stated below.

The first difference is a bug in the CPU implementation, where the upper
limit of the blur window is not considered, but the lower limit is.

The second difference is due to CPU ignoring outside pixels instead of
clamping them to border, which is done until an option is added to the
node to control the boundary condition.

The third difference is due to CPU ignoring the bounding box input.

The fourth difference is that CPU doesn't allow zero maximum blur
radius, which is a valid option.

The fifth difference is that the threshold option, which is only used
for the Defocus node, was considered in a greater than manner, while it
should be greater than or equal. Since the default threshold of one
should allow a blur size of one.

The GPU implementation now considers the maximum size of its input,
following the CPU implementation.

Pull Request: https://projects.blender.org/blender/blender/pulls/117947
2024-02-09 11:52:41 +01:00
Falk David
1fb113848e Fix: GPv3: Draw tool overwrites hardness value
The draw tool didn't skip over the hardness attribute when
initializing the rest of all the attributes with default values.
2024-02-09 11:30:26 +01:00
Sergey Sharybin
aa051f788d Cleanup: New line at the end of file
Pull Request: https://projects.blender.org/blender/blender/pulls/118032
2024-02-09 11:08:16 +01:00
Sergey Sharybin
a18324ff10 Fix compilation error when WITH_COMPOSITOR_CPU is OFF
The render only uses `ProfilerData` for which it is enough to only
have header. No linking is needed to the bf_compositor for things
to work.

Pull Request: https://projects.blender.org/blender/blender/pulls/118030
2024-02-09 10:55:23 +01:00
Pratik Borhade
69e0e9f19f GPv3: Assert drawing before first frame
Assert at `BLI_assert(active_layer.has_drawing_at(current_frame))`
New keyframe is not added when brush draws on a frame which is before
the first frame that actually contains the drawing.

Pull Request: https://projects.blender.org/blender/blender/pulls/117983
2024-02-09 10:48:23 +01:00
Omar Emara
e20b2d2fb9 Merge branch 'blender-v4.1-release' 2024-02-09 11:37:43 +02:00
Omar Emara
bf94b454c4 Fix: Crash in Inpaint node for large images
The Inpaint node crashes for large images. That's because the output
buffer was only allocated for a single chunk. So allocate the entire
output buffer in the tile initialization step.
2024-02-09 11:35:24 +02:00
Bastien Montagne
bdbaff9b31 Merge branch 'blender-v4.1-release' 2024-02-09 10:26:01 +01:00
Andrej730
8144252aa9 Fix return types in docs for matrix.zero, quat's .negate and .identity
Noticed in mathutils docs (and in python type hinter for mathutils) some methods doesn't return anything though docs stated that they return themselves and fixed the docs.
Related to 9c81833430

Pull Request: https://projects.blender.org/blender/blender/pulls/118011
2024-02-09 10:24:44 +01:00
Sergey Sharybin
467a132166 Compositor: Implement per-node execution time report
Visually it is the same as the execution time implemented for the
geometry nodes, and it is to be enabled in the overlay popover.

The implementation is separate from the geometry nodes, as it is
not easy or practical to re-use the geometry nodes implementation.

The execution time is stored in a run-time hash, indexed by a node
instance key. This is similar to the storage of the mode preview
images, but is stored on the scene runtime data and not on the node
tree. Indexing the storage by key allows to easily copy execution
statistics from localized tree to its original version.

The time is only implemented for full-frame compositor, as for the
tiled compositor it could be tricky to calculate reliable time for
pixel processing nodes which process one pixel at a time.

Pull Request: https://projects.blender.org/blender/blender/pulls/117885
2024-02-09 10:19:24 +01:00
Christoph Lendenfeld
afa4391eeb Fix: Issue with Cycle aware keying when inserting second key
Caused by #113504

While basic cycle aware keying works, there is a special case
when inserting the first key. In that case, after the key has been inserted,
it is duplicated and moved around so the FCurve range from
first to last key is exactly the range of the action.
It also auto-creates the Cycle modifier on the FCurve .

Fix the issue by calling the function that does the key duplication
and cover with unit tests.

Pull Request: https://projects.blender.org/blender/blender/pulls/116943
2024-02-09 10:13:28 +01:00
Campbell Barton
67e3704a45 Merge branch 'blender-v4.1-release' 2024-02-09 18:20:21 +11:00
Campbell Barton
5affe322cc Correct version bump from 41b63ebda2 2024-02-09 18:15:05 +11:00
Campbell Barton
41b63ebda2 Versioning: add missing version update for renamed key-map
Account for the renamed key-map when loading older saved key-maps &
stored user preferences. [0] missed these changes.

[0]: 661e7e451a
2024-02-09 18:11:12 +11:00
Miguel Pozo
ca259f751d Cleanup: Remove unused parameter 2024-02-08 21:13:14 +01:00
Hans Goudey
b2d9f08d5c Merge branch 'blender-v4.1-release' 2024-02-08 14:56:18 -05:00
Hans Goudey
2e6223d90f Geometry Nodes: Move instance reference indices to a builtin attribute
This means the array can be shared between geometries when unchanged,
reducing memory usage and increasing performance. It also means that
handling the data can be done more generically using the attribute
system. In the future the transforms can become attributes too.

Two other changes are related here:
- The "almost unique ids" are cached with a shared cache so they
  are shared too.
- The reference indices are baked as an attribute now, making the process
  more generic and potentially easier to optimize in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/117951
2024-02-08 20:55:34 +01:00
Hans Goudey
7f5f37ea65 Cleanup: Simplify asset metadata copying
Use `BLI_strdupn` instead of repeating the same logic a bunch of times.
Use StringRef where StringRefNull isn't necessary, and use StringRefNull
instead of a std::string reference in one case.
2024-02-08 14:51:01 -05:00
Miguel Pozo
7e8fd2cc2c Fix: GPU: Fix closure evaluation order
EEVEE-Next can only store data for a single (global) closure at a time,
which, when combined with ShaderToRGB nodes, requires extra care in the
order that closures are evaluated.
For example:
![image](/attachments/0c56613f-3515-40a2-bf0e-282a8a99d64e)
Here, after `ntree_shader_shader_to_rgba_branch` there will be 2 Diffuse
nodes (the original and a copy for the ShaderToRGB branch).
However, the generated code order will be something like this:
```
Diffuse (original)
Diffuse (copy)
ShaderToRGB // This resets closures
Mix
```
So while the original node is technically "evaluated", the closure data
is reset after ShaderToRGB.
This patch updates the code generation to ensure closure evaluation is
ordered taking ShaderToRGB branches into account, so the generated code
looks like this:
```
Diffuse (copy)
ShaderToRGB // This resets closures
Diffuse (original)
Mix
```
This also fixes ShaderToRGB support for AOVs, removes unused code, and
fixes several bugs that I've found along the way that were harmless for
EEVEE but broke EEVEE Next.

Pull Request: https://projects.blender.org/blender/blender/pulls/117767
2024-02-08 20:43:50 +01:00
Miguel Pozo
a1ceeef2f9 Merge branch 'blender-v4.1-release' 2024-02-08 19:58:07 +01:00
Miguel Pozo
bf0ac755e2 Fix: EEVEE: Volumes don't render
OrcoTexCoFactors were wrong.
Regression from
fa3bd17ae8
2024-02-08 19:57:18 +01:00
Clément Foucault
63a4c03b09 Refactor: EEVEE-Next: Light-probe management and structure
This cleanup and centralize lightprobe object management
into the LightProbeModule as it was always intended.
The other modules are kept for data / rendering management.

A few logic were simplified along the way.

Rename a lot of defines and classes for more consistency.

No functional change expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/117941
2024-02-08 19:48:28 +01:00
Hans Goudey
30f8dfc474 Cleanup: Fix string format warning after recent commit 2024-02-08 12:21:33 -05:00
Falk David
fb6324bdd0 Fix: GPv3: Draw tool not writing hardness attribute 2024-02-08 17:43:19 +01:00