Commit Graph

117627 Commits

Author SHA1 Message Date
Omar Emara
16d59b00a7 Refactor: Compositor: Use int32_t as result type
This patches uses an explicit int32_t fixed width integer instead of int
for result types. For consistency with other node systems.
2025-02-25 09:25:48 +02:00
Harley Acheson
67ffad53aa Merge branch 'blender-v4.4-release' 2025-02-24 18:51:52 -08:00
Harley Acheson
130c074487 Fix #131779: Display "inf" / "-inf" for Correct Range of UI Values
Our UI code is currently showing the text "inf" when a numerical input
contains _exactly_ the value of FLT_MAX. But this is the max value for
doubles and we enforce a maximum float precision of 6 digits.  This
means that a property can start with "inf" by default but it is
impossible edit, or even keep the same value, by editing in the UI
and show as "inf".  This PR defines values that are the actual minimum
and maximums currently usable in the UI and values greater than or
equal to are shown as "inf" (equivalent for "-inf").

Pull Request: https://projects.blender.org/blender/blender/pulls/131876
2025-02-25 03:50:23 +01:00
Hans Goudey
322b4624d5 Fix: Use matching attribute name for multi-object "Set Attribute"
Currently these operators work on the active attribute for each
selected mesh or curves data-block. That doesn't really make
sense because you can only see the active attribute for the
active data-block. It's better to try to affect the attribute with
the same name for every geometry, regardless of which is active.

Pull Request: https://projects.blender.org/blender/blender/pulls/135067
2025-02-25 01:36:35 +01:00
Campbell Barton
62599317dd Fix #135009: Python: Can't Set PointerProperty to None
Correct own error applying !126755.
2025-02-25 11:04:48 +11:00
Laurynas Duburas
92c0eb5e66 Curves: Refactor extrude to use foreach_selected_point_ranges_per_curve
Extrude refactored to use `foreach_selected_point_ranges_per_curve`.
This reduces amount of code and increases readability significantly.

Function `curves_extrude_exec` is refactored to follow structure of
other operators. Also to return `OPERATOR_CANCELLED` when extrude was
called with no points selected.

Pull Request: https://projects.blender.org/blender/blender/pulls/135056
2025-02-24 21:21:23 +01:00
Jacques Lucke
3eaccd6c2c Fix: Geometry Nodes: use object names in Import OBJ node 2025-02-24 18:57:41 +01:00
Jacques Lucke
e05ef4c838 Nodes: support filepath filter for import nodes
Currently, when selecting a file path using the file browser opened from the
node socket, there is no filter active making it harder than necessary to find
the correct file. This patch adds the proper filter. Something similar is done
when using e.g. the gltf import from the menu.

Supporting this requires changes in a bunch of places:
* `StringPropertyRNA` now has a callback that returns the file path pattern.
  This has to be a callback, because the same property is used on all file path
  sockets, but the valid extension depends on the node.
* The string socket declaration also has the optional path pattern. This can be
  set in the node declarations.

Pull Request: https://projects.blender.org/blender/blender/pulls/134931
2025-02-24 18:52:10 +01:00
YimingWu
9759a9df5e Fix #134793: Grease Pencil: Set Uniform Opacity cannot set fill opacities
Fill opacities of individual strokes was overlooked when implementing
the Set Uniform Opacity operator, now corrected and also added a
separate property for controlling stroke/fills opacity.

Pull Request: https://projects.blender.org/blender/blender/pulls/134982
2025-02-24 18:15:32 +01:00
Jacques Lucke
589dce871d Merge branch 'blender-v4.4-release' 2025-02-24 17:50:11 +01:00
Jacques Lucke
c6d2a6f856 Fix #134189: geometry name lost when processing instances 2025-02-24 17:49:46 +01:00
Falk David
5f220a2dec Fix: Grease Pencil ID data evaluation happening in the wrong function
Grease Pencil ID data was being evaluated in the
`BKE_grease_pencil_data_update` function, but this function
is called from the evaluated objects.

The fix adds a new `BKE_grease_pencil_eval_geometry` function
thats called as a callback from `build_object_data_geometry_datablock`.

Resolves #134980, #135004.

Pull Request: https://projects.blender.org/blender/blender/pulls/135051
2025-02-24 16:50:21 +01:00
Sybren A. Stüvel
e4c2ddb8e1 Merge remote-tracking branch 'origin/blender-v4.4-release' 2025-02-24 16:48:43 +01:00
Jacques Lucke
252a9b63ed Geometry Nodes: support creating import nodes when dropping file paths
Now import nodes are automatically created in Geometry Nodes when dropping
`.obj`, `.stl`, `.ply` and `.csv` files. Note that this is still hidden behind an
experimental feature flag.

Pull Request: https://projects.blender.org/blender/blender/pulls/135036
2025-02-24 16:25:50 +01:00
Omar Emara
27bf89e933 Refactor: Compositor: Use BKE conversions for MF operation
This patch uses the BKE implicit conversion rules to implement implicit
conversion in multi-function procedure operations in the compositor.
Since conversions use ColorSceneLinear4f to represent colors instead of
float4, we need to insert extra implicit conversions around color
sockets.

Special attention was given to variable destruction in the
implementation because it is now possible for implicit variables to be
outputs, so we need to make sure they are not destructed.
2025-02-24 17:20:16 +02:00
Clément Foucault
27c20aaae7 Overlay: Add support for CPP shader compilation
Rel #127983

Also removes some unused shaders.

Pull Request: https://projects.blender.org/blender/blender/pulls/135034
2025-02-24 16:17:18 +01:00
Hans Goudey
d0a6189b50 Refactor: DRW: Centralize and clean up packed normals conversion
Move the code dealing with converting float3 to GPU normals
out of the vertex format header into a separate header. Use a
proper C++ namespace and remove duplication by only using
the more recently added C++ templated conversions.

Most of the diff comes from the removal of the indirect includes
from GPU_vertex_format.hh. A lot of files ended up mistakenly
depending on that.

Pull Request: https://projects.blender.org/blender/blender/pulls/134873
2025-02-24 16:08:30 +01:00
Sybren A. Stüvel
3fd430d1c6 Anim: make BKE_fcurves_id_cb() only report F-Curves for that ID
Update `BKE_fcurves_id_cb(id, callback)` so that it only reports
F-Curves for `id`. With legacy Actions this used to be "all F-Curves in
the Action", but with slotted Actions it should only report the F-Curves
for the assigned slot.

`BKE_fcurves_id_cb()` is used in two places:

1. Updating F-Curve paths in versioning, for example when node sockets
   were added/removed. For this it is vital that the updates only happen
   for those nodes that were actually affected by this versioning code,
   and not blindly for all F-Curves in the Action.
2. Marking properties as 'animated' in the depsgraph, and the 'value
   backup' for those properties. This should also be only done for the
   properties of that ID, and thus be limited to the F-Curves for the
   assigned slot.

Pull Request: https://projects.blender.org/blender/blender/pulls/134851
2025-02-24 15:57:41 +01:00
Pratik Borhade
576d19add7 Fix #134809: Grease Pencil: Proportional edit tweaks locked material strokes
Entire curve points range is passed to transform-container  when
proportional editing is on. Consequence is, strokes from locked
materials are also affected. Use `editable_points` mask to resolve this.

Pull Request: https://projects.blender.org/blender/blender/pulls/134838
2025-02-24 15:17:26 +01:00
Dalai Felinto
e7214cbd31 Fix: missed point_cloud for node tools and more aggressive renaming
The issue was introduced on 1584cd9aa5 (see !134911 for details).

This fixes this and rename the remaining point_cloud from the API.
The DNA is left untouched, so users don't need to re-enable the
experimental point cloud feature.

Pull Request: https://projects.blender.org/blender/blender/pulls/134927
2025-02-24 14:43:08 +01:00
Falk David
0db9486057 Merge branch 'blender-v4.4-release' 2025-02-24 14:12:27 +01:00
Falk David
8cf9d01453 Fix #134909: Crazyspace has incorrect deformed positions due to armature modifier
The fix 8af27ce27e assumed that
the `edit_hints->positions()` were always empty and that we would always
fallback to using the evalauted positions instead.

But if the edit hints are populated, this fails. In this case, we populate the
positions in `remember_deformed_positions_if_necessary`.

The fix makes sure that we write to the `edit_hint` positions if they are
populated.

Pull Request: https://projects.blender.org/blender/blender/pulls/135033
2025-02-24 13:52:42 +01:00
Jeroen Bakker
3b5c3e70b1 SubDiv: Use shader create info for stretch overlays
This PR migrates subdiv_vbo_edituv_strech_*_comp.glsl to use
shader create info.

Pull Request: https://projects.blender.org/blender/blender/pulls/135038
2025-02-24 13:32:53 +01:00
Jeroen Bakker
1f0bc6bbe6 SubDiv: Use shader create info for sculpt data
This PR migrates subdiv_vbo_sculpt_data_comp.glsl to use
shader create info.

Pull Request: https://projects.blender.org/blender/blender/pulls/135032
2025-02-24 12:58:13 +01:00
Sybren A. Stüvel
857743db9d USD: import skeletal animation as slotted Actions
The USD importer was still creating legacy Actions, which are no longer
supported in Blender 4.4. This commit updates the code to produce
slotted Actions instead.

This also avoids the need to create F-Curves "from scratch", but rather
uses the available functionality. This makes the code somewhat easier to
maintain.

Pull Request: https://projects.blender.org/blender/blender/pulls/134866
2025-02-24 12:39:52 +01:00
Omar Emara
c29971c688 Fix #135010: Crash when using Denoise node
Blender crashes when using the Denoise node. That's because the code
assumes normal input would have 4-channels, while this may not be the
case. To fix this, use the channels count from the result or the GPU
texture directly.
2025-02-24 13:22:40 +02:00
YimingWu
981246ef4a Fix #134969: Grease Pencil: Ensure correct mode for image tracing
When source reference image is a single image type, selecting "sequence"
mode for tracing image into grease pencil will result in a crash in
`trace_end_job` because it's trying to finalize more frames than traced,
now ensures tracing mode to be `Single` when reference image is single
image type even when tracing mode selector is set to sequence.

Pull Request: https://projects.blender.org/blender/blender/pulls/134981
2025-02-24 11:51:46 +01:00
Janne Nylander
cefc6626f1 Fix #134985: Merging layers resets layer opacity
Layer had their opacity reset whenever a modifier was applied.
This was due to the property not being transferred when a new GreasePencil
object was created in `geometry::merge_layers` function. This PR makes sure
to transfer the Layer opacity (similar to other layer properties).

Pull Request: https://projects.blender.org/blender/blender/pulls/135006
2025-02-24 11:45:02 +01:00
Clément Foucault
a79bc953d3 Fix #134886: Crash with Subdivision modifier update
This was caused by 91de4a50ab refactor which replaced
the evaluator cache singleton by local variable.

It was unknown that the evaluators in the cache
are actually referenced by the modifier data.

To fix this and fix the thread-unsafety of the global
variable, a mutex is introced around a reduced critical
section inside `draw_subdiv_create_requested_buffers`.

The global evaluator cache is now also refcounted to allow
freeing of the cache when no evaluator is referenced
anymore.

Pull Request: https://projects.blender.org/blender/blender/pulls/134926
2025-02-24 11:37:57 +01:00
Laurynas Duburas
2c42294557 Curves: add Split operator
Adds Split operator to curves. It should have the same behavior as the
corresponding operator for legacy curves.

Pull Request: https://projects.blender.org/blender/blender/pulls/131788
2025-02-24 11:32:59 +01:00
Jacques Lucke
dcd5e54f58 BLI: ignore empty lines when parsing CSV files 2025-02-24 11:26:43 +01:00
Lukas Tönne
8a1e29be0d Merge branch 'blender-v4.4-release' 2025-02-24 10:27:39 +01:00
Lukas Tönne
63c460d93d Fix #134482: Grease Pencil: Interpolation creates uninitialized values
This was partially fixed in ef844bad but left some unhandled corner cases with
uninitialized memory.

The core problem is that the `dst_curve_mask` used by the interpolation
functions can contain indices that don't actually exist in either the "from" or
"to" source drawings. Specifically when the "from" drawing has more curves, the
indices are still used but the supplemental `to_curve_indices` array contains
`-1` entries, indicating that only the "from" curve should be used.

The main copy code for positions takes this into account, but the generic copy
of attributes below that does not! It passes the `dst_curve_mask` straight into
the `array_utils` functions and that causes crashes. The original fix in
ef844bad was to clamp the size of the index mask, but the way this was done
could lead to empty index masks, leaving attribute values uninitialized.

The correct solution is to use index masks that exclude invalid entries for the
respective source curves. The new masks are non-overlapping, so the full set of
destination curves can be filled by combining these masks.

Pull Request: https://projects.blender.org/blender/blender/pulls/134865
2025-02-24 10:26:53 +01:00
Omar Emara
7ab7e1efa6 Fix #134939: Passes are incorrectly interpreted as vectors
Some passes are now interpreted as vectors by the compositor Image node.
This is because it assumes 3-channel passes are always vector, but this
is not the case for passes that are RGB without an alpha channel. To fix
this, we also consider channel IDs to disambiguate the type of the pass.
2025-02-24 11:17:36 +02:00
Philipp Oeser
76cf859b33 Merge branch 'blender-v4.4-release' 2025-02-24 08:49:42 +01:00
Philipp Oeser
866e3d28c1 Fix #134821: "Copy To Selected" can act on non-matching nodes
Was reported for alt-editing, thats the same code though.

Previously ( da1038c768 ), the check for "matching" nodes was based on
the `legacy_type`.
This does not uniquely identify a node type, only the `idname` does.
By "matching", I mean having the same properties (so later setting
values can happen on all selected nodes).

If we allow "non-matching" nodes into our list in
`UI_context_copy_to_selected_list`, setting values on non-existent
properties later can act up (throwing `AttributeError` , also
`RNA_property_boolean_set` would actually try to create an equally named
IDP).

Better to exclude these as soon as possible, now remove nodes from
"selected_nodes" based on the `idname` (rather than `legacy_type`), this
way we can be sure properties match.

Pull Request: https://projects.blender.org/blender/blender/pulls/134930
2025-02-24 08:49:11 +01:00
Harley Acheson
5f6c919553 Merge branch 'blender-v4.4-release' 2025-02-23 13:42:21 -08:00
Harley Acheson
89f61ee6cb Fix: Use Font Flag to Identify Default Fonts
with #133413 the intent was that VSE Text strips would not use the
fallback font stack if using a custom (non-default) font. However this
determination was done by comparing the font id. This was very weak as
the id can vary quite a bit within the first few fonts. This PR instead
adds a BLF function (BLF_is_builtin) that uses BLF_DEFAULT font flag
instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/135014
2025-02-23 22:41:08 +01:00
Harley Acheson
4e0d5647a8 Merge branch 'blender-v4.4-release' 2025-02-23 13:20:17 -08:00
Harley Acheson
12b1f8bd7a Fix #134972: Do Not Render Text Characters in Control Code Range
Text characters in the CO Controls range, 0-31, are not meant to have
any displayable representation. For most Blender code this hasn't
mattered since we usually specifically exclude this range in text
processing. But for times when we don't we need to avoid rendering
glyphs in this range as some fonts contain blank (but not empty) items
here.

Pull Request: https://projects.blender.org/blender/blender/pulls/135013
2025-02-23 22:19:09 +01:00
Campbell Barton
44d6ff6f8b Merge branch 'blender-v4.4-release' 2025-02-23 22:21:29 +11:00
Campbell Barton
0013db5aef Fix #134948: face orientation depends on pivot type (for a single face)
Technically a regression in [0] since switching the pivot between
the "Median Point" and "Active Element" would previously use the
same orientation with a single face selected.

However the same issue existed when multiple faces were selected so
changing the pivot type can still change the orientation in some
situations.

Restore the previous behavior by removing logic to pick the "best"
tangent when a single face is selected.

[0]: c7104f5392
2025-02-23 22:19:27 +11:00
Campbell Barton
ab77b6066b Cleanup: correct argument names in recent RNA API function 2025-02-23 21:12:51 +11:00
Campbell Barton
4a6d687d53 PyAPI: Support KeyMap.keymap_items.find_match(...)
There was no convenient way for an add-on to show it's "user"
key-map items in the preferences, "user" meaning the key-map
item which is edited in the key-map editor, not the original
key-map item created in `wm.keyconfigs.addon`.

Add a method to key-maps to lookup a user key-map item from an
add-on key-map & key-map-item.

Ref !134830
2025-02-23 21:05:19 +11:00
Campbell Barton
28126b83a5 PyAPI: Support KeyConfig.keymaps.find_match(...)
Add a convenience function to find the matching key-map
from another key-configuration.

This is a more convenient alternative to expanding the
ID, space_id & region_id from the key-map, then passing these
to the "find(...)" method.

Split out of !134830.
2025-02-23 21:02:56 +11:00
Campbell Barton
85af07f438 Cleanup: spelling in comments 2025-02-23 21:02:54 +11:00
Campbell Barton
ed4a0faccf Cleanup: quiet unused variable warning 2025-02-23 21:02:53 +11:00
Pratik Borhade
8eb84fdf99 Cleanup: Grease Pencil: Remove unused drawing vector
Noticed during !134899

Pull Request: https://projects.blender.org/blender/blender/pulls/134900
2025-02-22 11:17:42 +01:00
Pratik Borhade
33b4835471 Merge branch 'blender-v4.4-release' 2025-02-22 15:40:22 +05:30
Pratik Borhade
92d1764e30 Fix #134843: Grease Pencil: Crash duplicating active keyframe
Crash in above operation when no drawing exists at current frame. This
is due to accessing value from a nullopt optional. Not fixed with extra
condition before calling `value()`. Also moved this logic into a lambda to
avoid duplicate code.

Pull Request: https://projects.blender.org/blender/blender/pulls/134910
2025-02-22 11:07:20 +01:00