Commit Graph

917 Commits

Author SHA1 Message Date
Campbell Barton
688c389e1a Fix #148051: Duplicate wheels when extension build using "paths"
Extension manifests defining both wheels and a literal paths included
wheels in the ZIP file twice.

Ref !148247
2025-10-17 13:59:52 +11:00
Christoph Lendenfeld
174279a2a5 Fix #148164: Rigify hide drivers not generated correctly
Some less obvious uses of the `Bone.hide` property were missed in the last fix.
Since the property was moved to the pose bone this no longer worked
and has been replaced with `PoseBone.hide`

Pull Request: https://projects.blender.org/blender/blender/pulls/148183
2025-10-16 08:31:00 +02:00
Damien Picard
197d69627d I18n: Fix translation of formatted string in report 2025-10-15 16:26:46 +02:00
Damien Picard
9ff1b4f1ec I18n: Translate error messages in VR add-on 2025-10-15 16:26:46 +02:00
Campbell Barton
d64f7b2f5e Fix: incorrect use of __contains__ for GLTF2
Ref !147965
2025-10-15 16:57:47 +11:00
Bastien Montagne
c1781eba51 Revert "Fix: Simplify import in VR add-on"
This breaks tests (and the VR addon itself of course).

Needs to be done differently, will create new PR for proper fix.

This reverts commit 0c22ef5ae7.
2025-10-13 14:40:22 +02:00
Damien Picard
0c22ef5ae7 Fix: Simplify import in VR add-on
In the Viewport VR Preview, an unusual and complicated import
manipulates sys.path to import a class from a file that is already
importable anyway.

There is no documented reason for this, and the common way to subclass an RNA type in python is by using its `bpy.types....` registered class, _not_ by directly subclassing the python type used to declare/register the parent type.

Pull Request: https://projects.blender.org/blender/blender/pulls/147656
2025-10-13 12:53:17 +02:00
Campbell Barton
1216651ca9 PyAPI: make internal modules explicitly "private"
Rename modules in `./scripts/modules/` to use an underscore prefix to
make it clear they aren't intended to be part of public API's. This
also means there is no implication that these modules should be stable,
allowing us to change them based on Blender's internal usage.

The following modules have been marked as private:

- `animsys_refactor`
- `bl_console_utils`
- `bl_i18n_utils`
- `bl_previews_utils`
- `bl_rna_utils`
- `bl_text_utils`
- `bl_ui_utils`
- `bpy_restrict_state`
- `console_python`
- `console_shell`
- `graphviz_export`
- `keyingsets_utils`
- `rna_info`
- `rna_manual_reference`
- `rna_xml`

Note that we could further re-arrange these modules
(under `_bpy_internal` in some cases), this change is mainly to mark
them as private, further changes can be handed on a case-by-case basis.

Ref !147773
2025-10-13 09:35:09 +00:00
Christoph Lendenfeld
d68680ed61 Fix #147709: Use correct property for bone selection in Python
Replace all calls to `pose_bone.bone.select` with
`pose_bone.select` since that is where the property lives now

Pull Request: https://projects.blender.org/blender/blender/pulls/147725
2025-10-09 16:52:06 +02:00
Damien Picard
09f9edb38c I18n: Translate "Hide Hotkey List" in Node Wrangler preferences
The button used a custom text that could be the same as the default,
properly extracted text ("Show Hotkey Text"), or a different
one ("Hide Hotkey Text"), and was thus not always shown.

Reported by Ye Gui in #43295.
2025-10-09 12:09:56 +02:00
Damien Picard
7ec15a3a98 I18n: Use rpt_ instead of tip_ to translate reports
This was the case in:
- FBX add-on
- Cycles OSL
2025-10-09 12:09:56 +02:00
Demeter Dzadik
f5428c51e0 Rigify: Full Action Slot Support in Blender 5.0
This commit tries to make the bare minimum changes to add a meaningful
level of support for Action Slots in Rigify:

- You can now select an Action Slot in each Action Set-up, and that
  will be assigned to the generated Action Constraints.
- For this to be meaningful, we have to support selecting the same
  Action in multiple Action Set-ups, which would previously throw an
  error.
- For that to be possible however, it was necessary to make the
  trigger selectors of Corrective Action Set-ups select one of the
  other set-ups directly, rather than selecting an Action (datablock),
  and then making an association to one of the action set-ups based on
  that action pointer. (The necessity to allow users to point at
  another action set-up was the reason behind not allowing user to use
  the same action datablock multiple times.)

Pull Request: https://projects.blender.org/blender/blender/pulls/146182
2025-10-07 18:37:44 +02:00
Sybren A. Stüvel
d989117f09 Fix: correct RNA property access in Rigify
Ensure that Rigify correctly handles RNA properties as RNA properties.
Before, it mixed dictionary-style and attribute-style access, but
since 7276b2009a that is no longer
possible.

This means that the (un)registration of the RNA properties needs to
happen in two places: the add-on itself, and the code it generates in
the rig. To be able to inject the code into a blend file, Rigify needs
to access it as string. This commit introduces a new way of dealing
with this: it just has normal code, and uses Python's
[`inspect.getsource()`][getsource] to get that code as string for
injection into the rig file.

[getsource]: https://docs.python.org/3/library/inspect.html#inspect.getsource

The biggest chunk of code in this commit deals with the 'Copy
Parameters', 'Copy Type & Parameters', and 'Mirror Type & Parameters'
operators. Since it's no longer possible to access RNA properties as
dict-like custom properties, new code was written to recursively copy
`bpy.types.PropertyGroup` instances. Eventually this may end up in
Blender itself, but that would mean writing more thorough checks and
making sure it works in many cases. And it might be easier to
implement this on the C++ side, where it should just be a matter of
exposing one `IDP_CopyPropertyContent()` call to the Python API.
That's all for another Blender release, though -- for now this'll have
to do to fix up Rigify for 5.0.

Fixes: #146675
Pull Request: https://projects.blender.org/blender/blender/pulls/147199
2025-10-07 11:37:12 +02:00
Julien Duroure
ad131310e3 Fix - Restore deleting default shader nodes, after recent Blender changes 2025-10-04 23:38:10 +02:00
quackarooni
f7c37b05e4 Fix: Node Wrangler: "Add Reroutes" operator creates new sockets for certain nodes
The "Add Reroutes" operator does not ignore virtual sockets when creating reroutes.

This has the unintended side effect of creating new sockets when attempting to link with said sockets.
This patch adds a check that explicitly skips over them.

Pull Request: https://projects.blender.org/blender/blender/pulls/147306
2025-10-03 20:30:29 +02:00
Nika Kutsniashvili
b4a8e8c5f8 Anim: Move "Copy Global Transform" extension to internal scripts
Move the Copy Global Transform core add-on into Blender's code.

- The entire extension was one Python file. This PR basically splits
  it into two, one for operators (in `bl_operators`) and the other for
  UI panels. Those panels are registered in the 3D viewport's sidebar,
  which were registered in `space_view3d`, but I made the decision
  here to create a new file `space_view3d_sidebar`, because the main
  file is getting too large and difficult to navigate. This PR puts
  the global transform panel in this file. After this is merged, I
  will do refactors to move the rest of the sidebar panels here as
  well.

- `AutoKeying` class was moved into `bpy_extras/anim_utils.py` so that
  it's reusable and also accessible from API, since it's generally
  very useful. There were discussions about putting this somewhere,
  but for now, I chose against it because creating a new file would
  also mean PR would have to affect documentation generation, and
  would complicate things. If we want to, we can probably create a new
  module in the future.

- Little tweaks to labels and descriptions. Now that they exist
  outside of the add-on context, and exist without the user explicitly
  enabling them, they need to be more descriptive and tell users what
  they actually do. They also need to conform to Blender's GUI
  guidelines. Also tried organizing files a little by grouping
  objects.

- Add-on properties (which included word `addon` in the name) have
  been registered in C++, on `scene.tool_settings` with `anim_`
  prefix.

Pull Request: https://projects.blender.org/blender/blender/pulls/145414
2025-10-03 17:42:04 +02:00
Sybren A. Stüvel
8d417cb280 Refactor: lazy import anim_utils from bpy_extras
Import `anim_utils` from `bpy_extras` in a lazy way, instead of at the top
of the module. This will improve load times of Blender.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/147215
2025-10-02 17:00:13 +02:00
Damien Picard
8b351bdee8 Node Wrangler: Fixes for Save Viewer operator
## Fix: Error in Node Wrangler UI when in Sequencer mode

Node Wrangler tried to find the current scene compositing node tree,
even when there was none. This could happen if working on a sequencer
compositing modifier.

This commit hides the Save This Image button when not in Scene
compositing mode.

## Fix: Error in Node Wrangler's Save Image op when file path is empty

If the file path is empty in Save Image operator, it returns `None`
and errors out.

This commit makes it return `{'CANCELLED'}` early in that case.

## Add webp to list of file formats for Save Viewer

## Fix: Error when Viewer Node image renamed and saved

The "Viewer Node" image that contains the current compositing node
tree's viewer data has a hardcoded name by default. However it can be
renamed by the user, which will make the Save Viewer operator fail.

This commit extracts a utility function to get the current viewer
image based on its properties, and simply saves that.

In addition, this avoids having to change the area type to an image
editor to get the current viewer node, and restoring the node editor
afterwards. This action did not restore the current node tree if the
editor was inside a node group.

## Rename "Save This Image" to "Save Viewer Image"

When calling the operator through Menu Search, it is not clear what
"Save This Image" refers to. This commit renames the operator to "Save
Viewer Image", but keeps the old name for the button label.

Pull Request: https://projects.blender.org/blender/blender/pulls/147085
2025-10-02 16:14:32 +02:00
Sybren A. Stüvel
7b18a2c324 Refactor: convert Rigify from legacy Action API to the current API
Minimal changes to make Rigify use the current Action API (introduced in
Blender 4.4) instead of the legacy API (removed in 5.0).

Most of the refactoring consists of:

- Find the right `Channelbag`
- Replace operations on `Action` with operations on that `Channelbag`.

I didn't manage to test all code, because some code paths are very hard
to follow, and others seem to only be available for legacy rigs.

This is part of #146586

Pull Request: https://projects.blender.org/blender/blender/pulls/147060
2025-10-02 14:42:43 +02:00
Sybren A. Stüvel
c77ac91ee4 Refactor: convert "Copy Pose Asset" operator to use the current Action API
Convert the Copy Pose Asset code from the legacy Action API to the
current API (introduced in Blender 4.4).

No functional changes.

This is part of #146586

Pull Request: https://projects.blender.org/blender/blender/pulls/147060
2025-10-02 14:42:42 +02:00
Sybren A. Stüvel
0b978a20e7 Refactor: convert BVH importer to use the current Action API
Use the current API (i.e. not the to-be-deleted-in-5.0 one) to import
F-Curves from BVH files.

No functional changes.

This is part of #146586

Pull Request: https://projects.blender.org/blender/blender/pulls/147060
2025-10-02 14:42:42 +02:00
Sybren A. Stüvel
6c011cfed8 IO: update FBX im-/exporter to use the current Action API
Use the current Action API (i.e. move away from the to-be-deleted-in-5.0
one) to import and export F-Curves from/to FBX files.

There is a slight difference in functionality for the exporter, in the
selection of which Actions to export for the "All Actions" option. This
is just a minimal change to ensure the legacy API is no longer used.

Old: `action.fcurves` was iterated, and if all FCurves could resolve to
existing properties, the Action was exported. This would only work
reliably for single-slotted Actions, due to the use of the deprecated
`action.fcurves` property.

New: the above check is done for each Channelbag in the Action. The
first Channelbag that match the above check is exported. This does _not_
export all suitable channelbags; it merely improves on the old behaviour
slightly.

This is part of #146586

Pull Request: https://projects.blender.org/blender/blender/pulls/146980
2025-10-02 10:25:50 +02:00
Campbell Barton
a941108804 Cleanup: defer loading anim_utils (previous wm.py commit wasn't enough) 2025-10-02 09:27:16 +10:00
Campbell Barton
3165ab2933 Cleanup: duplicate field warning, trailing space 2025-10-02 07:49:07 +10:00
hogan.mastanduno
dde9d21b91 OpenXR: VR Advanced Locomotion Phase 1
Includes the following changes to the existing Locomotion system for VR Scene Inspection:
 * new VR Navigation Preferences and VR Session Settings
 * changes to XR raycast logic and its visualization
 * new XR vignette that appears when moving
 * snap turning

Pull Request: https://projects.blender.org/blender/blender/pulls/144241
2025-10-01 22:16:12 +02:00
Habib Gahbiche
fb7818e55e Python: Create default node tree for new materials and worlds
The motivation is to keep backward compatibility after deprecating
 `material.use_nodes()` and `world.use_nodes`. For example the
following script would behave the same way in 4.5 and 5.0:
```python
mat = bpy.data.materials.new("My new mat")
mat.use_nodes = True
```

Pull Request: https://projects.blender.org/blender/blender/pulls/147052
2025-10-01 15:05:16 +02:00
Sybren A. Stüvel
44913ffb60 Anim: Remove legacy pose library conversion
Remove the operators to convert a legacy pose library (from Blender 2.93
and older) to the current system (introduced in Blender 3.0).

The removal is mostly because the pose markers do not play well with
slotted Actions. The conversion code was never updated for those, and by
now it's easier to remove them than to update the code to the current
data model.

Technically it was still possible to create a legacy pose library (an
Action with pose markers) in current versions of Blender, and then use
this operator to convert that to a modern pose library. I don't know of
anybody doing that, though.

This is part of #146586

Pull Request: https://projects.blender.org/blender/blender/pulls/147061
2025-09-30 16:13:04 +02:00
Sybren A. Stüvel
fb2548afbd Revert "IO: update FBX im-/exporter to use the current Action API"
This reverts commit 8536cd794e. It is
still under review, and was accidentally pushed to `main`.
2025-09-30 15:07:15 +02:00
Sybren A. Stüvel
8536cd794e IO: update FBX im-/exporter to use the current Action API
Use the current Action API (i.e. move away from the to-be-deleted-in-5.0
one) to import and export F-Curves from/to FBX files.

There is a slight difference in functionality for the exporter, in the
selection of which Actions to export for the "All Actions" option. This
is just a minimal change to ensure the legacy API is no longer used.

Old: `action.fcurves` was iterated, and if all FCurves could resolve to
existing properties, the Action was exported. This would only work
reliably for single-slotted Actions, due to the use of the deprecated
`action.fcurves` property.

New: the above check is done for each Channelbag in the Action. The
first Channelbag that match the above check is exported. This does _not_
export all suitable channelbags; it merely improves on the old behaviour
slightly. The new, C++-based FBX exporter is more feature-complete in
this regard.

This is part of #146586
2025-09-30 14:57:35 +02:00
Alaska
05840611d7 Fix #146551: Node wrangler treats warning nodes as unused nodes
Node wrangler has a "delete unused nodes" operator that will delete
nodes that do not contribute to the output of the node network.

Warning nodes, don't contribute to the output of the geometry nodes,
but it does output information to the Geometry nodes UI. So  warning
nodes should still be considered nodes that contribute to the output.

This commit adds warning nodes to the list of nodes that contribute
to the output to avoid them being deleted by the "delete unused nodes"
operator.

Pull Request: https://projects.blender.org/blender/blender/pulls/146558
2025-09-30 11:34:50 +02:00
Lukas Tönne
8697bffe22 Fix #146946: Breaking a node zone crashes on valid pointer assumption
The Node Wrangler addon has a _Reset Nodes_ operator that can remove the input
node of a node zone. This crashes in reference set updates because the code
expects valid input/output node pairs in each zone.

The fix is two-fold:
1. Finding zones for the runtime now returns an empty result to ensure no
  invalid node pointers are being accessed. This should not happen in practice,
  all operators should make sure zone relationships are not broken.
2. The node wrangler addon is updated to ignore all zone types, including the
  newer repeat, closure, and for-each-element zones. The type filtering was
  outdated and now uses the `bl_idname` consistently.

Pull Request: https://projects.blender.org/blender/blender/pulls/147028
2025-09-30 10:49:20 +02:00
Alaska
6c56289f43 Fix #146679: Node wrangler connects bump maps to filter width
This commit fixes a issue where the node wrangler addon would connect
bump mapping textures to the filter width input of the bump node,
instead of the height input.

Pull Request: https://projects.blender.org/blender/blender/pulls/146684
2025-09-29 16:18:15 +02:00
Casey Bianco-Davis
d2269441bb Python: Rename bpy.data.grease_pencils_v3 to bpy.data.grease_pencils
This renames `bpy.data.grease_pencils_v3` to `bpy.data.grease_pencils`.

Part of #125058.

Pull Request: https://projects.blender.org/blender/blender/pulls/146904
2025-09-29 12:32:08 +02:00
Damien Picard
fb2f5b3a64 I18n: Translate dynamic enum items from glTF exporter
These dynamic enum items cannot be extracted automatically, so mark
them manually.

Reported by Ye Gui in #43295.
2025-09-29 11:07:03 +02:00
Damien Picard
263bc0d5cd I18n: Translate Node Wrangler shortcut list in add-on preferences
Reported by Ye Gui in #43295.
2025-09-29 11:07:03 +02:00
Julien Duroure
7e0566b26e glTF: deprecation of use_nodes
use_nodes is now deprecated in Blender 5.0

- Remove check checks
- Remove all nodes before creating the node tree is no more needed : these nodes are no more created at material creation
2025-09-29 10:49:59 +02:00
Julien Duroure
a673c627e5 Fix #142767 - glTF exporter: Fix crash with shader node group traversal
Make sure to pass group_path by value in recursive function
2025-09-29 10:43:38 +02:00
Brecht Van Lommel
78ae7ec392 Render: Rename render passes for clarity
In very old OpenEXR version there was a limit on the channel names, which meant
the pass names needed to be short like "DiffDir". Change them to be longer like
"Diffuse Direct".

* This breaks forward compatibility. Old Blender version will lose links when
  reading compositing node setups with such passes, but #146571 will fix it
  for 4.5 LTS.
* Add-ons, scripts and compositing setups in other applications that rely on these
  names will also break.
* The find_by_type function for render passes has also been removed, as this was
  already deprecated and replaced by find_by_name.
* We assume spaces in the name are ok, since we have passes with them already
  and have not seen reports about compatibility issues.

Pull Request: https://projects.blender.org/blender/blender/pulls/142731
2025-09-25 18:04:14 +02:00
quackarooni
2a1a658492 Nodes: Swap Node Operator
Implement a native method to swap between different node and zone types.

This implementation repurposes the existing menu definitions as base
classes, from which both an "Add" and a "Swap" version would be generated
from. This allows both menus to have the same layout, but use their own
operators for handling the different node/zone types.

In this PR, support for all node editors has been implemented.

Invoking the menu is currently bound to `Shift + S`, same as the old
implementation in Node Wrangler. Since "Swap" is implemented as a
regular menu, features that menus already have such as type-to-search
and adding to Quick Favorites don't require any extra caveats to
consider.

Resolves #133452

Pull Request: https://projects.blender.org/blender/blender/pulls/143997
2025-09-25 16:12:02 +02:00
Damien Picard
da92614fd2 Fix: Node Wrangler: Error in Merge Nodes when only one node selected
Running Node Wrangler's Merge Nodes operator on only one node
resulted in an error. It was introduced in commit db39daf9e7.

That commit assumed that `l[len(l)-2]` and `l[-2]` were the same, but
they are not when `len(l) == 1`. In that case, the former is valid but
the latter is not.

This commit fixes the error by checking how many nodes are selected.

Pull Request: https://projects.blender.org/blender/blender/pulls/146361
2025-09-25 14:52:47 +02:00
Sybren A. Stüvel
e1b6cc2404 Anim: imported action slot named "Slot" when importing BVH/FBX files
Always name the imported action slot "Slot" when importing BVH and FBX
files, for ease of switching between imported Actions.

Note: this is only adjusting the old Python-based FBX importer.

Previously the slot would be named after the file itself (BVH) or had a
combination of the animated object, the animation "stack", and the
animation "layer" (FBX). This meant  that every imported animation would
get another slot name, making Action switching tedious.

Pull Request: https://projects.blender.org/blender/blender/pulls/146601
2025-09-23 15:19:55 +02:00
Julien Duroure
9f3770b949 Fix #142867 - glTF importer: Fix crash trying to import an empty glTF scene 2025-09-21 11:26:48 +02:00
Habib Gahbiche
1b4daf9d2e Nodes: remove "Use Nodes" in Shader Editor for Object Materials
"Use Nodes" was removed in the compositor to simplify the compositing
workflow. This introduced a slight inconsistency with the Shader Node
Editor.

This PR removes "Use Nodes" for object materials.

For Line Style, no changes are planned (not sure how to preserve
compatibility yet).
This simplifies the state of objects; either they have a material or
they don't.

Backward compatibility:
- If Use Nodes is turned Off, new nodes are added to the node tree to
simulate the same material:
- DNA: Only `use_nodes` is marked deprecated
- Python API:
  - `material.use_nodes` is marked deprecated and will be removed in
6.0. Reading it always returns `True` and setting it has no effect.
  - `material.diffuse_color`, `material.specular` etc.. Are not used by
EEVEE anymore but are kept because they are used by Workbench.

Forward compatibility:
Always enable 'Use Nodes' when writing blend files.

Known Issues:
Some UI tests are failing on macOS

Pull Request: https://projects.blender.org/blender/blender/pulls/141278
2025-09-14 17:53:54 +02:00
Damien Picard
ddbc6ed858 I18n: Allow translation of some messages using string formatting
- Add `iface_` translation functions and `translate=False` to a few UI
  elements.
- Add `rpt_` translation functions to a few reports.
2025-09-12 18:30:56 +02:00
luz paz
072f956ce0 Cleanup: Fix typos in scripts subdirectory
Fix spellings from comment and string
Found via codespell

Pull Request: https://projects.blender.org/blender/blender/pulls/145834
2025-09-11 11:29:06 +02:00
Ido-Shahar
1df4aa4e11 Nodes: Node Wrangler: Support for string sockets in merge operator
Added support for string sockets in `nw_merge_nodes`, results in
creating "Join Strings" node. Note that the code is slightly different
from most socket types since String Join has a multi-input socket,
but the behaviour is pretty much identical to Geometry sockets with
Join Geometry.

Pull Request: https://projects.blender.org/blender/blender/pulls/145507
2025-09-04 17:01:20 +02:00
quackarooni
0545fba54f Nodes: Node Wrangler: Use socket icons for Lazy Connect menu
Replace the icons for the "From Socket" and "To Socket" pop-up menus from
`RADIOBUT_OFF` and `FORWARD`, to each socket type's corresponding icon.
This makes it easier to pick out sockets in longer lists, as they could now be
distinguished by their color.

Video and images in PR

Pull Request: https://projects.blender.org/blender/blender/pulls/145648
2025-09-03 13:07:49 +02:00
Julien Duroure
6f8978c71a Fix #144980 - glTF - Fix importing empty glTF files, without nodes or scenes 2025-09-02 17:19:37 +02:00
Demeter Dzadik
eb4c22c0a4 Copy Global Transforms: SKIP_SAVE on paste
Add the `SKIP_SAVE` option to the 'Paste Global Transform' operator
properties.

This fixes a bug with following repro steps:
- Specify a relative object
- Use relative copy/paste
- Try to use non-relative copy/paste
- It will fail because after you used the relative paste operator, the
  `use_relative` property is saved for ever as True.

Pull Request: https://projects.blender.org/blender/blender/pulls/145262
2025-09-01 15:21:09 +02:00
Julien Duroure
a2614464e5 glTF importer: add comment after recent changes 2025-08-29 16:45:45 +02:00