Commit Graph

3312 Commits

Author SHA1 Message Date
Jacques Lucke
8ec9c62d3e Geometry Nodes: add Closures and Bundles behind experimental feature flag
This implements bundles and closures which are described in more detail in this
blog post: https://code.blender.org/2024/11/geometry-nodes-workshop-october-2024/

tl;dr:
* Bundles are containers that allow storing multiple socket values in a single
  value. Each value in the bundle is identified by a name. Bundles can be
  nested.
* Closures are functions that are created with the Closure Zone and can be
  evaluated with the Evaluate Closure node.

To use the patch, the `Bundle and Closure Nodes` experimental feature has to be
enabled. This is necessary, because these features are not fully done yet and
still need iterations to improve the workflow before they can be officially
released. These iterations are easier to do in `main` than in a separate branch
though. That's because this patch is quite large and somewhat prone to merge
conflicts. Also other work we want to do, depends on this.

This adds the following new nodes:
* Combine Bundle: can pack multiple values into one.
* Separate Bundle: extracts values from a bundle.
* Closure Zone: outputs a closure zone for use in the `Evaluate Closure` node.
* Evaluate Closure: evaluates the passed in closure.

Things that will be added soon after this lands:
* Fields in bundles and closures. The way this is done changes with #134811, so
  I rather implement this once both are in `main`.
* UI features for keeping sockets in sync (right now there are warnings only).

One bigger issue is the limited support for lazyness. For example, all inputs of
a Combine Bundle node will be evaluated, even if they are not all needed. The
same is true for all captured values of a closure. This is a deeper limitation
that needs to be resolved at some point. This will likely be done after an
initial version of this patch is done.

Pull Request: https://projects.blender.org/blender/blender/pulls/128340
2025-04-03 15:44:06 +02:00
Christoph Lendenfeld
28d0bef706 Fix: Retain slot name when baking action
Previously when an action was baked, the slot name was not retained.
This causes problems when switching between actions because the slot
will not automatically be assigned.

This is now fixed by ensuring that the name of the last assigned slot
is used to create the new slot.

Pull Request: https://projects.blender.org/blender/blender/pulls/136814
2025-04-03 10:18:15 +02:00
quackarooni
8a869c20e9 Geometry Nodes: Match String node
Adds "Starts With", "Ends With", and "Compare" string operations as a
standalone node.

Pull Request: https://projects.blender.org/blender/blender/pulls/136021
2025-04-03 02:57:39 +02:00
Campbell Barton
b2c57fd877 PyDoc: use complete sentences in comments for templates & examples 2025-04-02 23:46:58 +00:00
Hans Goudey
7a4ce4184d Shape Keys: Add "Duplicate Shape Key" operator
Part of #135095.

This operator just adds a copy the active shape key, including its
data and settings.

Pull Request: https://projects.blender.org/blender/blender/pulls/136785
2025-04-01 18:24:00 +02:00
Sybren A. Stüvel
9811c5c5de Fix #136706: Converting bone rotation with Rigify crashes Blender
Fix a crash that was caused by looping over a collection and deleting
items from that collection at the same time.

Pull Request: https://projects.blender.org/blender/blender/pulls/136758
2025-03-31 14:08:47 +02:00
Cartesian Caramel
ade8576bf7 Geometry Nodes: new Camera Info Node
This adds a new Camera Info node to Geometry Nodes. It provides information
about the passed in camera like its projection matrix and focus distance.

This can be used for camera culling which was must more complex before.
It also allows building other view-dependent effects.

Pull Request: https://projects.blender.org/blender/blender/pulls/135311
2025-03-28 22:54:13 +01:00
Jacques Lucke
29fddf4710 Python: Geometry: create GeometrySet wrapper for Python
In Geometry Nodes a geometry is represented by a `GeometrySet`. This is a
container that can contain one geometry of each of the supported types (mesh,
curves, volume, grease pencil, pointcloud, instances). It's possible for a
`GeometrySet` to contain e.g. a mesh and a point cloud.

This patch creates a Python  wrapper for the built-in `GeometrySet`. For now,
it's main purpose is to consume the complete evaluated geometry of an object
without having to go through complex hoops via `depsgraph.object_instances`. It
also also allows retrieving instances that have been created with legacy
instancing systems such as dupli-verts or particles.

In the future, the `GeometrySet` API could also be used for more kinds of
geometry processing from Python, similar to how we use `GeometrySet` internally
as generic geometry storage.

Since we can't really have constness guarantees in Python currently, it's
enforced that the `GeometrySet` wrapper always has its own copy of each geometry
type (so e.g. it does not share a `Mesh` data-block pointer with any other place
in Blender). Without the copy, changes to the mesh in the geometry set would
also affect the evaluated geometry that Blender sees. The copy has a small cost,
but typically the overhead should be low, because attributes and other run-time
data can still be shared. This should be entirely thread-safe, assuming that no
code modifies implicitly shared data, which is forbidden. For historic reasons
there are still cases like #132423 where this assumption does not hold in all
cases. Those cases should be fixed. To my knowledge, this patch does not
introduce any new such issues or makes existing issues worse.

Pull Request: https://projects.blender.org/blender/blender/pulls/135318
2025-03-28 22:40:01 +01:00
Campbell Barton
38d9d971e5 WM: add a "Hyper" capability flag
Avoids the need to check against ghost backends.
2025-03-28 13:46:39 +11:00
Campbell Barton
894dca7f76 UI: correct the keymap editor to match the OSKEY label to the platform 2025-03-28 13:26:09 +11:00
Campbell Barton
f84e473b1a Cleanup: simplify check if the preferences is already shown
Minor change to !136139.
2025-03-28 11:59:06 +11:00
IREXTIA
e7d1674ca6 UI: preferences.addon_show() | Skip opening another window if there's already a preferences editor in the current window
When viewing extension details, no need to call userpref_show if a
Preferences editor is in the main window, as that will just open a new
Preferences window.

Pull Request: https://projects.blender.org/blender/blender/pulls/136139
2025-03-28 00:21:11 +01:00
Omar Emara
69270f612b Compositor: Add Texture nodes
Texture nodes are already supported through the GPUMaterial and
multi-function compositor abstractions. So we just need to expose them
through the add menu.
2025-03-26 16:43:31 +02:00
Campbell Barton
e436b9638e Cleanup: replace references to "C" to C++ or the C-API
Also capitalize Blender, Python & API in docs & code-comments.
2025-03-26 17:23:33 +11:00
Kace
200603c0b2 VSE: Fix Delete Retiming Keys in Context Menu
Update the context menu to use `retiming_key_delete`.
Also update the corresponding operator's description to match its purpose.

Pull Request: https://projects.blender.org/blender/blender/pulls/136348
2025-03-26 04:00:35 +01:00
Campbell Barton
5e2b421996 WM: support the "Hyper" modifier key on Linux
Add support for a 5th modifier key called "hyper",
this is a modifier supported on Wayland & X11 although
other platforms could support an additional modifier too.

Both GNOME and KDE can map CapsLock to Hyper.
Other compositors can use the XKB_DEFAULT_OPTIONS environment variable.

This allows users to have an additional modifier for their own use
that doesn't conflict with other keys.

Ref !136340
2025-03-26 10:39:55 +11:00
John Kiril Swenson
b729928897 Cleanup: VSE: Rename Keymaps
Rename to be more consistent with other Blender keymaps, as well as the
naming convention used in "View Type."

- "SequencerCommon" -> "Video Sequence Editor"
- "SequencerPreview" -> "Preview"
- "Sequencer Timeline Tool" -> "Sequencer Tool"
- "Sequencer Preview Tool" -> "Preview Tool"

There is versioning in place to make sure custom keyconfigs keep working.

Once #131102 goes through, if we would like to rename the "Sequencer"
view type to "Timeline" or "Sequencer Timeline," then we can make the
necessary changes here too.

Pull Request: https://projects.blender.org/blender/blender/pulls/136217
2025-03-25 23:46:15 +01:00
Richard Antalik
0b633fab3e Fix #135631: Locked strip visibility can't be changed
Strip locking was meant to be used with strip transformation only. So
the check, whether strip is locked is removed from hide/unhide operator.

Further it was requested to lock sound strip subframe offset. Since this
is time related property, it was moved to time panel. This also
addresses request to make it more obvious, why the value can't be
changed.
The name of the property was clarified from "Offset" to
"Sound offset", because there are another 2 offsets in the panel.

Finally, when channel is locked, properties in side panel now reflects
this state. This is done by adding RNA get function for `Strip.lock`
property. Function `seq::transform_is_locked` is used instead of
checking `SEQ_LOCK` flag, because it also checks channel state. With
this setup, the lock property can't be disabled while channel is locked.
However strip lock flag will be unset, which can be prevented. (I am not sure which is better. Both are fine in my eyes.)

Pull Request: https://projects.blender.org/blender/blender/pulls/135831
2025-03-25 21:50:05 +01:00
Falk David
a910486fe0 Geometry Nodes: Add "Grease Pencil" menu
This adds a new Grease Pencil menu and moves the existing
Grease Pencil related nodes into it.

Pull Request: https://projects.blender.org/blender/blender/pulls/136498
2025-03-25 16:38:18 +01:00
Omar Emara
7c0c31efb0 Nodes: Enable panel toggles in the Compositor
This patch enables panel toggles in the compositor since it now supports
boolean sockets. This essentially reverts c3957f432a.
2025-03-24 10:20:39 +02:00
YimingWu
68a0e68bcd Fix #135999: Extensions: Remove emails in bl_info['author']
Previously when an addon is expanded on the UI, the "Maintainer" string
would be cut short until a `<` character, to prevent showing e-mail on the
UI, however there could be more than one person/email entries in there
so to prevent cutting short the string, now we use regex to take out the
email part only, so full maintainer string is displayed.

Pull Request: https://projects.blender.org/blender/blender/pulls/136031
2025-03-24 07:35:44 +01:00
Julien Duroure
8c35fe05b6 Fix Regression: glTF: Fix NLA track export mode 2025-03-22 00:27:53 +01:00
Johnny Matthews
633b8d30db Fix #135071: Vertex Parenting: Provide Index Access Options
When using vertex parenting, an option for using the parent object
final evaluated indices is exposed in the Object Properties: Relations
panel. This allows the calculation of the parent vertex position to
ignore the the CD_ORIGINDEX layer and instead use the final indices
that may have been altered by the node tree evaluation.

The indices that will be used for the vertex parenting are also exposed
to the UI in the same panel, allowing them to be altered after the
vertex parent has been created.
2025-03-21 23:43:48 +01:00
Guillermo Venegas
61783caa7f UI: Rename Add File Node operator to Add Image as Node
`Add File Node` name is too generic. This operator only handles
opening images and movies as nodes, not script files or other kind of files as nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/122561
2025-03-21 22:49:13 +01:00
Jonas Holzman
bcb343c597 Python Templates: Add Gizmo Simple 2D
Following discussion to document the `icon_value` property of
`GIZMO_GT_button_2d` in PR #136080, and generally improve the
documentation of this Gizmo Type, this patch adds a new "Gizmo
Simple 2D" Python template, and renames the existing "Gizmo
Simple" template to "Gizmo Simple 3D".

Pull Request: https://projects.blender.org/blender/blender/pulls/136304
2025-03-21 12:20:22 +01:00
Campbell Barton
d037fcd5fb Cleanup: don't redefine built-ins in the key-map
Also remove redundant dictionary unpacking for a single item.
2025-03-21 22:08:31 +11:00
Campbell Barton
5b04f13219 Cleanup: wrap long lines 2025-03-21 22:08:31 +11:00
Campbell Barton
d9edc0c057 Cleanup: replace multiple checks with static sets 2025-03-21 22:08:31 +11:00
Campbell Barton
bf3297aefd Correct error accessing current tags in last commit 2025-03-21 16:30:30 +11:00
Campbell Barton
9789dc8426 Fix #132636: Showing updates doesn't show available theme updates
When updates are available, clicking on the button in the status bar
was only showing "Add-on" updates.

Restore the ability to show "All" extension types which is
set when showing updates.
2025-03-21 16:00:33 +11:00
Campbell Barton
bd2c0f2b49 Cleanup: remove unused variable 2025-03-21 15:07:07 +11:00
Harley Acheson
c13d3e2f7a UI: Color Icons for Red, Green, & Blue
This adds icons for ICON_RGB_RED, ICON_RGB_GREEN, and ICON_RGB_BLUE
that display with those colors. This does not remove the existing
monochrome ICON_COLOR_* icons. This also allows the translation of
the "R", "G", "B" characters shown, for languages that prefer color
words that do not start with these.

Pull Request: https://projects.blender.org/blender/blender/pulls/136154
2025-03-21 01:57:32 +01:00
Julian Eisel
6c1c5e8923 Asset browser import settings popover with collection instancing option
Part of #134755 / #134766.

Adds options to the new Import Settings popover (added in 7a6beb65f4)
to toggle collection instancing for dragging in collections. It can be
toggled separately for linking and appending, since it's typical to use
instancing for linking, but not appending (current default, also with
this change).

Previously, toggling collection instancing was only possible via the
Adjust Last Operation panel but this wasn't obvious, many people were
not aware. Adding this option based on feedback by the Blender Studio.

Pull Request: https://projects.blender.org/blender/blender/pulls/135996
2025-03-20 18:44:24 +01:00
Sybren A. Stüvel
640255bbbf Anim: add keying set support to Copy Global Transform add-on
When the scene settings indicate the active keying set should be used,
this is taken into account for all auto-keying done by the add-on. This
covers:

- Pasting global transform
- Pasting relative transform
- Fix to Camera

Support is limited to *relative* keying sets. Absolute keying sets,
which thus determine what gets keyed regardless of the selection, are
not supported, as the interaction between the "copy this object/bone's
transform" is currently not known.

Fix to Camera has its own settings for what to key; these will be
combined with the keying set. Only those properties that are enabled in
the Fix to Camera settings AND included in the keying set will be keyed.
To give a concrete example: when the "Location & Rotation" keying set is
active, and "Location" and "Scale" are checked in the Fix to Camera
panel, only the location will be keyed.

A message is shown in the Fix to Camera panel to notify users that the
keying set will affect the keys as well.

The keying set will only be considered when the auto-keying option "Only
Active Keying Set" is enabled.

Fixes: #136076

Pull Request: https://projects.blender.org/blender/blender/pulls/136187
2025-03-20 16:08:10 +01:00
Omar Emara
775df8826b Compositor: Add Image Info node
This patch adds a new Image Info node which returns information about
compositor images. The node has three sources:

The node returns the following information:

- Pixel Coordinates: The coordinates of the centers of the pixels in the
  image. Those are essentially the integer coordinates with half pixels
  offsets added.
- Texture Coordinates: Zero centered pixel coordinates normalized along
  the greater dimension. Somewhat analogous to Object coordinates in
  shader nodes.
- Resolution: The resolution of the image.
- Location: The location of the image in the virtual compositing space.
- Rotation: The rotation of the image in the virtual compositing space.
- Scale: The scale of the image in the virtual compositing space.

This node is very useful to allow greater flexibility and procedural
creations. For instance, coordinates can be used to create procedural
effects like vignette using very simple math nodes. And size can be used
to compute size-relative parameters for pixel-parameter nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/135104
2025-03-19 11:38:29 +01:00
Omar Emara
0a80f470f8 Compositor: Add common nodes to compositor
This patch adds common nodes that are used in Geometry Nodes and Shader
Nodes to the compositor. The following new nodes were added:

- Vector Math.
- Vector Rotate.
- Vector Mix.
- Value Mix.
- Clamp.
- Float Curve.
- Blackbody.

The follow nodes were replaced by common counterparts:

- Value.
- Color Ramp.
- Mix Color.
- Map Range.
- Math.
- Combine XYZ.
- Separate XYZ.
- Vector Curves.

Some new features were gained in the process:

- Mix Color can now clamp both factor and result.
- Map Range can map different types and interpolations.
- Vector Curves gained a new Factor input.

Some behaviors were changed:

- Map Range previously forcibly clamped values whose magnitude is larger
  than the arbitrary value of 10000. This is no longer the case.

Some nodes were removed:

- Map Value. This was Map Range without the maximum 10000 limitation
  followed by a Clamp node. Both are now available as nodes.

Some common nodes remain separate:

- Separate/Combine Color. Shader counterpart does not yet support all
  color modes, and does not support alpha.
- RGB Curves. Shader variant does not support Film-Like curves or
  Black/White balancing.

Texture nodes will also be added soon in a separate patch. Nodes that
were replaced are now deprecated but still exist and will later be
removed in v5.0. Backward compatibility code was introduced to convert
from the deprecated nodes to the new nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/135300
2025-03-19 10:54:36 +01:00
Julian Eisel
7a6beb65f4 Asset Browser: Add import settings popover, move import method into it
Part of #134755 / #134766.

Replaces the current import method menu in the middle of the Asset
Browser header with a "Import Settings" popover. The import method is
located there now, because it doesn't need to be as prominent as it used
to be, especially with #104686.

Plan is to add further settings to this popover, e.g. see #135996 or
 #134943.
2025-03-18 17:49:44 +01:00
Martin-Vignali
985f6f82b6 UI: Output > FFmpeg Video hide useless parameters for some codecs
Before this patch, Video Output using FFmpeg video
display lot of parameters.

But some of theses have a meaning only for some codec
(mainly lossy gop codecs : H264, H265, AV1...)

Hide not useful parameters for codec :
'DNXHD', 'FFV1', 'HUFFYUV', 'PNG', 'QTRLE'

- DNXHD : intra frame codec, encoding setting depends of a profile
- FFV1/QTRLE : Intra or P frames only. Lossless codec
- HUFFYUV/PNG : Intra lossless codec

Co-authored-by: mvji <33432858+mvji@users.noreply.github.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/135827
2025-03-18 09:11:14 +01:00
Hans Goudey
835696f152 Geometry Nodes: Move import nodes out of experimental
The import nodes are considered complete enough to expose without
the experimental option. This commit removes the option so they will
be exposed in 4.5. There are still some possible future improvements,
including automatic caching, possibly exposing more input sockets,
and possibly including imported paths in the "Internal Dependencies"
panel. Those are considered non blocking though.

Pull Request: https://projects.blender.org/blender/blender/pulls/135957
2025-03-17 13:54:48 +01:00
Pratik Borhade
e82c22f55e Cleanup: Grease Pencil: Remove old IO operator reference
Operator code is removed though they are still referenced in list of
"cleanup operator preset"

Pull Request: https://projects.blender.org/blender/blender/pulls/136062
2025-03-17 07:56:26 +01:00
Jun Mizutani
9dae51a3d4 UI: Blender theme colors matching the default theme for the face orientation front
Face Orientation Front Color has been changed to transparent for the
default theme (8bcb714b9e). This PR makes the Blender Light theme for
the face orientation front match the default theme alpha.

Pull Request: https://projects.blender.org/blender/blender/pulls/136034
2025-03-17 01:08:45 +01:00
Nika Kutsniashvili
7e3e093254 Anim: Add 12, 8, and 6 FPS presets
Add 12, 8, and 6 FPS presets often used in stylized animation,
especially in 2D/Grease Pencil animation.

12 FPS to animate on 2's, 8 FPS on 3's, 6 FPS on 4's or for
early blocking stages or storyboard.

Pull Request: https://projects.blender.org/blender/blender/pulls/135712
2025-03-16 19:46:40 +01:00
Campbell Barton
4654855d20 Fix error running edit-mode extrude operators for non-mesh objects
The poll functions for: VIEW3D_OT_edit_mesh_* operators only checked
for an edit-mode object which failed with an unhandled exception for
non-mesh objects.
2025-03-16 19:33:30 +11:00
Yury
5b3952d11a FBX Export: Add Smoothgroups option.
Add 'Smoothing Groups' option for exporting polygon smoothing groups.

Generates 'bitflags' smoothgroups values, ensuring no faces from different
groups sharing a same boundary edge or vertex have the same bitflag value.

NOTE: This type of smoothgroups will run out of group values (aka bitflags) with
some specific topologies, e.g. a fan of over 31 flat faces sharing a same vertex
(like the sides of a cone). In such cases, once all available values have been used,
the remaining faces will get  `0` (aka 'no group') value assigned.

Original issue https://projects.blender.org/blender/blender-addons/issues/104434

Pull Request: https://projects.blender.org/blender/blender/pulls/135646
2025-03-14 17:13:41 +01:00
Julian Eisel
4499fad40e UI: Horizontal list view for asset browser
Part of #134755 / #134766.

The asset browser currently lacks a compact view that leaves names
readable. Especially when managing asset libraries (e.g. to prepare it
for sharing or set up a production library), this is quite a usability
issue. A column view like the file browser has can solve this, allowing
a quick overview and fast browsing of libraries, while keeping names
readable.

Adds a new "Horizontal List" display mode to the asset browser that
distributes assets over multiple columns, with horizontal scrolling.
Asset previews are shown in this mode, plus an asset type icon if
there's enough space. The size of previews and the columns can be
configured next to the display mode, for optimizing the display.

Pull Request: https://projects.blender.org/blender/blender/pulls/135306
2025-03-14 16:43:12 +01:00
Pratik Borhade
f5ceb3822a Grease Pencil: Stroke split operator
An operator to split selected points into a separate stroke.
Use `split_points()` function implemented in 2c42294557

Resolves #113643

Pull Request: https://projects.blender.org/blender/blender/pulls/135845
2025-03-14 12:37:25 +01:00
Habib Gahbiche
d8d09cdadb Geometry Nodes: shortcuts for viewer nodes
Implement shortcuts for viewer nodes. Viewer nodes are now activated using the operator `bpy.ops.node.activate_viewer()` instead of activating the viewer by setting the node to active.

This also unifies the behavior with viewer shortcuts in the compositor (see attachment in the original PR).

Pull Request: https://projects.blender.org/blender/blender/pulls/134555
2025-03-14 11:26:57 +01:00
Sybren A. Stüvel
565377b8f1 Merge remote-tracking branch 'origin/blender-v4.4-release' 2025-03-13 11:27:13 +01:00
Pratik Borhade
5a09715db9 Fix #135847: Grease Pencil: Empty material slot doesn't show icon
Move those material specific conditions below so that `icon` is always
drawn in UI even when material does not exist at specific slot.

Pull Request: https://projects.blender.org/blender/blender/pulls/135849
2025-03-13 10:17:05 +01:00
Campbell Barton
6ef7dae8ef Cleanup: spelling in comments (make check_spelling_*) 2025-03-13 13:41:17 +11:00