Commit Graph

113969 Commits

Author SHA1 Message Date
Bastien Montagne
aecdb518db BPY: Add a debug utils to print Python backtrace from C++ code. 2024-10-11 14:17:50 +02:00
Clément Foucault
d8ccaa62fb Merge branch 'blender-v4.3-release'
# Conflicts:
#	tests/data
2024-10-11 14:11:58 +02:00
Jacques Lucke
e7fef63db4 Nodes: improve spacing for panels 2024-10-11 13:38:49 +02:00
Jacques Lucke
a239bfc4dd Refactor: Nodes: improve drawing of nodes based on node declaration
The main goal is to simplify adding support for nested node panels. The patch
makes use of the updated recursive node declarations introduced in
6ffc585fb8.

The main changes are:
* Rewritten node drawing in a way that makes ui design decisions like panel
  visibility and margins more explicit. Especially the handling of margins is
  much better now imo. Previously, it was very hard to change the margin for
  specific cases without accidentally breaking other situations. Now each
  possible case has an explicit margin. This needs a few more lines of code but
  is much easier to work with.
* Rewritten node drawing in panel (sidebar + material properties) using the new
  ways to iterate over the declaration.
* It's possible to add custom layouts at any point in the node declaration now.
  This also replaces the need for having a `draw_buttons` callback for panels.

Pull Request: https://projects.blender.org/blender/blender/pulls/128822
2024-10-11 12:20:58 +02:00
Aras Pranckevicius
bce1ba16ae VSE: Save float image proxies as EXRs to not lose range/precision
Building proxies for images was always saving them as JPG files.
However when input images are floating point (e.g. EXR files), this
loses both range and precision, making the resulting proxies
not really be useful for anything where you'd be using EXR files.

Change this to save float image proxies as EXR instead (FP16 data,
lossy DWAA compression). In my quick tests this does result in about
3x-4x larger proxy file size compared to JPG, however at 50% DWAA
quality that is still 10-30x smaller than original EXRs would be.

Changed proxy image loading to explicitly tell to load metadata. JPGs
were always loading it anyway, but EXRs only load when instructed to
do so.

Pull Request: https://projects.blender.org/blender/blender/pulls/128835
2024-10-11 12:13:14 +02:00
Clément Foucault
300ea9f083 GPU: GLSL: Strip comment at compile time
This speeds up the preprocessor and
will allow for faster load time.

# Conflicts:
#	source/blender/gpu/glsl_preprocess/glsl_preprocess.cc
2024-10-11 11:15:52 +02:00
Omar Emara
317cf37680 Compositor: Implement CPU domain realization
This patch implements the domain realization algorithm for the new CPU
compositor. Only nearest interpolation with no wrapping is implemented
at the moment.

A new sampling method was added to the result class and some relevant
methods were moved into inline functions.
2024-10-11 12:12:24 +03:00
Falk David
24019cc863 Fix: GPv3: Effects not showing in right modes
The object mode flags of the cache population for the effects
were outdated.

This fix makes sure the right flags are used.
2024-10-11 10:54:49 +02:00
Aras Pranckevicius
357eb41513 VSE: Faster float image preview drawing by avoiding float 32->16 bit conversions
Sequencer preview area drawing, when displaying float (EXR/HDR) final
image using GPU based display transform, was converting input float32
data to float16 data for the GPU texture, and the GPU was displaying
that float16 texture.

However this texture is displayed for just one frame, and the cost of
doing the conversion was pretty high. Just send incoming float32
data to the GPU instead.

Playback of EXR sequence at 2048x858 resolution, on
Ryzen 5950X / RTX 3080Ti: 28fps -> 70fps (time to do just the GL
texture upload: 28ms->3ms)

Pull Request: https://projects.blender.org/blender/blender/pulls/128829
2024-10-11 10:14:15 +02:00
Jeroen Bakker
8a6d469cfd Merge branch 'blender-v4.3-release' 2024-10-11 10:06:35 +02:00
Jeroen Bakker
483f96ce73 Fix #128407: EEVEE: Cannot allocate volume pool on Intel ARC/OpenGL
When using OpenGL on Intel ARC the driver reports a max 3d allowed size
of 2048. The volume probe will create a texture that doesn't fit in this
dimension when selecting a probe size of 512 or 1024 MB.

This PR will reshape the volume pool atlas texture until it found a shape
that is optimal and fit on the device. When reshaping selects a different
pool size a warning message will be displayed as it might change the
visual quality.

When reshaping the smallest row size will be selected in order
to improve the occupancy. Reshaping will only happens when a
different setting is set in the `Performance->Memory->Light Probes Volume Pool`.

NOTE: Needs to be backported to 4.2

Pull Request: https://projects.blender.org/blender/blender/pulls/128877
2024-10-11 10:05:56 +02:00
blastframe
70280e9d12 Fix: typo in shadow error message
The error message related to shadow updates in `eevee_shadow.cc`
currently contains a typo:
`"Error: Too many shadow updates, some shadow might be incorrect."`
This sentence should use the plural form of "shadows" to correctly
describe the context.

Fixing this typo ensures clarity and correctness in the error message,
providing developers and users with the appropriate feedback when
encountering shadow update issues.

Pull Request: https://projects.blender.org/blender/blender/pulls/128865
2024-10-11 09:41:31 +02:00
Campbell Barton
326c040aea Merge branch 'blender-v4.3-release' 2024-10-11 16:44:57 +11:00
Campbell Barton
b68ba3dae8 Fix #128839: "Apply Visual Geometry to Mesh" doesn't apply shape-keys
Technically a regression in [0] although it matches behavior prior
to v3.3 going back to 2.7x. The fix for #101883 [1] added a check
for the vertex number changing after the number was zeroed,
causing the shape key to be cleared in most cases.

While the handling of shape-keys in OBJECT_OT_convert wasn't well
defined - clearing the shape-key means in the evaluated coordinates
are always used so it is preferable.

Now the operator ensures the old (un-evaluated) shape-key isn't used.

[0]: 0791f53029
[1]: be32882e1c
2024-10-11 16:43:34 +11:00
Campbell Barton
9e587ce9c7 Merge branch 'blender-v4.3-release' 2024-10-11 11:27:11 +11:00
Campbell Barton
6fe7203d1a Cleanup: suppress dangling-reference warning 2024-10-11 11:24:39 +11:00
Sean Kim
07f298c1e5 Merge branch 'blender-v4.3-release' 2024-10-10 13:49:51 -07:00
Sean Kim
5c855bd6bf Fix: Sculpt: Reduce clay strips z-axis influence
This commit changes the Clay Strips brush in the following ways:
* Removes hardcoded displacement and scaling of brush matrix
* Applies a falloff to the factor based on the distance to the point in
  the brush-local z-axis

This change has the effect of reducing the brush influence on nearby or
other back-facing planes, reducing overall unwanted deformations.

Pull Request: https://projects.blender.org/blender/blender/pulls/128775
2024-10-10 22:49:12 +02:00
Sean Kim
8cf9115fbb Merge branch 'blender-v4.3-release' 2024-10-10 13:42:27 -07:00
Sean Kim
57c4e9dd2c Fix #128820: Mask filter behaves incorrectly with hidden faces
The usage of `hide::node_visible_verts` in this function does not work
as intended, as the resulting span is misaligned with the sliced
per-node mask data. To fix this issue, this commit adds a similar helper
function to copy all hidden vert data and applies changes to all of the
node vertices.

Pull Request: https://projects.blender.org/blender/blender/pulls/128828
2024-10-10 22:40:38 +02:00
Ray Molenkamp
de5ac7395e Merge remote-tracking branch 'origin/blender-v4.3-release' 2024-10-10 12:09:25 -06:00
Omar Emara
c55edd1310 Compositor: Implement previews for new CPU compositor
This patch moves the preview computation code to its own algorithm and
implements it on the CPU as well to support the new CPU compositor.
2024-10-10 18:28:34 +03:00
Clément Foucault
bc3fdc3293 Fix: EEVEE: Object wihtout volume probe visibility don't cast shadow
Object without lightprobe visibility should still
cast shadows during baking. They should only not
bounce indirect lighting.

This is more visible now that shadow linking is supported.

Fix #128812
2024-10-10 16:25:59 +02:00
Clément Foucault
5b70445460 Merge branch 'blender-v4.3-release'
# Conflicts:
#	scripts/addons_core/bl_pkg/bl_extension_ops.py
2024-10-10 16:21:51 +02:00
Clément Foucault
b78354152e Revert "Fix #128407: EEVEE: Cannot allocate volume pool on Intel ARC/OpenGL"
Reverted as it breaks render test on some configs (AMD+Mesa+Linux).
This reverts commit 7d5712be9b.
2024-10-10 16:20:44 +02:00
Clément Foucault
d8b295bfae EEVEE: Add TODO about code going against design 2024-10-10 16:19:14 +02:00
Julian Eisel
10ef436c8f UI: Include asset description in asset shelf tooltip
Tooltips for assets in the asset shelf now don't only display the name,
but also the description saved in the asset's metadata. This is what we
usually do when assets are displayed, for example in the asset browser
or in add menus. Here it was just a small bit of polish that was never
done.
2024-10-10 16:10:34 +02:00
Sybren A. Stüvel
d261a881b1 Anim: change Action.id_root RNA definition to be more like v4.2
Change the `Action.id_root` RNA definition such that
`Action.bl_rna.properties["id_root"].enum_items` returns all valid
values for that property. This was the Blender 4.2 (and older) behaviour
as well.

The only difference now is that v4.3 adds a new `UNSPECIFIED` enum item,
which is not a valid ID type, but is a valid value for `Action.id_root`.

Some more context:

In Blender 4.2 the `Action.id_root` property was a hard-coded list of
all ID types. To add the `UNSPECIFIED` item in v4.3, this was replaced
by an 'items' callback. The way Blender deals with this by default is
such that querying `Action.bl_rna.properties["id_root"].enum_items`
returns its hard-coded default list, and not the result of that 'items'
callback function.

For Action Slots (which will be released in v4.4 but are already in the
sources as experimental feature), there is a similar property that is
implemented in a way such that its `.enum_items` always returns the
proper list. This commit updates the `Action.id_root` RNA property
definition so that it shares code with `ActionSlot.id_root`, fixing the
reported issue.

Note that the `ActionSlot` type is not exposed to RNA in Blender 4.3,
it's just some internal code that is now shared.

Pull Request: https://projects.blender.org/blender/blender/pulls/128834
2024-10-10 14:33:33 +02:00
Clément Foucault
27963d652b EEVEE: Update the GGX LUTs
Pull Request: https://projects.blender.org/blender/blender/pulls/128821
2024-10-10 13:56:13 +02:00
Weizhen Huang
313a7d6236 Fix: EEVEE BXDF LUT generation
Fixes:
1. Mixed use of `sample_reflection` and `sample_refraction`.
`sample_reflection` is intended for when only reflection is required.
For refraction, `sample_vndf` or `sample_refraction` should be used.
2. Wrong weight when accumulating the contribution. Previously
`brdf * NV / (fresnel * pdf)` always evaluates to `GL`, but with the new
technique of bounded VNDF sampling this is not true anymore. Fixed by
adding a field `weight` in the struct `BsdfEval`.
3. Schlick's approximation of the fresnel factor is
`F + (1 - F) * (1 - cos(theta))^5`, but BSDF LUT was using
`cos^2(theta)`, which was incorrect.
2024-10-10 13:56:11 +02:00
Weizhen Huang
0cf7484817 Refactor: EEVEE: separate ggx reflection and transmission functions
They use different techniques, separating them helps with commenting and
readability
2024-10-10 13:56:11 +02:00
Weizhen Huang
3d29979edf EEVEE: improve GGX NDF precision at small roughness
See !125919
2024-10-10 13:56:11 +02:00
Weizhen Huang
3db43b6705 Cleanup: EEVEE: remove unused code block and simplify computations 2024-10-10 13:56:11 +02:00
Weizhen Huang
5df1afad1d Cleanup: EEVEE: remove unnecessary check of normal visibility
We always sample visible normals, this check is unnecessary
2024-10-10 13:56:11 +02:00
Philipp Oeser
e89cf5ecc0 Merge branch 'blender-v4.3-release' 2024-10-10 13:55:29 +02:00
Jacques Lucke
22eac7655d Fix: wrong return type
This only resulted in an assert in debug builds.
2024-10-10 13:55:16 +02:00
Philipp Oeser
da9cf98324 Fix: assert parenting a legacy curve to an armature
The armature modifier calls `BKE_armature_deform_coords_with_mesh` (and
thus `BKE_id_defgroup_list_get`) for legacy curves as well, these are
only "riggable" via envelope weights though (this situation could be
made a bit clearer when parenting -- which is for another commit
though).

So to avoid the (rightful) assert in `BKE_id_defgroup_list_get`, only
call it in case vertex groups are supported (and possibly used later on
-- which is never the case for legacy curves).

Note: this was reported in chat by @LazyDodo because the CurveArmature
test was failing in debug

Pull Request: https://projects.blender.org/blender/blender/pulls/128792
2024-10-10 13:53:51 +02:00
Jacques Lucke
f2352efe55 Fix: wrong return type
This only resulted in an assert in debug builds.
2024-10-10 13:26:07 +02:00
Jonas Holzman
85120627d8 Fix: Wrong RNA doc description for WM_cursor_modal_set() / _restore()
The RNA function doc string / generated bpy documentation for the
`WM_cursor_modal_set` function was being overridden by the documentation
of `WM_cursor_modal_restore` due to a missing `func =`assignment.
Making the `cursor_modal_set` use the documentation of `cursor_modal_restore`,
and leaving `cursor_modal_restore` with no documentation.

Pull Request: https://projects.blender.org/blender/blender/pulls/126227
2024-10-10 12:45:22 +02:00
Jeroen Bakker
318d61756f Merge branch 'blender-v4.3-release' 2024-10-10 12:17:11 +02:00
Jeroen Bakker
9bcba25bc2 Fix #128282: EEVEE: Unable to compile displacement
When using vertex displacement EEVEE didn't compile the generated
functions into the vertex shader. This could result in errors when
compiling materials.

**Notes**

- Should be back-ported to Blender 4.2

Pull Request: https://projects.blender.org/blender/blender/pulls/128525
2024-10-10 12:16:28 +02:00
Jeroen Bakker
a62fa40b58 Merge branch 'blender-v4.3-release' 2024-10-10 11:28:53 +02:00
Jeroen Bakker
7d5712be9b Fix #128407: EEVEE: Cannot allocate volume pool on Intel ARC/OpenGL
When using OpenGL on Intel ARC the driver reports a max 3d allowed size
of 2048. The volume probe will create a texture that doesn't fit in this
dimension when selecting a probe size of 512 or 1024 MB.

This PR will reshape the volume pool atlas texture until it found a shape
that is optimal and fit on the device. When reshaping selects a different
pool size a warning message will be displayed as it might change the
visual quality.

When reshaping the smallest row size will be selected in order
to improve the occupancy. Reshaping will only happens when a
different setting is set in the `Performance->Memory->Light Probes Volume Pool`.

Pull Request: https://projects.blender.org/blender/blender/pulls/128518
2024-10-10 11:28:09 +02:00
Bastien Montagne
d70477ad4e Silence compiler warning about struct initialization.
In C++, in most cases empty braces (aka value initilization) are
the best way to initialize to 0/null (or the default values if
specified in the class/struct declaration).
2024-10-10 11:15:26 +02:00
Bastien Montagne
3adcae5727 Fix compilation warnings with Clang.
Caused by b79dd3fc5d, `nonnull-compare` is a warning option only in
GCC currently.
2024-10-10 11:13:04 +02:00
Anthony Roberts
ef58d4ae26 Windows: Switch to ProcessorNameString for CPU identification on ARM64
This probably should always have been the value used, really.

Now, instead of reporting `Qualcomm Technologies Inc`, it reports the more informative `Snapdragon(R) X Elite - X1E78100 - Qualcomm(R) Oryon(TM) CPU` on a Thinkpad T14s Gen6 device.

Pull Request: https://projects.blender.org/blender/blender/pulls/128808
2024-10-10 10:37:17 +02:00
Campbell Barton
806d1fd1fa Cleanup: quiet set but unused warning 2024-10-10 18:36:08 +11:00
Campbell Barton
c9b7f22e98 Cleanup: use a structure to store edge neighbor for join triangles
Replace 3x arguments and a return value with a structure
that stores the neighboring edges & loops.

Also call add_without_duplicates from a loop instead of inlining.
2024-10-10 18:33:36 +11:00
Aras Pranckevicius
2d5106036f Cleanup: rename OPENEXR_COMPRESS for clarity
Rename to OPENEXR_CODEC_MASK and add comments in several places

Pull Request: https://projects.blender.org/blender/blender/pulls/128814
2024-10-10 08:45:55 +02:00
Jason C. Wenger
dc57693b0c Modeling: add support for merging triangles with reference to topology
A new parameter, topology influence, is added that causes the
join_triangles operator to prioritize edge joins that create quads with
sensible geometry relative to existing quads, instead of selecting the
'flattest' and 'squarest' next pair and then leaving leftover triangles
with no partners to merge with.

This produces its best results with the face and shape thresholds set to
180 degrees (no hard limits as a restriction against merging) and
topology influence somewhere between 100-130%, depending on the mesh.
Too low and many parallelograms and triangles are left, too high and the
algorithm tries too hard and starts making errors.

Note that both quads already present in the selection, as well as the
quads that are generated during the operator, will influence the
topology around them. This allows the modeler to manually merge a few
quads in key areas of the mesh, as a hint to the algorithm, indicating
what result they way they want to see, and the algorithm will then take
those quads into account and try to build around them according to the
modeler's guidance.

A new checkbox to leave only the remaining triangles selected has also
been added. This helps users visualize what remains to be fixed.

Ref !128610
2024-10-10 17:28:59 +11:00