Commit Graph

109838 Commits

Author SHA1 Message Date
Christoph Lendenfeld
037ec5dc2e Fix: shader issue due to varying interpolation modes
The interface `overlay_armature_shape_wire_iface`
used both `smooth` and `flat`. This is not supported in Vulkan.
Changing both to `flat` should fix it.

Pull Request: https://projects.blender.org/blender/blender/pulls/122505
2024-05-30 18:37:14 +02:00
Harley Acheson
2a287dc23c UI: Toggle Camera Passepartout in Viewport Overlays
Allow toggling camera passepartout in the 3DView Overlay popover while
in camera view.

Pull Request: https://projects.blender.org/blender/blender/pulls/122337
2024-05-30 18:03:39 +02:00
Dalai Felinto
1d9f12ac43 Extensions: DEFINE values to use for extensions update count 2024-05-30 17:48:21 +02:00
Habib Gahbiche
192d4dc9dc Compositor: implement bicubic interpolation for Stabilize2DNode
This patch also fixes a crash when image input of `Stabilize2DNode` is unconnected and interpolation is set to bicubic.

Differences to GPU compositor:
- ~1px difference is observed due to different rounding of domain size vs. canvas size. This difference is constant for all image sizes.
- If image input is unconnected but other inputs are, CPU compositor doesn't consider the operation to be constant, whereas GPU compositor still outputs a constant result.

Pull Request: https://projects.blender.org/blender/blender/pulls/122288
2024-05-30 17:38:41 +02:00
Sergey Sharybin
2fc2280e0e Fix #122451: Crash on animated viewport visibility + animated mesh positions
If an object is hidden it is unsafe to look deep into its properties, such
as evaluated mesh state. Do early visibility checks to avoid accessing
possibly stake pointers.

Pull Request: https://projects.blender.org/blender/blender/pulls/122496
2024-05-30 17:34:48 +02:00
Sybren A. Stüvel
95966813ae Anim: add 'Frame Scene/Preview Range' to animation editors
blah

Add a new operator 'Frame Scene Range' to the Dope Sheet, Graph Editor,
NLA, and VSE 'view' menus. It is added both to the regular menu and the
pie menu (by default on the ` hotkey).

The operator will only change the horizontal view, to show the scene
range or the preview range, depending on whether the preview range is
active or not.

The label of the operator switches between "Frame Scene Range" and
"Frame Preview Range" to indicate what will happen.

For the VSE this operator is quite similar to the 'Frame All', as that
by default also frames the scene range. There are a few notable
differences though:

- Frame All includes any strip that extends beyond the scene end frame.
- Frame All ignores the preview range.

Pull Request: https://projects.blender.org/blender/blender/pulls/122311
2024-05-30 17:19:10 +02:00
Dalai Felinto
35a3e64141 UI: Icons: INTERNET_OFFLINE
* INTERNET_OFFLINE icon was discussed here: !122225

Ref: !122486
2024-05-30 17:18:33 +02:00
Clément Foucault
ef4644f3bb EEVEE-Next: Implement LOD bias for sun light
This reduces the impact of tagging volumes and transparent
object when a sunlight is present.
2024-05-30 17:14:37 +02:00
Julian Eisel
44e9544199 Refactor: Extract button text editing data for input handling
Introduces a `uiTextEditing` struct to hold most data for handling text editing,
with improved naming. This should help untangling this code a bit, reduce
perceived complexity, and make the relation between data and the button state
more clear.

Generally I'd like to try to minimize use of `uiHandleButtonData`, to reduce
complexity while increasing flexibility. For example it would be good if text
editing code could be independent of the active button, so a text button can
receive input while other UI elements remain interactive (e.g. for search
popups, which have their own ad-hoc layout, event handling and drawing code).

This is a rather conservative initial refactor, I might follow up with further
(more risky) changes in separate PRs. But this seems like enough of an
improvement to get in first.

Pull Request: https://projects.blender.org/blender/blender/pulls/122332
2024-05-30 17:09:13 +02:00
Falk David
58f133675f GPv3: Draw Tool: Angle option
This implements the angle and angle factor draw tool settings in the `Advanced` panel.

The behavior is changed slightly to GPv2. Instead of calculating the radius of the point
based on an interpolated value between the adjusted radius and the previous point,
in GPv3 the radius is adjusted by a "smoothed angle factor". This factor is the angle factor
based on the previous point, but smoothed over time (by a constant amount).

Pull Request: https://projects.blender.org/blender/blender/pulls/122488
2024-05-30 17:01:37 +02:00
Lukas Tönne
3a86fc971f GPv3: Fill tool: Don't generate outlines for holes
The fill tool generated strokes for exterior as well as interior
boundaries. This is undesirable because fill strokes can't actually have
holes and the overlapping strokes are not very useful.

This reconstructs GPv2 behavior where only the outer-most starting
points for boundaries are used, ignoring interior boundaries.

Pull Request: https://projects.blender.org/blender/blender/pulls/122498
2024-05-30 16:25:27 +02:00
Christoph Lendenfeld
f9ea64b0ba Anim: Per bone wire width for custom shapes
The setting adds the "Custom Shape Wire Width"
option to the "Viewport Display/Custom Shape" section of a pose bone.
As the setting says, this controls how thick the wire is drawn in the viewport.

This is done by adding a geometry shader that makes two triangles out of a line.

The Anti-Aliasing is controlled by the setting
Viewport->Quality->Smooth Wires->Overlay in the user preferences.

## Artifacts
When increasing the line width, the lines start to separate at their vertices.
This comes from extruding each edge along the normal of its direction.
This could be solved by adding round caps in a later PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/120176
2024-05-30 15:51:30 +02:00
Campbell Barton
2bc7a7edfc Cleanup: quiet missing-declarations warning 2024-05-30 23:34:23 +10:00
Lukas Tönne
edd0914853 GPv3: Fill tool smooth & simplify post processing
Adds a smooth pass and a simplify pass after the boundary curve construction.

Pull Request: https://projects.blender.org/blender/blender/pulls/122390
2024-05-30 15:27:50 +02:00
Omar Emara
2b1e825545 Compositor: Refactor GPU context handling
This patch refactors the GPU context handing in the GPU compositor.
First, GPU context handling in the GPU compositor constructor was
removed, that's because the constructor does nothing GPU related.
Second, the destructor and the execute methods were unified to use the
global DST context for main thread execution and a dedicated system GPU
context for threaded execution. The former is the case for blocking
rendering as well as background mode, so the blocking due to the global
DST is not an issue, but it makes the code more robust to implementation
errors like #122070.

Pull Request: https://projects.blender.org/blender/blender/pulls/122389
2024-05-30 15:03:39 +02:00
Omar Emara
99fca1a149 Compositor: Only create GPU context when needed
This patch makes it such that the GPU context required for the
compositor is only created when the GPU compositor is in use. This
should fix #121761 for the CPU compositor, but generally also make the
CPU compositor more robust to such errors in the future, and a tiny bit
faster since context creation is skipped.

Pull Request: https://projects.blender.org/blender/blender/pulls/122420
2024-05-30 15:03:15 +02:00
Dalai Felinto
7ba0d35746 Extensions: wm.extensions_update property
To be tackled by future commits:

* Setting the property when checking for updates.
* Read this property for the splashscreen information (and in the future the status bar).

Ref: !122487
2024-05-30 14:41:05 +02:00
Falk David
94b4542afe GPv3: Refactor: Use GPv2 point times as is
During the conversion of GPv3 to GPv2, we computed the
time difference between the points. So we we're keeping track
of the time a point was created relative to the previous point.

There doesn't seem to be a good reason to do this.
It can also go very wrong in case the times of two points are
very close to one another (which can result in catastrophic
cancellation).

With this change, the time delta values are now the time
a point was created, relative to the first point.

Pull Request: https://projects.blender.org/blender/blender/pulls/122367
2024-05-30 14:12:26 +02:00
Sybren A. Stüvel
97d331c5c3 Anim: improve Action binding enum property items
Split up the "(none/legacy)" enum item for the `AnimData.action_binding`
property.

Depending on the Action in `AnimData.action`, a different item will be
returned. With a legacy Action assigned, it will show "Legacy Action"
with an explanation in the tooltip. Layered actions will now just show
"None".

Pull Request: https://projects.blender.org/blender/blender/pulls/122485
2024-05-30 14:00:05 +02:00
Hans Goudey
7ee189416c UI: Show modifier pinning with icon, adjust name
User feedback has been that the pinned modifier looks broken because
there is no feedback in the UI showing that it's pinned (related to the
recently reported #121620). It's also inconvenient to disable the pinning
if it's required to move the modifier up (before another modifier that
controls normals for example). Now the "Pin" icon is displayed here,
and clicking on it turns off the pinning.

Also, change the property name from "Stick to Last" to "Pin to Last".
"Stick" is a weird word in the UI, it sounds uncommon and strangely
physical. "Pin" is more associated with this concept.

---

![Screenshot from 2024-05-29 11-41-06](/attachments/4581d362-e2fb-4edf-83dd-7f1e1b71ec4d)

Pull Request: https://projects.blender.org/blender/blender/pulls/122444
2024-05-30 13:56:42 +02:00
Sybren A. Stüvel
3f555ee027 Anim: add RNA guards to prevent mixing legacy/layered action operations
Add guards to the RNA code to prevent the creation of legacy data on a
layered Action, and vice versa.

On a legacy Action, it is now impossible to create new layers or bindings.

On a layered Action, it's now impossible to create legacy F-Curves or
groups.

Refactor: Anim: rename bl_animation_id.py to bl_animation_action.py

The `Animation` datablock is no more, and this file tests `Action`.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/122483
2024-05-30 13:19:21 +02:00
Habib Gahbiche
9484770551 Compositor: Switch View: automatically update views when render views are enabled/disabled
Remove the button "Update Views" that requires the user to update visible views manually. This is now consistent with the automatic update of compositor tree, when views are added or deleted, see #120685.

The patch also addresses #109866 (not really a fix since behavior in that bug report is intentional).

Pull Request: https://projects.blender.org/blender/blender/pulls/122290
2024-05-30 13:18:10 +02:00
Sybren A. Stüvel
0be9540775 Refactor: Anim: move animation.cc into action.cc
Move the content of `animation.cc` into `action.cc`. This is part of the
removal of the `Animation` datablock, and the injection of its
functionality into the `Action` datablock.

The test file `animation_test.cc` is renamed to `action_test.cc`.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/122480
2024-05-30 12:23:58 +02:00
Sybren A. Stüvel
ba5206b209 Anim: add Action.is_action_layered and Action.is_action_legacy to RNA
Expose `Action::is_action_layered()` and `Action::is_action_legacy` to
RNA.

Motivation for the names: the two functions are so closely related, that I
wanted to give them a more common prefix than just `is_`.

Pull Request: https://projects.blender.org/blender/blender/pulls/122478
2024-05-30 11:54:18 +02:00
Jacques Lucke
cc38c43198 UI: check if only ctrl is pressed when editing label
Previously, the code only checked that ctrl is pressed. This works, but
also allows other keys to be hold at the same time which might conflict
with other shortcuts. Now the code also makes sure that shift and alt
are not pressed.
2024-05-30 11:14:58 +02:00
Jacques Lucke
cd5eb4aa03 Geometry Nodes: support renaming some sockets in the node directly
This adds support for renaming some sockets in the node UI directly by Ctrl+Clicking
on them. This is sometimes more convenient than going to the sidebar. It affects the
Menu Switch and Bake node as well as the Simulation and Repeat zone.

Some related notes:
* The Group Input and Group Output node are not yet supported, because it currently
  breaks the right-alignment on the Group Input node. I couldn't find a workaround for
  this yet.
* Double-clicking on the socket name does not trigger renaming yet. This seems to
  be a deeper issue in the interface code.
* The highlighting when hovering over sockets that can be renamed is very dim
  making it hard to see. Alternatives like drawing a box around the label when hovering
  it (like in list views) have been discussed but seem to be much more difficult to get to work.

Despite these limitations, it seems reasonable to add this already, as it shouldn't affect
anyone negatively. The nodes still look like before.

Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/121945
2024-05-30 10:41:05 +02:00
Philipp Oeser
7a11fad380 Fix #122429: With Cloth brush set, cloth filter (Scale) is disfunctional
The cloth scale Filter relies on properly set up deformation constraints
(this is done in `do_cloth_brush_build_constraints_task`).
Whenever the Brush (not the Filter) is set to `SCULPT_TOOL_CLOTH`
(having it selected prior to the filter), another code path is taken and
the setting up the proper constraints is skipped (making the Filter
disfunctional).

To distinguish between filter usage and brush usage, there were already
checks for the `StrokeCache` (indicating brush usage afaict), so to
resolve, use the same check to prevent entering the particular code path
associated with the `SCULPT_TOOL_CLOTH`.

Probably an oversight in c2f0522760

Pull Request: https://projects.blender.org/blender/blender/pulls/122440
2024-05-30 10:27:21 +02:00
Bastien Montagne
e18dd894b8 Fix #121169: asserts in curve geometry code.
Asserts triggered e.g. by opening Gold production files (like
`pro/shots/220_storm/220_0020/220_0020-anim.blend`). Their root cause
are zero tangent vectors.

The asserts initially came from unormalized normals, but the root issue
is actually using zero vector as axis in calls to
`math::rotate_direction_around_axis`.

While rotating a zero direction vector is possible (though useless),
rotating around a zero axis vector makes no sense?

So this commit adds an assert that the given axis is non-zero in
`rotate_direction_around_axis`. And 'fixes' the found cases triggering
such assert by skipping rotation when the axis (tangent) is null.

Another related issue fixed by this commit is the iterative process in
calls to `calculate_next_normal`, which can accumulate small floating
point errors over time, leading to generating not normalized-enough
normals at some point.

Pull Request: https://projects.blender.org/blender/blender/pulls/122441
2024-05-30 10:24:04 +02:00
Campbell Barton
fc6df04a99 Extensions: support dropping URL's which contain trailing parameters 2024-05-30 16:55:35 +10:00
Campbell Barton
8f97419561 Extensions: show a dialog when dropping a URL while offline
The dialog notifies the user that online access is required with a
button to go to the system preferences.

See #120665.
2024-05-30 16:07:59 +10:00
Clément Foucault
ce062f03a3 Cleanup: EEVEE-Next: Rename lightprobe display files
_No response_

Pull Request: https://projects.blender.org/blender/blender/pulls/122457
2024-05-30 00:15:43 +02:00
Clément Foucault
a6774b2930 EEVEE-Next: Add pdf to LOD to reduce noise from HDRI
Sphere lightprobe have pre-filtered LODs.
Sample lower LODs when PDF is high to reduce variance.
2024-05-30 00:14:51 +02:00
Harley Acheson
3ee8a75e8e Fix #122381: Changes to Text Overlay Colors
Show white text and black outline when dark, black text and white
outline when light. Slight darkening of TH_TIME_GP_KEYFRAME and
the red used for slow FPS to better work with varying backgrounds.

Pull Request: https://projects.blender.org/blender/blender/pulls/122449
2024-05-29 20:10:45 +02:00
Clément Foucault
ec36412c45 Overlay: Make Facing overlay not rely on render engine depth
This add depth writting to avoid missing pixels that haven't
been rendered by the render engine. But this forces to
not use the blending mode (otherwise we would have
order dependent results). Removing blending breaks selection
outlines so we have to move the rendering of the facing
overlay before the outline overlay. This doesn't fix the
situation for in-front objects but it improves the current
behavior for non-in-front objects.

Fix #121662
2024-05-29 17:54:42 +02:00
Clément Foucault
fabdeff9ca Fix: EEVEE-Next: Wrong variable in versioning code
Caused by 32259aa0b6
2024-05-29 17:54:42 +02:00
Bastien Montagne
b32d026441 Fix (studio-reported) unlinkable IDs made directly linked during blendfile write.
Regression from 435b6743fd, no usage of unlinkable ID (mainly
shapekeys...) should make them directly linked.

Note that this had no serious consequences, it was mainly printing annoying
error messages in release builds, and asserting in debug ones.
2024-05-29 17:38:08 +02:00
Harley Acheson
50bf1f3a52 Fix #122395: Fix Icon Errors Building Headless
Add defines to allow building headless, otherwise we
get undefined symbol errors for UI_icon_from_event_type

Pull Request: https://projects.blender.org/blender/blender/pulls/122406
2024-05-29 17:32:28 +02:00
Hans Goudey
628e34fdfb Cleanup: Use C++ types for sculpt boundary brush data 2024-05-29 11:04:33 -04:00
Jacques Lucke
7be4d4f443 Nodes: automatically move viewer node to current node
This improves working with viewer nodes in geometry and compositor nodes.
Previously, the viewer node would typically stay at the position where it was first
inserted which leads to very long links in many cases. Now the viewer node
automatically moves to the place where the user ctrl+shift+clicked to view data.

The viewer is placed slightly to the right and top of the current node. It is moved
up a bit, so that it does not get in the way as quickly when the user wants to add
another new node. Furthermore, the viewer node position is chosen so that it
does not intersect with other nodes.

In the future we could implement animating the node position so that it slowly
transitions to it's new places.

Pull Request: https://projects.blender.org/blender/blender/pulls/121951
2024-05-29 16:49:33 +02:00
Hans Goudey
96415bc42a Sculpt: Specialize a few vertex neighbor iteration cases for BMesh
The start of a transition to remove this API more generally.
2024-05-29 10:41:41 -04:00
Clément Foucault
32259aa0b6 Fix: EEVEE-Next: Versioning older file to remove indirect volume light
Make sure older file have indirect volume lighting disabled to
avoid this new feature washing out the volume object lighting.
2024-05-29 16:19:32 +02:00
Clément Foucault
4ab652256d Fix: EEVEE-Next: Invisible volume without any shader attributes
By removing the check we make it possible to render volume objects
even if the shader doesn't require any volume attribute.

We still check if there is any attribute to not draw empty
volume objects that have no attribute as a unit cube.

Fix #103683
2024-05-29 16:17:53 +02:00
Clément Foucault
204f56e59d EEVEE-Next: Add jittering in fast GI bitmask angle
This avoids banding artifacts caused by the finite bitmask
using for Fast GI / Ambient Occlusion.

Fix #116032
2024-05-29 16:01:58 +02:00
Philipp Oeser
40e036b63e Fix #122344: PLY exports non-normalized custom normals on scaled objects
On export, PLY creates a matrix (in `set_world_axes_transform`) -- the
inverse transpose of the regular matrix [seems like the usual way of
transforming normals]] --  by which the normals are multiplied. This can end
up in non-normalized custom normals on scaled objects though. Corrected
in this PR by just normalizing after said multiplication.

On import, `BKE_mesh_set_custom_normals_from_verts` is used with the raw
data -- which ends up in `mesh_normals_corner_custom_set` which in turn
"is expected to have normalized normals" (from the comment).
We _could_ also make sure to normalize on import, however, setting these
properly on export seems the primary choice.
Other importers also dont go the extra route of making sure to normalize
the incoming data, so this seems to be in line of what other Im-/Exports
do.

Pull Request: https://projects.blender.org/blender/blender/pulls/122432
2024-05-29 15:39:24 +02:00
Hans Goudey
98eecfcff0 Cleanup: Sculpt: Use C++ Vector for vertex neighbors 2024-05-29 08:58:10 -04:00
Jacques Lucke
05820ae1cc Cleanup: remove unnecessary assert
It doesn't make sense to check if an unsigned integer is >= 0.
2024-05-29 14:55:14 +02:00
Jacques Lucke
59ae253664 Fix: remove test for removed method
The method was removed in bea8825446.
2024-05-29 14:54:31 +02:00
Iliya Katueshenock
bea8825446 Cleanup: BLI: Remove Span::get method
Unlike to `lookup_or_default` accessor methods of `Map` or attribute provider class,
`Span::get` is not so explicit and self described to be used with default value.
Other one issue was is that result is by value. But this is not the main reason to
delete this method. And although this can be fixed by reference, this is still not
such good to just have method to check index and return something.

Pull Request: https://projects.blender.org/blender/blender/pulls/122425
2024-05-29 14:26:21 +02:00
Pratik Borhade
c7635fa200 GPv3: Assert on translating keys
Caused by f011d8f508.
`ale->update` should be 0 after animdata update. Otherwise it would
cause the assert (it also ensures all update cases are handled for keys).

Resolves #122259

Pull Request: https://projects.blender.org/blender/blender/pulls/122435
2024-05-29 14:24:37 +02:00
Iliya Katueshenock
022620b490 Fix: Missing space in tooltip
Fix of change from e6ccff1044

Pull Request: https://projects.blender.org/blender/blender/pulls/122434
2024-05-29 14:05:54 +02:00