- Add `type[]` for the `tool_cls` as it's expecting tool type class,
not the instance (similar to #132420)
- Add `set[str]` to `after` type as it's seems to be the way it's used
the most widely, e.g. in "UI Tool Simple" example that comes with Blender:
`bpy.utils.register_tool(MyTool, after={"builtin.scale_cage"}, separator=True, group=True)`
Pull Request: https://projects.blender.org/blender/blender/pulls/133975
Rename `ActionKeyframeStrip.channels()` to `.channelbag()`, and change
its first parameter from `slot_handle` to `slot`.
This is to be consistent with `ActionKeyframeStrip.channelbags`, which is
the array of channelbags in the keyframe strip. Having a function that's
singluar makes sense for finding a single element in the array.
The change from using the slot handle to using the slot is to be consistent
with `.channelbags.new(slot)`. Furthermore, the Python API should be using
slot handles as little as possible (they're basically meaningless numbers).
Using the slots directly is preferred. If that's not possible, it is
recommended to use the slot identifier (`slot.identifier`) instead, as that
can be used to look up the slot (`action.slots[slot_identifier]`).
This breaks the glTF add-on, which will be fixed in !133915.
Pull Request: https://projects.blender.org/blender/blender/pulls/133868
When calling bpy.utils.expose_bundled_modules(), these modules are
added to sys.path.
This provides a solution/workaround to two problems:
* Using bpy together with packages like usd-core is problematic. Besides
crashing due to C++ symbol conflicts, it's just impossible to import
different versions of the same module, or to have distinct environment
variables for both. (#127132)
* Blender add-ons using these VFX modules do not currently work with
the bpy module.
This adds about 15MB to the bpy package.
Pull Request: https://projects.blender.org/blender/blender/pulls/133082
Support differentiating between portable & system installations,
useful to properly locate relative paths which would not work
on system installations.
Ref !133143
* BLENDER_SYSTEM_SCRIPTS support for multiple script paths, separated by
; on Windows and : on other platforms.
* New BLENDER_CUSTOM_SPLASH to replace the splash screen image.
* New BLENDER_CUSTOM_SPLASH_BANNER to overlay an image on the splash.
Contributed by Sony Interactive Entertainment: https://github.com/PlayStation-OpenSource
Capitalize the default filename used for .blend files and other savable
and exportable file formats (like images, 3D formats, etc.) from
"untitled" to "Untitled".
Pull Request: https://projects.blender.org/blender/blender/pulls/132424
This is leading to "'super' object has no attribute '__del__'" errors
in some situations. As explained in #132476 this is only for future
proofing, so don't do it yet.
This reverts commit f301952b6a.
According to the Python API release notes, this is required now along
with super().__init__() which was already done.
Also fixes mistake in example in API docs.
Pull Request: https://projects.blender.org/blender/blender/pulls/132476
Operators keep being a pain... This time, the fact that unregistered
operators are not removed from `bpyt.type.Operator` subclasses list
breaks workflow to generate translations info for a specific add-on
(since it relies on differences between UI messages extracted when this
add-on is enabled, and when it is disabled).
Suppress unused warnings using the "vulture" utility.
- Include public definitions in the modules `__all__`.
- Mark arguments & variables as unused with a "_" prefix.
`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
The "X" button to delete a keymap entry is too close to the scrollbar,
potentially leading to misclicks that would delete data.
Add margin to the right of the buttons to prevent this.
The X button is now aligned when the box is open/closed.
Pull Request: https://projects.blender.org/blender/blender/pulls/130349
addon_utils.enable/disable now handle wheels so that the functions can
be used with extension add-ons.
A new argument `refresh_handled` supports scripts handing refresh
themselves which is needed to avoid refreshing many times in cases
when there are multiple calls to enable/disable.
This is mostly useful for internal operations.
Adds the current GPU backend to the `Help -> Report a bug` script
when using the OpenGL or Vulkan backend. This makes it easier for
triagers to figure out if a user is using OpenGL or Vulkan
in cases the user doesn't explictly state which they're using.
Pull Request: https://projects.blender.org/blender/blender/pulls/130006