Commit Graph

120055 Commits

Author SHA1 Message Date
Jacques Lucke
ca149d8695 Cleanup: formatting 2024-01-09 15:08:11 +01:00
Jeroen Bakker
5b969f54ca Vulkan: Fix Shader Compilation Issue
The Specialization Shader workaround generated code that wasn't Vulkan
GLSL compliant. The uintBitsToFloat cannot be used during global const
initialization.

This is a temporary work around until we implement the Specialization
Constants for Vulkan.

Pull Request: https://projects.blender.org/blender/blender/pulls/116942
2024-01-09 14:55:02 +01:00
Christoph Lendenfeld
311589ce23 Refactor: simplify arguments for make_new_fcurve_cyclic
No functional changes.

Simplifies the function `make_new_fcurve_cyclic` so it is easier to call.

Pull Request: https://projects.blender.org/blender/blender/pulls/116941
2024-01-09 14:38:38 +01:00
Jacques Lucke
d19e7cbb5a Fix #115540: nodes with sockets only on one side are hard to resize
This was caused by 74dd1e044b.

The fix implemented here disables socket picking in the header region of
non-collapsed nodes. This way, resizing always works when on the left
and right side of the header.
2024-01-09 13:19:48 +01:00
Sybren A. Stüvel
c4376c58e9 Refactor: Anim, remove unnecessary method override
Remove the `BoneCollectionItem::supports_collapsing()` method, as the
parent class already does exactly the same thing. No need to override that.

No functional changes.
2024-01-09 12:59:39 +01:00
Sybren A. Stüvel
e5b6126961 Cleanup: add missing const
Just a missing `const`, no functional changes.
2024-01-09 12:55:30 +01:00
Sybren A. Stüvel
9aa4f28921 UI: use std::abs() to ensure floating point values are handled properly
Explicitly use `std::abs()` instead of `abs()`, so that it returns
`float` when its argument is `float`.

Clang was warning: using integer absolute value function 'abs' when
argument is of floating point type.
2024-01-09 12:50:48 +01:00
Sybren A. Stüvel
015555b07a Anim: library override support for bone collection visibility
Support tracking the `bone_collection.is_visible` property via library
overrides.

This requires an RNA change. Instead of exposing all bone collections as
`armature.collections.all` (i.e. a sub-property of `.collections`) it is
now exposed as `armature.collections_all` (an armature property).

There is still the limitation that insertion operations are only
supported on `armature.collections`, so only new roots + their sub-trees
can be added via library overrides.

Overrides on `armature.collections_all` are limited to overriding
property values. The `parent`, `index`, and `child_number` properties
are excluded from this, as reorganising the hierarchy itself via
overrides is not possible.
2024-01-09 12:50:48 +01:00
Jacques Lucke
653e01092f Fix #115782: crash when dangling reroute has outgoing link into repeat zone
Now, such links are treated similar to muted links. Links coming from dangling
reroutes are not added to the set or border links anymore. They should be
ignored by evaluation systems.
2024-01-09 12:43:35 +01:00
Philipp Oeser
a7f4f86fe5 Fix: Node Editor overlay settings cannot be added to Quick Favourites
Add support for the needed node editor "spacedata.overlay" in
WM_context_path_resolve_full.

Part of #113489 (VSE overlay settings require a bit more work, this is
for a later commit).

Pull Request: https://projects.blender.org/blender/blender/pulls/116604
2024-01-09 12:29:28 +01:00
Campbell Barton
5afd33d129 PyAPI: drop support for Python 3.10
All platforms have been updated to support 3.11
so supporting 3.10 is no longer needed.
2024-01-09 22:23:41 +11:00
Christoph Lendenfeld
f11ec3eb14 Cleanup: Remove unused include
`#include "ED_keyframing.hh"` was no longer needed.
This is in an effort to remove the dependency
to the editor code from animrig.
2024-01-09 12:09:19 +01:00
Marcelo Mutzbauer
d16543a155 Fix #116418: Stroke direction wrong on curved surfaces
Even though the brush rotation is computed as a 2D angle (based on the mouse
movement), it currently gets applied by rotating the projected X direction
around the the normal in 3D.

This patch ensures that rotation gets applied first, and only then does the
motion direction get projected into the tangent plane. A potential issue with
the current approach is that the random perturbations will also be applied in
2D, but this seems to be fine from discussions with @JulienKaspar and @Sergey.

Also, there was an error where the location should probably be converted *to*
world coordinates.

All these changes seem to fix the issue described in #116418.

I also noticed some minor "inconsistencies" with how the rotation is applied:
For curve strokes, the direction of the curve corresponded to the upward
direction of the brush. For view plane, area plane mapping and anchored strokes,
the mouse motion indicated the downward direction of the brush.
For compatibility, I tried my best to enforce the latter conventions throughout,
but I'm not so confident about oversights.

Pull Request: https://projects.blender.org/blender/blender/pulls/116539
2024-01-09 11:58:42 +01:00
Jacques Lucke
c5688e619e Fix #116369: missing dependency on time when there is a bake animation node 2024-01-09 11:07:52 +01:00
Jacques Lucke
ffcc0e3e5f Fix #116515: Single Value Only applies to wrong input in geometry nodes modifier
The counting of input sockets did not take closed panels into account correctly.
2024-01-09 11:01:12 +01:00
Iliya Katueshenock
79a56dd764 Fix #116671: update socket availability after node declaration update
Pull Request: https://projects.blender.org/blender/blender/pulls/116672
2024-01-09 10:52:46 +01:00
Jacques Lucke
59b3a4ed0c Fix #116691: repeat zone does not propagate anonymous attributes correctly
Field sources that come into the repeat zone from the outside need some
special handling at the repeat output node.

Pull Request: https://projects.blender.org/blender/blender/pulls/116915
2024-01-09 10:45:50 +01:00
Prikshit singh
40fbc60ef7 Fix #116727: crash when deleting geometry node group in node editor
Pull Request: https://projects.blender.org/blender/blender/pulls/116757
2024-01-09 10:43:45 +01:00
Jacques Lucke
5c3596e9ed Fix #116806: IndexMask.find returns wrong result when mask has offset
`IndexMask.find` did not take `begin_index_in_segment_` into account properly.

Pull Request: https://projects.blender.org/blender/blender/pulls/116891
2024-01-09 10:42:09 +01:00
Clément Foucault
e578678290 EEVEE-Next: Fix incorrect lighting on refraction closures
Add placeholder code for when we support it.
For now, we just use the indirect lighting.
2024-01-09 16:39:17 +13:00
Clément Foucault
ea989ebf94 EEVEE/EEVEE-Next: Split Diffuse and Subsurface closure
Even if related, they don't have the same performance
impact.

To avoid any performance hit, we replace the Diffuse
by a Subsurface Closure for legacy EEVEE and
use the subsurface closure only where needed for
EEVEE-Next leveraging the random sampling.

This increases the compatibility with cycles that
doesn't modulate the radius of the subsurface anymore.
This change is only present in EEVEE-Next.

This commit changes the principled BSDF code so that
it is easier to follow the flow of data.

For legacy EEVEE, the SSS switch is moved to a
`radius == -1` check.
2024-01-09 16:39:17 +13:00
Campbell Barton
a39c16270c CMake: restore IMATH_INCLUDE_DIRS include for APPLE/arm64
For some reason arm64 still requires the include directories,
update CMake accordingly.
2024-01-09 14:34:20 +11:00
Campbell Barton
1a8201e53f Fix #116842: Incorrect API docs for gpu.matrix.load_identity 2024-01-09 12:50:40 +11:00
Campbell Barton
45a1d93665 CMake: remove redundant IMATH includes
Added for an old version of OIIO and weren't defined for lite builds.
2024-01-09 12:37:40 +11:00
Campbell Barton
7f6e4c6866 Cleanup: sort cmake file lists 2024-01-09 12:17:12 +11:00
Campbell Barton
6b09360c3e Cleanup: remove unused variable 2024-01-09 12:11:58 +11:00
Damien Picard
a1efde2727 Creator: update image formats shown in the CLI help
Update the command line help message to reflect the actual image output
formats available.  Remove  mention of IRIZ and DDS, rename MPEG to
FFMPEG. HDR and TIFF are always valid now.

Pull Request: https://projects.blender.org/blender/blender/pulls/115987
2024-01-09 01:49:16 +01:00
Harley Acheson
f42071c793 UI: Updated Auto Keying Button Icon
Changing the icons used for auto keying to be more noticeable.

Pull Request: https://projects.blender.org/blender/blender/pulls/105574
2024-01-08 23:16:56 +01:00
Hans Goudey
2934ca90d0 Fix #115024: Anchored brushes repeat action with incorrect normals
Before 111e586424, the normals were written back to the mesh
from the values stored in the undo step. Now though, due to caching of
normals and better const correct-ness, this is not so simple or safe.

That still may be a nice optimization to apply in the future, but for
now the simplicity of just recalculating them is much more feasible.
Since the recalculation is localized to the brush action, performance
should be okay. And maybe normals won't have to be stored in undo steps
in the future as well, since they're derived data.
2024-01-08 16:33:46 -05:00
Hans Goudey
d722324824 Fix #115499: Add node group modifier doesn't ensure unique name
This causes issues referring to modifiers by name, which is done in
many operators.
2024-01-08 15:49:22 -05:00
Hans Goudey
29d6648550 Fix #116885: Index Switch node assert fails when removing all items
`set_default_remaining_node_outputs` didn't work because the mapping
between the original node group sockets and the lazy function outputs
wasn't set up during the construction of the node type, as done by the
bake node and others.
2024-01-08 14:04:31 -05:00
Hans Goudey
468e0f873f Cleanup: Fix spelling mistakes in recent spelling fix commit
0ba83fde1f
2024-01-08 12:52:54 -05:00
Hans Goudey
aaa25bc882 Sculpt: Improve mesh normals update performance
Instead of storing a boolean "update tag" for every vertex, just
recalculate the normals of all the faces and vertices in affected PBVH
nodes. This avoids the overhead of tracking position updates at the
vertex level, and simplifies the normal calculation, since we can
just calculate values for all the normals in a node.

The main way we gain performance is avoiding building a `VectorSet`
for all vertices and faces that need updates in the entire mesh. That
process had to be single threaded, and was a large bottleneck when many
vertices were affected at a time.

That `VectorSet` was necessary for thread safety deduplication of work
though, because neighboring nodes can't calculate the normals of the
same faces or vertices at the same time. (Normals need to be calculated
for all faces connected to moved vertices and all vertices connected to
those faces). In this PR, we only build a set of the *boundary* faces
and vertices. We calculate those in a separate step, which duplicates
work from the non-boundary calculations, but at least it's threadsafe.

I measured normal recalculation timing when sculpting on a 16 million
vertex mesh. The removal of the `vert_bitmap` array also saves 16 MB
of memory.

| Nodes | Affected Vertices | Before (ms) | After (ms) |
| ----- | ------------ | ----------- | ---------- |
| 4     | 15625        | 0.208       | 0.304      |
| 35    | 136281       | 2.98        | 0.988      |
| 117   | 457156       | 15.0        | 3.21       |
| 2455  | 9583782      | 566         | 84.0       |

Pull Request: https://projects.blender.org/blender/blender/pulls/116209
2024-01-08 18:49:26 +01:00
Miguel Pozo
cc13d58e53 Fix #116541: Wireframes with overlays and x-ray disabled 2024-01-08 18:23:34 +01:00
Aras Pranckevicius
877d9c596a VSE: Fix various "off by half a pixel" issues in image transform
Code inside `IMB_transform` (which is pretty much only used inside VSE
to do translation/rotation/scale of image or movie strips) was not
correctly doing mapping between pixel and texel spaces. This is similar
to e.g. GPU rasterization rules and has to do with whether some
coordinate refers to pixel/texel "corner" or "center" etc. It's a long
topic, but short summary would be:

- Coordinates refer to pixel/texel corner,
- Do sampling at pixel centers,
- Bilinear filter should use floor(x-0.5) and floor(x-0.5)+1 texels.

Also, there was a sign error introduced in Subsampling 3x3 filter, in
commit b3fd169259.

After making the PR, I found out that this seems to fix #90785, #112923
and possibly some others.

Long explanation with lots of images is in the PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/116628
2024-01-08 16:51:35 +01:00
Miguel Pozo
694cb43e59 Fix: EEVEE-Next: Forward Material compilation 2024-01-08 15:50:09 +01:00
Jacques Lucke
c68b22cfdf Core: expose ID.session_uid in RNA
This exposes the internal `ID.session_uuid` in the Python API as `ID.session_uid`.
The exposed name is not `session_uuid`, because it's not actually universally unique,
and we want to change the internal name too.

The reason for exposing this is to allow Python scripts to call operators that take the
session id as input. A fair number of operators do this as you can see when searching
for `WM_operator_properties_id_lookup`.

Pull Request: https://projects.blender.org/blender/blender/pulls/116888
2024-01-08 15:34:09 +01:00
Alexander Gavrilov
d0ef66ddff Drivers: implement fallback values for RNA path based variables.
As discussed in #105407, it can be useful to support returning
a fallback value specified by the user instead of failing the driver
if a driver variable cannot resolve its RNA path. This especially
applies to context variables referencing custom properties, since
when the object with the driver is linked into another scene, the
custom property can easily not exist there.

This patch adds an optional fallback value setting to properties
based on RNA path (including ordinary Single Property variables
due to shared code and similarity). When enabled, RNA path lookup
failures (including invalid array index) cause the fallback value
to be used instead of marking the driver invalid.

A flag is added to track when this happens for UI use. It is
also exposed to python for lint type scripts.

When the fallback value is used, the input field containing
the property RNA path that failed to resolve is highlighted in red
(identically to the case without a fallback), and the driver
can be included in the With Errors filter of the Drivers editor.
However, the channel name is not underlined in red, because
the driver as a whole evaluates successfully.

Pull Request: https://projects.blender.org/blender/blender/pulls/110135
2024-01-08 15:24:59 +01:00
Alexander Gavrilov
bbd7872680 Drivers: refactor driver_get_variable_property to return an enum.
In order to prepare for introduction of fallbacks, refactor the
function to return its status as an enumeration value. Also, move
the index range check inside the function from python-specific code.
2024-01-08 16:08:18 +02:00
Alexander Gavrilov
b9074381e5 Drivers Editor: apply red underline to drivers that failed evaluation.
F-Curves with a broken rna path are highlighted with a red underline
in the channel list of the animation editors. I think it makes sense
to also apply this to drivers that failed to evaluate and were disabled.

Otherwise, it is not apparent which drivers are broken without checking
every one manually, or applying the errors filter.
2024-01-08 16:08:18 +02:00
Sybren A. Stüvel
1db4ed50e8 Cleanup: make format
Just a run of `make format`. No functional changes.
2024-01-08 14:58:18 +01:00
Sybren A. Stüvel
6d8bb7f73c Anim: armature.collections.move() now retains the active collection
`armature.collections.move(x, y)` now retains the active collection. Due to
the move, the active collection index can change. The index is now updated
to accomodate for this.
2024-01-08 14:53:41 +01:00
Sybren A. Stüvel
687d6932c0 Anim: ensure active bone collection doesn't change when adding new one
Ensure that the active bone collection doesn't change, when adding a new
bone collection via low-level functions (for example
`armature.collections.new()` in Python).

The change to the active bone collection happened because adding a new
child may change the index of the active bone collection.
2024-01-08 14:34:10 +01:00
Alexander Gavrilov
4fe6f0b271 Fix: frame snapping for the time extend transformation mode
The graph editor supports an Extend transformation mode, which is
essentially Move that only affects keyframes either before or
after the current frame, based on the mouse cursor position.

This fixes a bug in this mode where it doesn't respect the snap setting.
2024-01-08 14:18:55 +01:00
Campbell Barton
5b00141144 Fix #116880: Rotation discrepancy when converting a matrix to euler
Converting a near-identity matrix to a euler could be off by over
4.5 degrees when the result of the hypotenuse calculated from the
matrix was small (around 2e-6).

Resolve by increasing the epsilon ~20x to 3.75e-05 which results
in ~1/20th the error.

This was tested against many generated near-identity matrices
(which tend to cause arithmetic error) to ensure this change doesn't
cause worse results in other cases (see report for details).
2024-01-08 23:32:31 +11:00
Brecht Van Lommel
0e4da8d55f Fix macOS ARM build failing with make lite
OpenImageIO headers have a dependency on Imath headers when not on x86_64.
2024-01-08 13:14:34 +01:00
Miguel Pozo
18094d20c9 Fix: EEVEE-Next: GPU_framebuffer_clear assertion 2024-01-08 12:54:08 +01:00
Omar Emara
08130211b1 Fix: GPU Directional Blur node does not match CPU
The GPU Directional Blur node does not match CPU. This is because GPU
accumulates the scale, while the CPU increments it. This patch
incremenets the scale for the GPU to make them match.
2024-01-08 13:42:32 +02:00
Sybren A. Stüvel
2e2b5dcd52 Anim: Outliner, show bone collections in their hierarchy
The Outliner now shows an Armature's bone collections as a hierarchy
instead of a flat list.
2024-01-08 12:31:20 +01:00
Sergey Sharybin
fed446ce8a Fix #116220: Context property driver does not update during playback
This commit fixes missing updates during playback when `frame_current`
property of the active scene is used.

Applied the same check for the depends-on-time as for explicitly
specified scene.

Pull Request: https://projects.blender.org/blender/blender/pulls/116886
2024-01-08 12:30:33 +01:00