Commit Graph

109986 Commits

Author SHA1 Message Date
Hans Goudey
070ffeea22 Mesh: Draw: Replace extractor abstraction for facedot normals buffer
Part of #116901.
Also allows removing the "extractor overrides" code and deduplicating
the handling of high quality normals with templates.
2024-06-05 14:20:01 +02:00
Hans Goudey
2eaab5bbb0 Mesh: Draw: Replace extractor abstraction for tangents buffer
Part of #116901.
2024-06-05 14:20:01 +02:00
Hans Goudey
a1b6989ddc Mesh: Draw: Replace extractor abstraction for vertex normals buffer
Part of #116901.
2024-06-05 14:20:01 +02:00
Hans Goudey
782f3411d0 Sculpt: Start data-oriented refactor for draw brush
This PR establishes the beginning of the transition to data-oriented code
for sculpt brushes described in #118145. The final brush "API" design is
still in progress, and further iteration will be required as more brushes are
refactored and other areas can be cleaned up.

Currently the main goal is making the code paths more obvious and easing
future development, but this change itself may also give a performance
improvement. In a simple test with a large mesh, that was about 14%.

Co-authored-by: Sergey Sharybin <sergey@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/121835
2024-06-05 14:09:14 +02:00
Pratik Borhade
03d3f2fa73 Fix #81948: Regression: Sculpt mode Annotation tool cursor conflict
Sculpt brush cursor is still drawn when annotation tool is selected.
Use `SCULPT_poll` function for paint cursor poll function (`pc->poll`).
This new poll function checks whether active tool is brush. In case of
non-brush tools (transform, annotate), poll function will return false
which eventually prevents pc->draw() from drawing the brush cursor.

Fix is similar to !122657

Pull Request: https://projects.blender.org/blender/blender/pulls/122709
2024-06-05 13:46:59 +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
Clément Foucault
8d2421bcea Fix: EEVEE-Next: Broken Blend Mode versioning
This was caused by #122706 which moved the
versioning after linking where the engine is
already changed to EEVEE-Next. This made the
versioning never run.

# Conflicts:
#	source/blender/blenloader/intern/versioning_400.cc
2024-06-05 11:37:41 +02:00
Pratik Borhade
25351738f7 UI: Add title to tree view context menus
Add new string member in `AbstractView` class to store title/header of
tree view. Later use this to set title (`pup->title`) of context menu.

Pull Request: https://projects.blender.org/blender/blender/pulls/120694
2024-06-05 11:28:44 +02:00
Sebastian Parborg
38dd4a5e9a Fix: Wonky behaviour of "Frame All" and "Frame Selected" in the VSE
Both these operators would quite often put the framed strips offscreen.
This was in part due to the padding need to make sure that the strips
were not going to be obscured by the scrub area or overlays not being
applied or calculated correctly.

In addition to that, the view positioning logic was not in sync with the
vertical clamping code. This lead to the operators positioning the view
into a forbidden state. So the clamping logic would adjust the view
afterwards and thus put some of the framed strips offscreen.

This patch unifies the logic used by the "frame X" operators and the
clamping code, making them play nice with each other.

Pull Request: https://projects.blender.org/blender/blender/pulls/122219
2024-06-05 11:18:23 +02:00
Jacques Lucke
8beb91118c Cleanup: make format 2024-06-05 10:41:07 +02:00
Leon Schittek
db5d410164 Node Editor: add overlay to automatically label reroute nodes
Add an overlay option to automatically display a label on reroute nodes.

This automatic label is propagated through chained reroute nodes and
is based on the explicit label of linked reroute nodes.

The automatic label is dimmed to distinguish it from manually set ones.

Pull Request: https://projects.blender.org/blender/blender/pulls/113368
2024-06-05 10:02:37 +02:00
Nathan Burnham
1c92d26bfc PyAPI Doc: fix typos causing untyped parameters
The type for `bpy_struct.keyframe_insert()`'s `options` parameter was
instead applied to a non-existent `flag` parameter.

The description and type for `mathutils.Vector.Repeat()`'s `vector`
parameter was instead applied to a non-existent `tuple` parameter.

Also fix a reference to `BMElemeSeq` instead of `BMElemSeq`.

Ref: !122734
2024-06-05 16:25:05 +10: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
Bastien Montagne
fad031a3a9 Fix (unreported) crash when setting current frame from the UI.
Regression from f98b01e492. Better check if a Scene has a sequence
editor, before accessing its data...
2024-06-04 21:51:16 +02:00
Habib Gahbiche
ccdba13492 Compositor: remove viewer crosshair to set tile priority
The functionality has already been removed in https://projects.blender.org/blender/blender/pulls/121176. This patch removes the drawing in backdrop compositor.

Pull Request: https://projects.blender.org/blender/blender/pulls/122639
2024-06-04 21:15:17 +02:00
Habib Gahbiche
6521577e4a Fix compositor crop gizmo ignores offset
Backdrop gizmo of Crop Node ignores image offset caused by Transform or Translate node

Pull Request: https://projects.blender.org/blender/blender/pulls/122632
2024-06-04 21:14:35 +02:00
Aras Pranckevicius
078a737fd6 Format 2024-06-04 22:08:42 +03:00
Omar Emara
4f21b26675 Fix #121639: Glare shifts the colors of highlights
The Glare node shifts the color of the highlights when the threshold is
high. That's because the thresholding algorithm simply subtracts the
threshold from the RGB data, which is not expected to retain the same hue
of the color.

To fix this, we do the thresholding only on the luminance of the color
in HSV color space. This eliminates the color shifting and also helps to
smooth the edges of the highlights.

This is a breaking change, but it is more of a fix rather than a change
of behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/122570
2024-06-04 20:59:32 +02:00
Jesse Yurkovich
9ad2c7df0b USD: implement native Unicode support
Make use of USD's new UTF-8 support to allow our import/export code to
accept and generate appropriate USD files. This has been a long standing
shortcoming since USD's introduction, with incomplete and complicated
DCC-specific workarounds often attempted.

Summary of changes
- Export gets a new "Allow Unicode" option defaulting to "false". The
  new Unicode USD files are not backward compatible. DCCs using older
  versions of USD (before 24.03) will not be able to load such files so
  we want to provide this as an opt-in option for now.
- Every location which used to call either `USDHierarchyIterator::make_valid_name`
  or `pxr::TfMakeValidIdentifier` will now go through a new `make_safe_name`
  API instead
- Export code is responsible for passing in the `allow_unicode` option
- Import code will always pass in `true` meaning Blender will happily
  accept both existing and new Unicode USD files

Strangely, USD does not provide a convenient way of making valid UTF-8
identifiers and they left their old API unchanged. We had to roll our
own per their advice: https://forum.aousd.org/t/how-to-make-a-unicode-identifier-valid/1435

Pull Request: https://projects.blender.org/blender/blender/pulls/122471
2024-06-04 20:53:57 +02:00
Harley Acheson
f5131cdee0 Fix #122411: Sub-panels Not Clickable When Popover is Scaled
When a popover includes panels, the calculation of whether the mouse
is over the panel header does not take into consideration local 2D
scaling. Therefore the hit area is in the wrong location if scaled.

Pull Request: https://projects.blender.org/blender/blender/pulls/122696
2024-06-04 20:28:12 +02:00
Sean Kim
dd9ea5de6b Sculpt: Adjust Extrude Mode option descriptions
Adjusts the UI text to be similar to the manual description

Pull Request: https://projects.blender.org/blender/blender/pulls/122731
2024-06-04 20:26:44 +02: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
Hans Goudey
bf02cead33 Cleanup: Remove redundant prefixes in sculpt_expand.cc
Remove parts of function names that are redundant with the namespace.
2024-06-04 14:22:13 -04:00
Hans Goudey
b5ef3f0b6a Cleanup: Sculpt: Move update flush tags and functions to namespace
Also conver the update flags to  a regular enum class.
Only a single type was used at the same time anyway.
2024-06-04 14:22:13 -04:00
Aras Pranckevicius
7fdfa47f23 VSE: Rounded corners for timeline strips
VSE timeline strips now have rounded corners. Strip corner rounding radius is
4, 6 or 8px depending on strip height (if strip is too narrow to fit
rounding, then rounding is turned off).

This is achieved with a dedicated GPU shader for drawing most of VSE
strip widget, that it could do proper rounded corner masking.

More details and images in the PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/122576
2024-06-04 20:05:35 +02:00
Jacques Lucke
1604eb9821 Geometry Nodes: expose instance transform field as default input for node groups 2024-06-04 19:02:02 +02:00
Jacques Lucke
820edb920d Geometry Nodes: use instance transform as default in Set Instance Transform node
With this, the node does not change the transforms of the instances by default.
Previously, all instances were always reset to the origin.
2024-06-04 18:42:42 +02:00
Jacques Lucke
a26962ee75 Fix: handle object transforms with skew more gracefully in Object Info node
This is similar to the changes done for `normalized_to_quaternion_safe`.
It's quite easy to get object matrices with skew by rotating an object and making
if a child of another non-uniformly scaled object.
2024-06-04 18:35:37 +02:00
Hans Goudey
aa81e2dd4a Fix #122455: Wireframe overlay can crash with loose geometry
The `nor` vertex buffer wasn't large enough for the indices in the lines
index buffer. This is undefined behavior at best AFAIK. On some drivers
it caused crashes when there was only loose geometry.

This commit makes the VBO large enough for all indices, filling the loose
geometry normals with (0,0,0,0), which the overlay wireframe shader
already checks for.

Pull Request: https://projects.blender.org/blender/blender/pulls/122720
2024-06-04 17:43:11 +02:00
Falk David
b5a4786064 GPv3: Draw Tool: Stabilize Stroke setting
This adds the "Stabilize Stroke" setting to GPv3.

It also makes it possible to hold "shift" to activate the stabilize option
temporarily like in GPv2.

Pull Request: https://projects.blender.org/blender/blender/pulls/122556
2024-06-04 17:35:48 +02:00
Clément Foucault
57e92e9192 Fix: Overlay: Facing overlay is not transparent with zero alpha
The recent changes removed the blending when rendering
to the framebuffer. The blending was doing the
premultiplication.

Fix #122470
2024-06-04 17:19:22 +02: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
Jacques Lucke
be0d7522ea Geometry Nodes: support link drag search for capture attribute node
Now it's possible to use link-drag-search with the extend socket of the Capture Attribute node again.

Implementation wise, the main unexpected things I noticed are that
`update_and_connect_available_socket` did not update the node declaration and currently uses
socket names instead of identifiers. This works fine right now, but should eventually be changed
to use identifiers (separate from this commit though).

Pull Request: https://projects.blender.org/blender/blender/pulls/122716
2024-06-04 16:58:14 +02:00
Nathan Vegdahl
b9c7e5e766 Anim: add keyframing unit tests
Add unit tests for the two main keyframing API functions: `insert_key_rna()` and `insert_keyframe()`.

The tests are not exhaustive of every possible permutation of parameters, but the tests do try to hit each of the behaviors in at least one permutation.  In the future tests should also be added for the lower-level keying functions and behaviors as well, but I'm leaving that as future work since we aren't changing/refactoring those functions right now.

Pull Request: https://projects.blender.org/blender/blender/pulls/122553
2024-06-04 16:03:52 +02:00
Falk David
8a1b239f5c Cleanup: GPv3: Use constexpr for compile time constant 2024-06-04 15:52:25 +02:00
Falk David
fabc274089 Fix: GPv3: Draw Tool: Spacing not working properly
The "Spacing" option had a few issues:
* If the radius unit of the brush was "Scene", the spacing wasn't correctly
  calculated based on the size of the brush in view space.
* The maximum spacing could get very small, leading to extremly dense
  strokes.

This makes sure we correctly calculate the brush radius in pixels and
then clamps the spacing so we don't subdivide too much.
It's hardcoded to a maximum of 4 points per pixel, which should be plenty.
2024-06-04 15:52:25 +02:00
Sergey Sharybin
44ce0e01cd Fix #122669: Compositor: Corrupted output and occasional crash
This change fixes:
- Constant folder uses rect of size INT_MIN .. INT_MAX, which overflows integer
  when calculating size.
- Calculation of an offset inside of input can lead to integer overflow for big
  resolutions.
- texture_bilinear_extend() and texture_nearest_extend() do not seem to handle
  single element buffers correctly.
- Kuwahara has division of zero when the input size is 0.

Pull Request: https://projects.blender.org/blender/blender/pulls/122674
2024-06-04 15:48:48 +02:00
Jacques Lucke
78c1c1a170 Geometry Nodes: support matrix socket in accumulate field node
This adds support for transform matrices in the accumulate field node. This is quite
useful to evaluate chains of parent matrices (although branching is not easily possible
with this approach).

The main tricky thing here is that matrices are generally accumulated using
multiplication and the order of multiplication matters. For other data types we
currently always use addition. I don't have use cases for other ways to accumulate
matrices right now, so maybe it's fine not to add additional options here for now.
It should be fairly straight forward to version this to support more accumulation
modes in the future. Additionally, I hope we get a more general solution for custom
accumulations at some point.

Pull Request: https://projects.blender.org/blender/blender/pulls/121326
2024-06-04 15:21:59 +02:00
Jeroen Bakker
6a71a91b83 EEVEE-Next: Light Probe RNA
Split `bpy.types.LightProbe` into specialized subclasses.
- Rename all grid_* to remove the prefix in the RNA and limit access to
  volume probe.
- Parallax and other sphere probe only properties should be limited to
  sphere probe.
- `visibility` properties are deprecated (to be removed in a future
  Blender version)

Ref #113976

Pull Request: https://projects.blender.org/blender/blender/pulls/122353
2024-06-04 15:05:22 +02:00
Guillermo Venegas
19572321f1 UI: Rename Import SVG to Import SVG as Grease Pencil
Since the operator name is used in the confirmation dialog on
drag-and-drop, this makes it clear what action is being performed.

Pull Request: https://projects.blender.org/blender/blender/pulls/121172
2024-06-04 15:00:01 +02:00
Jeroen Bakker
c7807a425a EEVEE: Alias/remove legacy RNA material attributes
- `bpy.types.Material.blend_method` aliases `bpy.types.Material.surface_render_method`.
  'Opaque' and 'Alpha Clip' maps to deferred.
- Renamed `show_transparent_back` to `use_transparency_overlap`
- Renamed `use_screen_refraction` to `use_raytrace_refraction`
- Deprecate `use_sss_translucency` and `use_sss_translucency`

Related to: #113976

**NOTE**
The light probe changes will be done in a different patch.
Both patches should land just before we remove EEVEE Legacy
from the code-base.

Pull Request: https://projects.blender.org/blender/blender/pulls/122297
2024-06-04 14:48:40 +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