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
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
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
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.
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
This commits fixes a type error issue when reporting that a addon was
designed for a version of Blender newer than the current one.
Thanks to @Rakete for the fix.
Ref: !135392
Adds the option to create a boolean socket that can be used as a panel toggle.
This allows creating simpler and more compact node group UIs when a panel
can be "disabled".
The toggle input is a normal input socket that is just drawn a bit differently in
the UI. Whether a boolean is a toggle input or not does not affect evaluation.
Also see #133936 for guides on how to add and remove panel toggles.
Pull Request: https://projects.blender.org/blender/blender/pulls/133936
This happened for context attributes if already "complete" attributes
were typed/pasted in.
Reason is that this copies functionality from our intellisense
codecompletion where this is expected behavior, for context attributes
we cannot really use "tab" to expand, so it is less useful here.
When confirming (with the additional "."), the keymap entry would be
broken, so better solve in a way that we dont end up with those "." by
removing it.
NOTE: there might be ways to enhance the string-search behavior here (by
properly supporting "tab-expanding"), but this is a bit out-of-scope for
this bugfix.
Pull Request: https://projects.blender.org/blender/blender/pulls/135098
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
Use the new `action.fcurve_ensure_for_datablock()` function to ensure
the opacity F-Curve exists.
This function also ensures that the Action itself is ready for keying
(it has a layer and a keyframe strip), and ensures the slot for the
Scene exists and is assigned.
Co-authored-by: Pratik Borhade <pratikborhade302@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/134753
Adds a new python operator to Grease Pencil for adding the layer
above or below as a masking layers to the active layer.
Creates a new file for Grease Pencil python operators in
`scripts/startup/bl_operators/grease_pencil.py`.
Pull Request: https://projects.blender.org/blender/blender/pulls/134401
Artists often want to quickly switch back and forth between two or more nodes while compositing.
This patch implements two operators `NODE_OT_viewer_shortcut_set` and `NODE_OT_viewer_shortcut_get` that allow users to map a viewer node to a shortcut. For example, pressing `cltr+1` while a node is selected, assigns that node to the shortcut `1`, creates a viewer node if it has none attached and sets that viewer node to active. Pressing `1` will set the active node with shortcut `1` to active.
Shortcuts are saved in DNA to preserve them after saving/loading blend files.
Limitations:
- Only compositor node tree is supported, because shading editor has no viewer node and geometry nodes viewer works differently.
Pull Request: https://projects.blender.org/blender/blender/pulls/123641
Add icons to better identify data types in the Batch Rename type menu.
Makes it easy for users to recognize icons they are already familiar
with, especially when following tutorials in English while using a
translated UI.
Also fixes 'Light' being singular, while others were plural.
Pull Request: https://projects.blender.org/blender/blender/pulls/130300
This PR adds new RNA properties that deprecate and replace any `sequence` property.
The old prooperties are still there and fully functional, but the description is changed
to indicate that these will be removed in the future and that the new properties should
be used instead.
| Deprecated property | Replacement property |
| --------------------------------- | ----------------------------------- |
| `context.active_sequence_strip` | `context.active_strip` |
| `context.selected_editable_sequences` | `context.selected_editable_strips` |
| `context.selected_sequences` | `context.selected_strips` |
| `context.sequences` | `context.strips` |
| `SequenceEditor.sequences` | `SequenceEditor.strips` |
| `SequenceEditor.sequences_all` | `SequenceEditor.strips_all` |
| `MetaStrip.sequences` | `MetaStrip.strips` |
Previously, rna paths for animation data on strips started with `sequence_editor.sequences`.
This PRadds versioning for the rna paths to make sure to use
the new naming scheme. This does mean that in previous versions of blender,
the animations don't show but the data is not lost (even if the file is saved in the older version).
Also do some cleanup of existing python scripts inside the source to use the
new properties.
Part of #132963.
Pull Request: https://projects.blender.org/blender/blender/pulls/133156
- Wrap the closing parenthesis onto it's own line
which makes assignments to the return value
read better.
- Reduce right-shift with multi-line function calls.
- In the context of color balance, refers to a power function. Uses
ID_MOVIECLIP context, because the ID_NODE is already used for math
functions.
- In the context of the scale constraint, also a power function.
- In the context of physics and particle settings, refers to a
falloff.
- In the context of property subtypes and units, refers to a
quantity.
Issue reported by Hoang Duy Tran.
"Light" already has multiple contexts, but some were missing:
- In general, "Light" refers to a Blender Light object. In many cases,
this comes from an `id_type` enum, already using the ID context. Use
it also for properties that were missing that context.
- In the context of render passes, "Light" is the actual illumination
factor, not the light emitor. A new "Render Layer" translation
context is introduced for this purpose as no existing ones are both
specific and explicit enough.
Issue reported by Hoang Duy Tran.
Support walking over non-manifold edge loops since calculating a
per-edge UV length only makes sense if all UV's that use that edge
are taken into account.
`Action.slots.new()` in the Python API previously took either an ID or nothing
as a parameter. In the former case it would create a slot with the appropriate
`id_root` and name for that ID. In the latter case it would create a default
slot with an unspecified `id_root` and default name.
This had several issues:
1. You couldn't create a slot with a specific `id_root` without already having
an ID of that type. In theory this isn't a problem, but in practice in larger
scripts/addons you don't necessarily have such an ID on hand at the call
site.
2. You couldn't directly create a slot with a desired name without an existing
ID with that name. This isn't so important, since you can always just set the
name afterwards. But it's a bit annoying.
3. Most other `new()` APIs in Blender *require* you to specify the name of the
item being created. So calling this with no parameters was violating that
norm.
4. Ideally, we want to eliminate unspecified `id_root`s, since they cause other
weirdness in the API such as slot identifiers changing upon slot assignment.
To resolve these issues, and just generally to make the API more
straightforward, this PR changes `slots.new()` to take two required parameters:
an ID type and a name. For example:
`slots.new(id_type='CAMERA', name="My Camera Data Slot")`.
This fully specifies everything needed for the slot identifier upon creation,
and doesn't require any outside data items to create a slot with the desired
type and name.
In the future if we decide we still want a `for_id`-style slot creation API, we
can reintroduce it as a separate function.
Ref: #130892
Pull Request: https://projects.blender.org/blender/blender/pulls/130970
In Blender 4.3 all the EEVEE Legacy compatibility Python API calls for
materials in were removed. All Python code that makes use of that API
need to be updated to make use of the new API.
This commit updates two built in Python scripts to use the new API
to avoid errors like the one reported in #130822
Candidate for 4.3.1 corrective release
Pull Request: https://projects.blender.org/blender/blender/pulls/130873