Commit Graph

115572 Commits

Author SHA1 Message Date
Falk David
949a7e6a60 Fix: Grease Pencil: Separate by Selection issues
Issues with the "Separate by selection" operator. Reported by the Blender studio.
There were multiple problems in this code.
1. When a new object is created, the parameters are not copied.
2. When a new layer in a new object is created, the parameters are not
   copied.
3. The code to transfer the layer attributes was not working correctly.

Fixed all the issues above. The layer attributes are now transfered once
after all layers have been added.

Pull Request: https://projects.blender.org/blender/blender/pulls/131449
2024-12-05 18:18:50 +01:00
Jacques Lucke
b36bf15e28 Geometry Nodes: improve detecting data-block dependencies
Previously, the data-block dependencies were always detected in
`update_depsgraph` in `MOD_nodes.cc`. This would only be called when something
called `DEG_relations_tag_update` before. We don't want to trigger a depsgraph
rebuild after each operation in the node editor, as that would be expensive.
However, that also meant that we often had to add data-block dependencies that
are not actually used, but might be used if the user changed e.g. a link. A
typical example for that is a object socket that has a default value, but the
socket is also linked.

Now, the dependencies referenced by the node tree are collected by the node tree
update code which runs after all changes. This way we can detect whether the
dependencies have changed. Only if they have changed, a depsgraph rebuild is
triggered. This now allows also taking into account the mute status of nodes and
whether an input is linked.

There are still more things that could be taken into account. Most obviously
whether a node is connected to an output. This can be done later. The most
tricky aspect here is probably that we also have to consider all viewer nodes as
output, because at the time the node runs, it's not known which viewer will
actually be used (which depends on other editors).

This also cleans up some special cases we had for e.g. the scene time node where
we always had to trigger a depsgraph rebuild when it was added/removed because
of its time dependence. This is now part of a more general system.

This fixes #109219.

Pull Request: https://projects.blender.org/blender/blender/pulls/131446
2024-12-05 18:02:14 +01:00
Harley Acheson
0e1313483a Fix #99157: Allow Shortcut on Auto Keyframe
If toggling the status of the Auto Keyframe button with a custom
keyboard shortcut it does not update and display the current status of
the button - it looks like nothing has changed.  This PR just updates
the button correctly when used this way. Just the addition of a
RNA_def_property_update.

Pull Request: https://projects.blender.org/blender/blender/pulls/131406
2024-12-05 17:27:18 +01:00
Christoph Lendenfeld
0ce1aa9ecd Fix #131198: Add missing redraw for ND_KEYFRAME_PROP
Tag Properties editor for redraw when it gets notification of
NC_ANIMATION | ND_KEYFRAME_PROP.

Pull Request: https://projects.blender.org/blender/blender/pulls/131440
2024-12-05 17:24:17 +01:00
Jonas Holzman
6cd33510c3 Nodes: Expose Node Color Tag to the Python API
This commit adds a new `color_tag` read-only enum property to nodes,
expanding on the existing node group `color_tag` property. The existing
node group color tag enum (`NodeGroupColorTag`) was renamed to the more
generic `NodeColorTag` and expanded to support all possible color tags.
This new property also works on node group nodes with custom color tags
set by the user.

Pull Request: https://projects.blender.org/blender/blender/pulls/131101
2024-12-05 17:14:34 +01:00
Omar Emara
6dd2ad061f Compositor: Optimize pixel access in new CPU compositor
Optimize pixel access in the new CPU compositor by specializing pixel
load and store for the type of the result that is being loaded or
stored. Gives up to 10% improvement.

Pull Request: https://projects.blender.org/blender/blender/pulls/131441
2024-12-05 16:55:06 +01:00
Jacques Lucke
54111b4f08 Fix: Geometry Nodes: missing update tag after data-block drag&drop 2024-12-05 16:40:11 +01:00
Aras Pranckevicius
4343796050 Fix #78046: When adding content with too long file names to VSE, show error instead of silently not working
VSE can support file basenames of only up to 256 characters length (due
to limited capacity of StripElem::filename). When adding e.g. a movie
that has a longer file basename, it was silently truncating it. The
strip was added, it was just not actually working due to truncated
file basename. Instead of that, log actual error and fail the addition
operator.

The issue repro with "not working" file has basename of 351 length
(due to lots of "invisible zero width space" characters).

Pull Request: https://projects.blender.org/blender/blender/pulls/131417
2024-12-05 16:38:59 +01:00
Aleš Jelovčan
478caef5cf Fix #130262: Grease Pencil: Merge layers node skips copying properties
The "Merge Layers" node creates a new `GreasePencil` as the result
but forgot to copy the Grease Pencil parameters.

Pull Request: https://projects.blender.org/blender/blender/pulls/130273
2024-12-05 16:02:55 +01:00
YimingWu
9e72f28823 Fix: Grease Pencil: Show menu when invoking Move to Layer operator
The Move to Layer operator in grease pencil edit mode when invoked from
operator search directly will not show menu correctly, instead it tries
to execute directly without a target layer name set. This fix ensures
that when it happens the UI would show a menu instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/131437
2024-12-05 15:42:51 +01:00
Jacques Lucke
eb65699715 Fix: USD: missing node tree update tag after import 2024-12-05 15:28:26 +01:00
Sybren A. Stüvel
81beebe4b8 Fix #131299: Grease Pencil: Moving keyframes doesn't update viewport
Grease Pencil animation data is stored in the object-data, not the
`AnimData` of the Grease Pencil ID. This meant that the object was
not properly tagged for an update, because the code assumed that
the object had an `adt`.

The fix calls `ANIM_id_update` to directly tag the Grease Pencil
ID for an update (which will also update the Grease Pencil frames
animation data).
2024-12-05 15:00:03 +01:00
Sybren A. Stüvel
036551c6a0 Refactor: Anim, simplify legacy Action versioning code
Simplify the code:

- Pull a lambda function out of a `for`-loop (making it clearer that the
  loop itself is pretty simple), and
- move the `ActionUserInfo` struct into the only function that uses it.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/131424
2024-12-05 14:51:45 +01:00
Sybren A. Stüvel
56f756b52c Refactor: Anim: simplify embedded IDs when versioning Actions
Change how we visit embedded IDs. Apparently using
`BKE_library_foreach_ID_link()` to get those IDs is not the right way to
go.

Currently the only animatable embedded IDs are node trees, so now the
code just handles those explicitly. Since this is versioning code,
there's also very little chance that there will be new types of
animatable embedded IDs before 4.4 gets released.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/131424
2024-12-05 14:51:36 +01:00
Hans Goudey
77af97d5b9 Cleanup: Move some blenlib files to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/131319
2024-12-05 14:36:01 +01:00
Jeroen Bakker
55495b6224 Vulkan: Hide devices of failing drivers
Devices reported by failing drivers were still part of the device
selection list. When selected they would never be picked.

This change hides these devices from the UI

Pull Request: https://projects.blender.org/blender/blender/pulls/131431
2024-12-05 13:29:55 +01:00
Jacques Lucke
4fd49ae9f3 Fix #119341: improve propagating node tree interface settings
Copy the interface socket directly which makes sure that all relevant data is passed on.
The default is still adapted from the current socket value.

There are still places that could be improved that are not covered by this patch yet.
For example creating a group from a Set Position node changes the default Position input.
That could be fixed separately.

I removed one `assert` that did not seem important. It was making sure that an interface
item is only copied within a group, but I don't see a reason for why it should not be possible
to copy an item to a different group.

Pull Request: https://projects.blender.org/blender/blender/pulls/131394
2024-12-05 13:15:51 +01:00
Jonas Holzman
a730d5f8ba Nodes: Change Compositing Switch node class from Layout to Converter
Currently, the Layout node class is used by the Reroute, Frame and
Compositing Switch node. To bring more uniformity, and clear up the use
of each class, this commit moves the Compositing Switch node from
the Layout class to the Converter class. This aligns it with similar
nodes (Compositing Split, Compositing Switch View, Geometry Switch)
which use the same class, and limits the Layout class to layout-related
nodes. On the UI side, this also gives the Compositing Switch node a
more relevant header color.

Pull Request: https://projects.blender.org/blender/blender/pulls/131392
2024-12-05 13:13:05 +01:00
Jacques Lucke
3bd79aaa78 Fix #121577: blank space in Group Output node properties 2024-12-05 13:11:22 +01:00
Christoph Lendenfeld
6d4cd2dc96 Fix #130061: Pose Sliding with no bones selected resets overlay flags
The issue was that the struct `tPoseSlideOp` tracks the
viewport overlay flags so they can be restored after the operator has run.
But the flag was stored at the end of `pose_slide_invoke_common` which
exits early if no keys are selected.
This then calls `pose_slide_exit` which sets the viewport flags to 0, because they were
never stored in the first place.

The fix is to move the storing of the flag up to `pose_slide_init` to ensure that it
is captured as soon as the struct is allocated.

Pull Request: https://projects.blender.org/blender/blender/pulls/131327
2024-12-05 12:47:04 +01:00
Omar Emara
9fcc15f8a6 Fix: Dilate node uses wrong result types
The Dilate node created Color results for its intermediate separable
results, but they should actually be floats.
2024-12-05 13:44:05 +02:00
Jeroen Bakker
475a038fde Fix #131376: Vulkan: Paint cursor nearest vertex incorrect
There were two issues.
- Rendering scope wasn't updated when changed between draw calls.
- GPU matrices were not bound when changed in immediate drawing.

Pull Request: https://projects.blender.org/blender/blender/pulls/131418
2024-12-05 11:36:27 +01:00
Jeroen Bakker
dc6bd96eeb Fix #131315: Vulkan: Provoking vertex incorrect
In OpenGL the last vertex is the provoking vertex. In Vulkan the first
vertex is the provoking vertex. This PR uses `VK_EXT_provoking_vertex`
to use the last vertex as the provoking vertex.

Pull Request: https://projects.blender.org/blender/blender/pulls/131412
2024-12-05 11:03:29 +01:00
Christoph Lendenfeld
2536ddac0d Fix #123875: FCurve noise modifier producing values out of range
This patch adds an option to use the new perlin noise as a noise function for the FCurve modifier.
That fixes the issue of the old noise function which could produce values outside the -0.5/0.5 range (For a strength of 1).

The old way is still preserved and will be automatically used for old files.
Because of the different noise function, I've added two more parameters to the noise modifier.
The default values for those parameters are chosen to be as close to the original noise modifier as possible.
However the match is not 1:1

## Depth
With the new noise, the parameters for "Lacunarity" and "Roughness" are available to the user.
By default they are set in such a way that changing the "Depth" results in a similar noise pattern.

## Offset and Scale
The offset and scale parameters now behave differently. Before they would also shift the phase in some way, now all they do is shift or scale the noise.

## Amplitude

The biggest difference is in the amplitude of the noise.

Overall the amplitude is a lot smaller in general than with the legacy noise, but it does fix the issue of the amplitude reaching outside the -0.5/0.5 range.
By shifting the phase I was able to find points where the amplitude reaches 0.5 but never above that.

Pull Request: https://projects.blender.org/blender/blender/pulls/129535
2024-12-05 10:48:27 +01:00
Pratik Borhade
da9f334e2b Fix #131374: Grease pencil subdivide icon is not consistent
Use correct icon in modifiers menu `ICON_MOD_SUBSURF`.

Pull Request: https://projects.blender.org/blender/blender/pulls/131407
2024-12-05 10:37:04 +01:00
Philipp Oeser
8044f531c7 Fix #131107: Grease Pencil: Crash doing Grease Pencil Surface Reproject
Implemented in 4291ab855c
Fixed in c20399442d (even though that commit introduced the crash)

The crash happens because we are dealing with multiple
`DrawingPlacement` (using the constructor from c20399442d which allows
for passing in cached depths) in **threads**. The depth_cache gets freed
in the destructor of  `DrawingPlacement` though, thus ruining the data
for a `DrawingPlacement` in another thread.

To resolve, pass in a copy of the depths.

Pull Request: https://projects.blender.org/blender/blender/pulls/131356
2024-12-05 10:35:24 +01:00
Lukas Tönne
03f2f1b5b3 Fix #130271: Flip the color threshold interpretation to match Blender 4.2
The color threshold in Blender 4.2 is interpreted to mean that colors above the
threshold are "background" and colors below threshold are "foreground".
This is arbitrary but works well for black-on-white drawings.

Pull Request: https://projects.blender.org/blender/blender/pulls/131324
2024-12-05 10:32:46 +01:00
Jesse Yurkovich
69c63311fa Fix #130907: Use Blender Action name as the UsdSkelAnimation name
Rather than using a default "Anim" name when exporting armature
animations, use the animation's Action name instead. Likewise use the
UsdSkelAnimation name for the Action's name during import.

Blendshapes/shapekeys still use the default "Anim" name as there's no
action for these situations.

Pull Request: https://projects.blender.org/blender/blender/pulls/131021
2024-12-04 23:43:07 +01:00
Hans Goudey
cb94b62775 Fix #95139: Right click on sockets opens menu with "Edit Source"
We create invisible buttons for socket tooltips because sockets themselves
aren't buttons and because we don't have a special tooltip handler for the
node editor. Currently those buttons have an empty right click menu with
just the "Edit Source" operator. Changing to label buttons removes the
right click menu but keeps tooltips working.

This didn't work earlier because label buttons didn't have tooltips.
That has been implemented in the meantime.

Pull Request: https://projects.blender.org/blender/blender/pulls/131399
2024-12-04 21:56:38 +01:00
Jacques Lucke
5926654756 Fix: Geometry Nodes: crash when accessing runtime data while baking
Some editors are not redrawn while baking, but the properties editor currently
is and therefore needs this special check.

Eventually, we should rename or split the `is_rendering` flag to make it
more obvious that it also means baking.
2024-12-04 20:00:37 +01:00
Hans Goudey
2303f0cfee Fix #115104: Geometry nodes bake loses vertex groups
Vertex groups are written as generic attributes in bakes currently.
In order to restore them as vertex groups properly when reading bakes,
keep track of the vertex group names in the bake metadata.

Pull Request: https://projects.blender.org/blender/blender/pulls/131393
2024-12-04 20:00:00 +01:00
Harley Acheson
3f91350d4e Fix #78371: Allow Deleting Items When Measure On Gizmos Off
When using the "Measure" Tool with Gizmos turned off, trying to delete
anything will result in an error message instead.  When Gizmos are on
then view3d_ruler_remove_invoke will return OPERATOR_PASS_THROUGH if
no rulers are selected. This way you can delete other objects. But if
Gizmos are off then it returns OPERATOR_CANCELLED which stops in its
tracks. Return OPERATOR_PASS_THROUGH in this case instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/131340
2024-12-04 19:57:56 +01:00
Clément Foucault
fb84b21ec4 Cleanup: Selection: Assert legacy selection mode are not used 2024-12-04 19:18:14 +01:00
Clément Foucault
ddf3a59de5 Fix #131285: Selecting Empty Space With Select Box Tool Selects Objects
The clearing logic depended on an uninitialized value.
2024-12-04 19:18:14 +01:00
Clément Foucault
c255178cc5 Selection: Remove usage of Depth picking for viewport selection
The option is already disregarded by the new viewport
selection code.

This only remove the usage of the flag and assume it is
always off.

The UI and DNA clearing needs to be done in another commit.
2024-12-04 19:18:14 +01:00
Jacques Lucke
fba10a8212 Cleanup: Blenloader: extract function to write blend file header
This simplifies the code a bit.

Pull Request: https://projects.blender.org/blender/blender/pulls/131379
2024-12-04 18:53:09 +01:00
Jesse Yurkovich
b75b191f9f Build: USD: Small change to allow compiling against both 24.05 and 24.11
Starting with USD 24.11, the external boost dependency is being phased
out. It will instead use their own internal pxr_boost::python library.

This PR adapts the code inside `usd_hook.cc` to build and run in this
new environment.

Pull Request: https://projects.blender.org/blender/blender/pulls/131343
2024-12-04 18:45:43 +01:00
Hans Goudey
22c13cfd28 Cleanup: Avoid reformatting geometry nodes property names, use fmt 2024-12-04 12:38:00 -05:00
Hans Goudey
af79b4e7b5 Cleanup: Use constexpr for geometry nodes string, avoid .c_str() 2024-12-04 12:38:00 -05:00
Hans Goudey
19ab63e513 Cleanup: Remove unnecessary namespace specification 2024-12-04 12:38:00 -05:00
Jacques Lucke
95ef33059c Geometry Nodes: support text overlay when viewing matrix attributes
This implements a basic text overlay for matrix attributes. The matrix is split into location,
rotation and scale to make the values more useful. There are probably ways to present
this in a more beautiful way, but for now this is already much more useful compared to
showing nothing. Also, previously, this would hit an assert in a debug build.

Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/131301
2024-12-04 18:22:24 +01:00
Miguel Pozo
bd1f4ec23c Fix: GPU: CPP shader errors in VS2019
Continuation of #131332.

Including built-in headers in VS2019 ends up including `corecrt_math.h`
as a side effect, which has many functions that overlap in name with
our stubs.
This puts the conflicting functions inside its own namespace (`glsl`)
and declares macros for them.
(Note this has the side effect of not allowing us to use those as
variable names)

This also removes the `<cassert>` and `<cstdio>` includes.

Pull Request: https://projects.blender.org/blender/blender/pulls/131386
2024-12-04 18:03:42 +01:00
Miguel Pozo
72aaaa0c24 Fix: GPU: Errors and warnings for CPP shaders in MSVC
Pull Request: https://projects.blender.org/blender/blender/pulls/131332
2024-12-04 17:33:12 +01:00
Hans Goudey
6836dca44d Cleanup: Remove unused parts of BLI_rand.h C-API 2024-12-04 11:29:28 -05:00
Hans Goudey
d260ba0cdb Cleanup: Use C++ random number generator 2024-12-04 11:29:28 -05:00
Bastien Montagne
3bfa46175c Fix #108067: Liboverride: miss tagging constraints as 'from linked data' on creation. 2024-12-04 17:13:08 +01:00
Julian Eisel
91069ea674 Refactor: UI: Simplify screen refresh logic
Avoid extra parameter to force refresh a screen, only use the screen refresh
tag. Having both leads to unnecessarily complicated logic.

Also document behavior in function comment and make function name more clear.
2024-12-04 17:05:18 +01:00
Clément Foucault
5e4bba76d1 Fix #131363: Curves ignore Surface Object Setting
Depth only drawing was not always enabling the overlay engine
(now responsible for depth prepass). And the depth prepass
was not populated if overlays were turned off.
2024-12-04 17:05:03 +01:00
Sebastian Parborg
f66319b594 Fix: Remove internal ffmpeg API usage (fix ffmpeg 7 compilation)
FFmpeg removed public access to read_seek, read_seek2 in ffmpeg 7
2024-12-04 16:46:33 +01:00
Hans Goudey
4ded260cf3 UI: Allow setting active modifier on linked object
The poll function doesn't apply here because it just checks for object
editability and edit mode, object types, and modifier types. We shouldn't
have a poll function at all because the hovered modifier might not be
part of the context.

Resolves #90008.

Pull Request: https://projects.blender.org/blender/blender/pulls/131384
2024-12-04 16:43:13 +01:00