Commit Graph

26597 Commits

Author SHA1 Message Date
Jacques Lucke
1573091b48 Merge branch 'blender-v4.2-release' 2024-06-07 13:26:54 +02:00
Jacques Lucke
34588cd933 Fix: invalid data sharing after loading certain .blend files
This fixes a bug that happens when two drawings in the same grease pencil
data-block reference the same array. In this case, the same attribute array
pointer is written to .blend files for both drawings. However, when loading the
.blend file, it was not detected that the data is shared. Instead each drawing
would think that it was the single owner of the array even though it was shared.

The same problem can technically occur for all kinds of shared data, and not
just for grease pencil. However, only grease pencil shows this issue currently,
because it can easily happen that the same attribute is shared between different
`CustomData` within the same data-block. This very rarely happens with meshes or
curves, because different `CustomData` usually have different sizes and don't
share the same arrays.

A previous fix (cc891aa699) solved pretty much the same issues for the case
when two layers in the same `CustomData` share data. This original fix is now
generalized and is integrated with `BLO_read_shared` which makes it less error
prone. For each data-block, the `BlendDataReader` now remembers which shared
data it has loaded before so that it is not loaded again.

In the future this could be extended to support data that is shared between
data-blocks, but that's not as straight forward as one would hope currently. For
various reasons, different data-blocks could store independent data at the same
pointer. I specifically noticed that with a regression test file:
`blender/tests/data/modeling/geometry_nodes/attributes/attribute_statistics.blend`.
To support it, one solution could be to tag `BHead` in .blend files to indicate
that a specific pointer is shared and unique within the entire file. But that's
for another day.

Pull Request: https://projects.blender.org/blender/blender/pulls/122780
2024-06-07 13:22:39 +02:00
Campbell Barton
69e6240587 Merge branch 'blender-v4.2-release' 2024-06-07 16:34:09 +10:00
Campbell Barton
dc0e559cbb Extensions: remove intermediate operators for upgrade and sync
The buttons to upgrade or sync extensions called extension
operators via bpy.app.handlers, requiring awkward glue-code
which didn't show error reports in to the user.

Remove these operators and call the upgrade & sync operators directly.
2024-06-07 16:33:03 +10:00
Campbell Barton
333cdfb691 Merge branch 'blender-v4.2-release' 2024-06-07 11:49:05 +10:00
Campbell Barton
715bbbfa0f Docs: clarification for BKE_appdir.hh folder_id
Also add doc-string for bUserExtensionRepo::flag.
2024-06-07 11:46:40 +10:00
Campbell Barton
d8a2517622 Merge branch 'blender-v4.2-release' 2024-06-07 11:37:59 +10:00
Campbell Barton
dc9430c480 Extensions: support system repositories & BLENDER_SYSTEM_EXTENSIONS
Support for "System" extensions as an alternative to the current
"User" extensions repository.

The purpose of this change is to support bundling extensions for
offline work or in environments where users setting up thier own
extensions isn't desirable, see #122512.

Details:

The default "System" repository on Linux will for example use:
- `/usr/share/blender/4.2/extensions/{system}` For system installs.
- `./4.2/extensions/{system}` For portable installs.

- Blender's default startup now has a "System" repository
  which users or administrators may populate.

- Repositories can select between User/System paths,
  setting a custom path overrides overrides this setting.

- Add "BLENDER_SYSTEM_EXTENSIONS" (matching "BLENDER_LOCAL_EXTENSIONS").

Ref !122832
2024-06-07 11:36:20 +10:00
Campbell Barton
c225828aa8 Merge branch 'blender-v4.2-release' 2024-06-07 11:14:09 +10:00
Campbell Barton
f423ec8848 Correct mistake in last commit, accidental declaration included 2024-06-07 11:12:30 +10:00
Campbell Barton
881d83031e Cleanup: minor changes to extension repository handing
- Add a function to initialize all default repositories.
- Rename function for creating extensions.blender.org repo for clarity.

Prepare for !122832.
2024-06-07 11:02:48 +10:00
Sean Kim
b1d2ae7efc Merge branch 'blender-v4.2-release' 2024-06-06 13:16:59 -07:00
Sean Kim
afa4523322 Fix #121008: Paint undo causes uncolored mesh
Update PBVH GPU argument initialization to prefer using the PBVH mesh
attributes instead of the evaluated mesh attributes for color.

The values can be out of sync due to differences with the evaluated
and original mesh data.

Pull Request: https://projects.blender.org/blender/blender/pulls/122850
2024-06-06 22:11:30 +02:00
Brecht Van Lommel
5e1812dbb8 Merge branch 'blender-v4.2-release' 2024-06-06 15:29:35 +02:00
Brecht Van Lommel
f7797a90f6 Core: Make BLENDER_SYSTEM_SCRIPTS always add paths
Originally this would replace scripts that come bundled with Blender,
but it's unclear how this is useful.

Searching for this online mainly leads to people asking how they can
use it to add scripts. For example in a studio environment you might
want to deploy add-ons and startup scripts for all users.

Even if you wanted to use it for replacement though, it wasn't really
doing that and inconsistent for different types of scripts:

* startup: ignored
* modules: replaces bundled scripts
* presets: adds to bundled scripts
* addons (in 4.1): ignored
* addons_core (in 4.2): ignored
* startup/bl_app_templates_system: replaces bundled scripts

This change makes it add scripts from this path for all. This is a
breaking change, though arguably this feature was just broken to
begin with and not used much in practice because of that.

The alternative would be add a new set of environment variables to
avoid breaking existing behavior. But that also means keeping around the
broken behavior or fixing it in another way.

Supporting multiple paths may be used too, but for now just support
a single one as doing this for all BLENDER_SYSTEM variables is
non-trivial. The main use case for that would be add-ons anyway, and
those will mainly be handled through upcoming
BLENDER_SYSTEM_EXTENSIONS instead.

Ref #122512

Pull Request: https://projects.blender.org/blender/blender/pulls/122689
2024-06-06 15:28:44 +02:00
Campbell Barton
d98a7a7756 Merge branch 'blender-v4.2-release' 2024-06-06 10:23:16 +10:00
Campbell Barton
7f7648c6ed Cleanup: spelling in code comments & minor edits
- Use uppercase NOTE: tags.
- Correct bNote -> bNode.
- Use colon after parameters.
- Use doxy-style doc-strings.
2024-06-06 09:55:13 +10:00
Lukas Stockner
c38b711c48 Merge branch 'blender-v4.2-release' 2024-06-05 23:18:48 +02:00
Sergey Sharybin
15b5651712 Fix/workaround linker issues of blender_test on Linux
Seems to be dependent on specific compiler/cmake version.

Is a typical mixture of missing dependencies between libraries,
object files which do not get referenced from other files in the
target, and whole-archive linking of the blender_test target.

Pull Request: https://projects.blender.org/blender/blender/pulls/122801
2024-06-05 21:46:13 +02:00
Lukas Stockner
5891a73785 Merge branch 'blender-v4.2-release' 2024-06-05 20:25:50 +02:00
Hans Goudey
f9a217a276 Sculpt: Clarify and simplify PBVH bounds recalculation
The code for recalculating bounds was fairly tricky to understand, with a
mixture of various flags, a mixture of recursive and parallel code, and
the "original bounds" concept.

This commit separates that update code into two separate paths. The regular
bounds update is split from the resetting of original bounds, which is only
needed in a few places and is best described by a separate function call.
The bounds update itself is split clearly into a parallel update of leaf node
bounds and a recursive merging of child node bounds.

The high level goals this helps to support are:
1. Use data-oriented storage to replace PBVHNode struct.
2. Document concepts like "original bounds", provide a self-descriptive API.
3. Allow brushes to update bounds themselves, for better CPU cache use.

Pull Request: https://projects.blender.org/blender/blender/pulls/122746
2024-06-05 19:33:19 +02:00
Brecht Van Lommel
939e4b2efc Core: Change portable install folder to portable/
There is a mechanism to store config files in the same folder as the
Blender executable. The typical use case is putting Blender on a USB
drive and taking the config with you.

However the problem is that this is using the 4.2/ folder, which is fine
for config/ but with e.g. addons, studiolights and now extensions this
is mixing user and system files. This requires exceptions, doesn't
work well in some cases and is just generally not great design.

Instead use a folder named portable/ that is separate.

Pull Request: https://projects.blender.org/blender/blender/pulls/122778
2024-06-05 18:36:13 +02:00
Lukas Tönne
28ad3e59a7 GPv3: Fix crash when converting LineArt modifiers.
This was using the wrong modifier type identifier, cause conversion code
to use the wrong callbacks and causing buffer overflow.
2024-06-05 15:53:12 +02:00
Falk David
a40a4ccb2f GPv3: Draw Tool: Make "Simplify" option a screen space threshold
Previously, the "Simplify" option was a world space distance threshold.
This meant that zooming in and out of the view changed the way
this option behaved. There were complaints from artists about this.

This change improves two things:
* The simplify algorithm uses the screen space coordinates rather than the
  3D positions.
* The UI setting is in pixels making it much easier to tweak (no need
  for values in the 1e-4 range).

Pull Request: https://projects.blender.org/blender/blender/pulls/122719
2024-06-05 15:06:49 +02:00
Falk David
dd63668790 GPv3: Brush strength conversion
In GPv2 the brush strength was it's own setting in the
`brush->gpencil_settings`. Now we just use the `brush->alpha`
like all other brushes.

Note: The versioning will be done when GPv3 becomes the default.

Pull Request: https://projects.blender.org/blender/blender/pulls/122565
2024-06-05 14:28:11 +02:00
Omar Emara
9ca5289bc1 Merge branch 'blender-v4.2-release' 2024-06-05 14:32:15 +03:00
Omar Emara
9b33340675 Fix #60940: Film-like mapping is bad for RGB curves
The Film-like curve mapping option in the RGB Curves node in the
compositor produces bad results when editing its RGB curves. That's
because Film-like curve mapping only works with the combined curve by
definition, since it is a hue preserving mapping. Furthermore, the
Film-like option ignored the white balancing step altogether.

To fix this, we hide the current curve option for the File-like option
and only allow editing the combined curve, handing the same case for
versioning and RNA updates. Further, we port the implementation from the
realtime compositor which is both correct and takes white balancing into
account.

Pull Request: https://projects.blender.org/blender/blender/pulls/122762
2024-06-05 13:29:39 +02:00
Thomas Dinges
ac41116a1f Revert "Release: Updates for the 4.2 branch"
This reverts commit 618c497801.
2024-06-05 12:33:31 +02:00
Thomas Dinges
7c6d8154bd Merge branch 'blender-v4.2-release' 2024-06-05 12:33:09 +02:00
Thomas Dinges
618c497801 Release: Updates for the 4.2 branch
* Version bumps and pointing gitmodules to the branch.
* Splash screen by Blender Studio (studio.blender.org)
2024-06-05 12:31:19 +02:00
Thomas Dinges
5577fb4303 Bump version for 4.3 2024-06-05 12:10:14 +02:00
Lukas Stockner
5246fb5a57 Cycles: Implement blue-noise dithered sampling
This patch implements blue-noise dithered sampling as described by Nathan Vegdahl (https://psychopath.io/post/2022_07_24_owen_scrambling_based_dithered_blue_noise_sampling), which in turn is based on "Screen-Space Blue-Noise Diffusion of Monte Carlo Sampling Error via Hierarchical Ordering of Pixels"(https://repository.kaust.edu.sa/items/1269ae24-2596-400b-a839-e54486033a93).

The basic idea is simple: Instead of generating independent sequences for each pixel by scrambling them, we use a single sequence for the entire image, with each pixel getting one chunk of the samples. The ordering across pixels is determined by hierarchical scrambling of the pixel's position along a space-filling curve, which ends up being pretty much the same operation as already used for the underlying sequence.

This results in a more high-frequency noise distribution, which appears smoother despite not being less noisy overall.

The main limitation at the moment is that the improvement is only clear if the full sample amount is used per pixel, so interactive preview rendering and adaptive sampling will not receive the benefit. One exception to this is that when using the new "Automatic" setting, the first sample in interactive rendering will also be blue-noise-distributed.

The sampling mode option is now exposed in the UI, with the three options being Blue Noise (the new mode), Classic (the previous Tabulated Sobol method) and the new default, Automatic (blue noise, with the additional property of ensuring the first sample is also blue-noise-distributed in interactive rendering). When debug mode is enabled, additional options appear, such as Sobol-Burley.

Note that the scrambling distance option is not compatible with the blue-noise pattern.

Pull Request: https://projects.blender.org/blender/blender/pulls/118479
2024-06-05 02:29:47 +02:00
Hans Goudey
c1a9ccdf0b Cleanup: Sculpt: Remove redundant flag passed to bounds update
PBVH_UpdateRedraw was always combined with PBVH_UpdateBB.
The use for the "redraw update" isn't clear anyway, since there are
more specific tags for everything that would require a redraw.
2024-06-04 16:06:26 -04:00
Hans Goudey
1e85cdc9ad Cleanup: Sculpt: Move bounds functions to group them together 2024-06-04 16:06:25 -04:00
Hans Goudey
3fa25e3986 Cleanup: Sculpt: Rename and document PBVH bounds functions and fields 2024-06-04 16:06:25 -04:00
Hans Goudey
ed998449d4 Cleanup: Remove redundant prefixes in sculpt_boundary.cc
Remove parts of function names that are redundant with the namespace.
2024-06-04 14:22:13 -04:00
Clément Foucault
916d9d5beb Fix: EEVEE-Legacy: Forgot version bump
This was lost during a merge.
2024-06-04 17:10:05 +02:00
Clément Foucault
cc0d12dd20 EEVEE: Remove EEVEE-Legacy
This handles the transition to EEVEE-Next (now EEVEE).

This removes some things that make no sense to keep
even for compatibility.
- Scene.eevee.light_cache_data
- Scene Light cache operators
- Scene Light cache RNA properties

The remaining legacy properties will be removed later
on to avoid python API breakage.

We keep the identifier of EEVEE-Next as `BLENDER_EEVEE_NEXT`
to avoid addons being incorrectly silently made compatible
with the EEVEE-Next where the Python API is different.
This renaming should be done in 5.0 release.

Thank you EEVEE-Legacy, you served us well.

Pull Request: https://projects.blender.org/blender/blender/pulls/122433
2024-06-04 14:17:58 +02:00
Richard Antalik
f98b01e492 VSE: Improved handle tweaking
This commit changes how users can interact with handles:

Unselected handles are not drawn anymore by default. Handles are bit
thinner. If handle can't be selected, because strip is too small,
it is not drawn.

When hovering over strip handle a cursor is changed to represent a
handle shape. It is possible to select 2 handles at once if strips are
adjoined.

When tweak event happens on unselected handle, handle selection is lost
ater tweaking.

This behavior can be disabled in preferences:
Editing > Video Sequencer > Tweak Handles.

Moving strips with G key works same way as before.

Pull Request: https://projects.blender.org/blender/blender/pulls/109522
2024-06-03 23:17:41 +02:00
Hans Goudey
e2402eb4a9 Cleanup: Use C++ types, references for CCGElem access 2024-06-02 20:36:33 -04:00
Hans Goudey
d374b5abf7 Cleanup: Miscellaneous changes in BKE_ccg.hh
- Remove unnecessary declarations for inline functions
- Remove typedef keyword
- Use C++ casting instead of C-style casts
2024-06-02 20:36:33 -04:00
Hans Goudey
49b52b35d5 Cleanup: Move BKE_ccg.h to C++ 2024-06-02 20:36:33 -04:00
Lukas Tönne
b588daa68b Fix #122538: crash calling curves_copy_point_selection with empty selection
This is accessing curve offsets, which don't have entries for empty
geometry.

Pull Request: https://projects.blender.org/blender/blender/pulls/122499
2024-05-31 16:24:35 +02:00
Jacques Lucke
28cef56ad2 Geometry Nodes: support capturing multiple attributes at once
By capturing multiple attributes with one node, the user can make sure that those
are evaluated together in the same context. This can be quite a bit more efficient
compared to capturing multiple fields separately (also because we don't optimize
grouping multiple capture nodes together yet).

The change is fully backward compatible. Forward compatibility has been added
for some cases. Especially, files created in older versions that are saved with this
newer version will still work in the older version.

Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/121665
2024-05-31 16:23:31 +02:00
Pratik Borhade
c80e30684c GPv3: Lock material layer property
This ports the `lock_material` layer property to GPv3.
For this, the `layer_index` is also required in `retrieve_editable_points`
and `retrieve_editable_strokes` to choose strokes based on
the `lock_material` property.
In `retrieve_editable_elements` we now pass the `MutableDrawingInfo`
to get both the `drawing` and `layer_index`.

Pull Request: https://projects.blender.org/blender/blender/pulls/119913
2024-05-31 15:13:35 +02:00
Campbell Barton
8bd3be2160 Extensions: show extension updates in the status bar
Move extension update display from the splash screen to the status bar.
Based on !122413 with minor changes & removal of splash text.

Co-authored-by: Harley Acheson <harley.acheson@gmail.com>
2024-05-31 21:37:37 +10:00
Iliya Katushenock
fb6b9092a7 Geometry Nodes: new Instance Transform attribute input node
New node to access `instance_transform` built-in attribute of instances.

Pull Request: https://projects.blender.org/blender/blender/pulls/122477
2024-05-31 12:55:40 +02:00
Falk David
a8d395388d Cleanup: GPv3: Remove uses of layers.first_index
Remove uses of `GreasePencil::layers().first_index(...)`.
Use `GreasePencil::get_layer_index` instead.
2024-05-31 12:28:18 +02:00
Sergey Sharybin
1a9db9992a Fix #122451: Crash on animated viewport visibility + animated mesh positions
Move the bounding box synchronization to the geometry evaluation component.
This way it is ensured that it is only done when the geometry is actually
evaluated, solving the problem of accessing stale data when object level
flags are modified.

Pull Request: https://projects.blender.org/blender/blender/pulls/122509
2024-05-31 11:51:36 +02:00
Jesse Yurkovich
dce293b62f Fix unreported: wrong serialization of Quaternion during bake
The `w` field is first in the struct.

Pull Request: https://projects.blender.org/blender/blender/pulls/122530
2024-05-31 09:17:16 +02:00