Commit Graph

136746 Commits

Author SHA1 Message Date
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
Sergey Sharybin
6359464507 Fix #122263: Pause Preview icon does not update
Happens when opening a file saved file with preview paused.
This fix covers the typical use-case when the property is modified
from the space it comes from.

Pull Request: https://projects.blender.org/blender/blender/pulls/122502
2024-05-31 11:46:15 +02:00
Jacques Lucke
ee8e195946 Nodes: allow identifier lookup in nodes which use dynamic declarations now
This check was added for 4.0 where we knew that some identifiers will change soon.
Now those identifiers have changed (mostly as part of 8149678d5e1d6e0d00668c3),
so it's ok to support identifier lookup now.
2024-05-31 11:00:16 +02:00
Bastien Montagne
dd3222d2f8 BLI math: Do not use BLI_ASSERT_ C-style checks in modern cpp code.
The old C-style `BLI_ASSERT_UNIT_V...` assert macros have a few issues:
* They are named `unit`, but also consider a zero-length vector as valid.
* They use a fairly high epsilon value, which was defined because
  vertex normals used to be stored as shorts.

Fortunately, these are used only in one place in the modern BLI_math C++
code AFAICS, which is `math::rotate_direction_around_axis`.

This commit adds some utils to check for vectors being (almost) unit
or zero length, using more modern bases for epsilon values (from
`std::numeric_limits`).
* `is_zero` keeps its existing default arror of `0` (i.e. strictly null
  vector by default). That way, current behavior is not changed, and in
  most cases null vectors are explicitely created as exactly null.
* `is_unit` uses a default 10 times the type's epsilon, as a zero
  epsilon would virtually never succeed here.

And it modifies `rotate_direction_around_axis` to:
* Assert that `axis` is a unit vector.
* Early-out in case given `direction` is a null vector, or rotating
  angle is zero.
* Assert about `direction` being a unit vector otherwise.

Note that this will make `rotate_direction_around_axis` use much
stricter epsilon error factors. This does not seem to affect any of the
files that triggered asserts prior to recent fix in e18dd894b8 though.

Pull Request: https://projects.blender.org/blender/blender/pulls/122482
2024-05-31 10:58:19 +02:00
Campbell Barton
43a47f39f9 UI: always show text on the splash when running in offline mode
see #119521
2024-05-31 18:47:15 +10: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
Campbell Barton
e771ea3d98 Fix use of uninitialized stack memory when registering a Macro
The draw callback could be assigned even when it's not in the Python
class.
2024-05-31 15:26:39 +10:00
Campbell Barton
494686b29f Fix potential dangling reference errors 2024-05-31 13:41:11 +10:00
YimingWu
dc69abcb70 Fix #122503: GPv3: Always Initialize vertex_color_ when drawing
Lack of initialization of `vertex_color_` will cause garbled color to
show up in later interpolated points while drawing in material mode with
curves already have `vertex_color` attribute. Now fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/122528
2024-05-31 04:51:55 +02:00
Campbell Barton
eb59a7f574 Cleanup: correct incorrect internal naming of URL params/query
The "query" component of the URL was misnamed "params".
2024-05-31 11:17:58 +10:00
Campbell Barton
d3850b329c Fix dropping extension URL's failing to match local URL's
Dropping an extensions into Blender would was not finding the meta-data
because the recently added parameter caused the URL lookup to fail.
2024-05-31 11:00:20 +10:00
Campbell Barton
24abd35d14 Extensions: use "extensions" category for operator
Replace use of "bl_pkg" operator category with "extensions",
this naming was used while the functionality was experimental,
not intended to be used once extensions was moved out of experimental.
2024-05-31 10:32:01 +10:00
Campbell Barton
7b8cfc862f Cleanup: correct typo in variable name 2024-05-31 10:32:00 +10:00
Sean Kim
af195f91c2 Cleanup: Remove accidentially added constexpr qualifier
It doesn't hurt, but it doesn't really provide any benefit either
to how we use the value in the code at the moment, so I view it as
kind of misleading, since all the calls here are done at runtime.

Pull Request: https://projects.blender.org/blender/blender/pulls/122419
2024-05-31 02:08:00 +02:00
Harley Acheson
e48eacd672 Fix #122423: Fix Gizmo Map Crash after Area Join
When joining areas, one will be removed which can cause
wm_gizmomaps_handled_modal_update to attempt operation on a region that
is deallocated. This PR just exits if there is no current region.

Pull Request: https://projects.blender.org/blender/blender/pulls/122504
2024-05-30 21:02:02 +02:00
Charles Wardlaw
e1a6749b3d USD: dome light IO
This commit adds logic to convert between USD dome lights and Blender
world materials.

The USD dome light rotation is represented in a mapping node input to the
environment texture.  If the dome light has a color specified in addition to
the texture map, the color will be converted to a vector multiply on the
the environment texture output.

I the imported USD has multiple dome lights, only the first dome light will
be converted to a world material.

Co-authored-by: kiki <charles@skeletalstudios.com>
Co-authored-by: Michael Kowalski <makowalski@nvidia.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/121800
2024-05-30 20:48:43 +02:00
Clément Foucault
3ed825f981 EEVEE-Next: Use RGB9_E5 encoding for storing direct light buffers
The direct lights are usually much smoother and with
higher dynamic range than indirect lighting. Using
the R11B11G10 float format exhibit color shifts and
banding even in simple setups without a way to mitigate
the issue.

Using RGB9_E5 encoding improve the quality while retaining
the storage benefit of 32bit formats. The added overhead
of the software encoding not perceptible in a full lighting
pass.

This affects direct lights and SSS convolution result.

Fix #121937

Pull Request: https://projects.blender.org/blender/blender/pulls/122515
2024-05-30 20:41:38 +02:00
Harley Acheson
4e838fdae7 UI: Toggle Camera Guides in 3D View Overlay
Commit of #122337 removed this functionality by removing the exit this
used. This PR just brings back this functionality so you can toggle
both camera guides and passepartout.

Pull Request: https://projects.blender.org/blender/blender/pulls/122514
2024-05-30 20:06:39 +02:00
Clément Foucault
a94b8ade20 GPU: Add library for handling shared exponent format in software
This allows reducing bandwidth at the cost of some instructions
for packing and decoding the texture.

Pull Request: https://projects.blender.org/blender/blender/pulls/122446
2024-05-30 19:59:18 +02:00
Julien Duroure
c05c08cbff glTF exporter: Allow float socket (ex. Alpha) to get data from Color socket
This is how it works in Blender, but before this commit, only R channel was used
Now, we convert RGB to BW to get float data
2024-05-30 18:59:24 +02:00
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
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
53d076612a Tools: add a hash-length argument for the weekly reports generator
Allows generating reports without abbreviated hashes.
2024-05-30 23:34:24 +10: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
Campbell Barton
29f1c96657 Extensions: detect dropping URL's from disabled repositories
Report an error when dropping a URL into a repository which has been
disabled.
2024-05-30 23:22:12 +10:00
Campbell Barton
b19d4d7df6 Extensions: suppress connection errors in console for automatic checks
Being offline shouldn't be considered an error which checking for
updates on startup, so connectivity issues are suppressed unless
running in debug mode.

Ref !122463
2024-05-30 23:22:09 +10:00
Julien Duroure
6a4210ff90 glTF exporter: Perf: Manage drivers on SK when disable viewport option
When trying to optimize performance, we can disable other object in viewport when baking animation
We are now able to bake also drivers on SK with this option
The solution is to copy drivers to temporary created custom properties on armature,
to be able to evaluate them during baking
2024-05-30 15:17:34 +02:00
Julien Duroure
9ba22d4bc7 glTF exporter: Fix #122379: Fix GN data type check 2024-05-30 15:14:00 +02:00
Julien Duroure
018ece5309 glTF: Update user extension ui registration after Blender changes
After Panel UI refactoring for I/O, there is no more Panel class
2024-05-30 15:11:25 +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
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
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
ef6dd90a6e 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.
2024-05-30 13:19:21 +02:00