- The "location" and "warning" fields in bl_info are no longer exposed
in the interface, so there is no need to extract them any more.
- Some add-ons do not define a description (Copy Global Transform for
example), so they should be skipped.
- Some third-party legacy add-ons do not use the 'support' field, and
that can cause an error in extraction. Since this won't happen
for built-in add-ons, checking that an add-on is built-in is enough.
Pull Request: https://projects.blender.org/blender/blender/pulls/122970
All add-ons were being scanned at startup, while this didn't cause
errors it was noticeable with extensions where any errors in the
manifest were being reported at startup, even when running with
factory-startup (including blender's own tests).
Address two issues:
- The logic to "reset" add-ons, so as to match the preferences when
reverting or resetting preferences always ran on startup.
This occurred because a check for Python being initialized was
incorrectly used to detect that this wasn't the first time preferences
were being loaded (regression in [0]).
- Resetting add-ons scanned all add-ons (including disabled add-ons) to
ensure their module cache is up to date. Since this the cache is
lazily initialized, it's simpler to set it as uninitialized as
resetting the add-ons doesn't require the cached meta-data.
[0]: 497bc4d19977abc7b9e2c0f5024a23057e680954
autopep8_format_paths.py was never wired up in the windows tooling,
this PR wires it up, to get around a 8191 limitation for command
lines on windows an alternative "--no-subprocess" option has been
introduced to call the pep8 module directly from python.
TODO: A subprocess is still used for getting the version information
Contributors:
- @campbellbarton fixes to autopep8_format_paths.py to support
the -no-subprocess option.
Pull Request: https://projects.blender.org/blender/blender/pulls/120794
Originally this would replace scripts that come bundled with Blender,
but it's unclear how this is useful.
Searching for this online mainly leads to people asking how they can
use it to add scripts. For example in a studio environment you might
want to deploy add-ons and startup scripts for all users.
Even if you wanted to use it for replacement though, it wasn't really
doing that and inconsistent for different types of scripts:
* startup: ignored
* modules: replaces bundled scripts
* presets: adds to bundled scripts
* addons (in 4.1): ignored
* addons_core (in 4.2): ignored
* startup/bl_app_templates_system: replaces bundled scripts
This change makes it add scripts from this path for all. This is a
breaking change, though arguably this feature was just broken to
begin with and not used much in practice because of that.
The alternative would be add a new set of environment variables to
avoid breaking existing behavior. But that also means keeping around the
broken behavior or fixing it in another way.
Supporting multiple paths may be used too, but for now just support
a single one as doing this for all BLENDER_SYSTEM variables is
non-trivial. The main use case for that would be add-ons anyway, and
those will mainly be handled through upcoming
BLENDER_SYSTEM_EXTENSIONS instead.
Ref #122512
Pull Request: https://projects.blender.org/blender/blender/pulls/122689
The translation extraction goes through each keyconfig preset file and
activates it in order to extract its messages. This change makes it
restore the original config, otherwise it would end up switching to
Industry Compatible.
Pull Request: https://projects.blender.org/blender/blender/pulls/122789
Using `bpy.types.OperatorProperties.__subclasses__()` has become utterly
unreliable now, to the point that it keeps references to freed (aka
unregistered) operators now, leading to crash when accessing them.
This commit refactors quite seriously the `dump_rna_messages` code, by
first listing all 'valid' classes, and then processing them all at once
in a flat iteration.
RNA classes are still generated from class hierarchy rooted on the
'virtual' `rna_struct` one, except for operators. These are now
generated by introspecting `bpy.ops` instead.
The extensions spec says this should use semantic version,
so it should always start with X.Y.Z numbers.
Co-authored-by: Campbell Barton <campbell@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/122687
- `bpy.types.Material.blend_method` aliases `bpy.types.Material.surface_render_method`.
'Opaque' and 'Alpha Clip' maps to deferred.
- Renamed `show_transparent_back` to `use_transparency_overlap`
- Renamed `use_screen_refraction` to `use_raytrace_refraction`
- Deprecate `use_sss_translucency` and `use_sss_translucency`
Related to: #113976
**NOTE**
The light probe changes will be done in a different patch.
Both patches should land just before we remove EEVEE Legacy
from the code-base.
Pull Request: https://projects.blender.org/blender/blender/pulls/122297
- Support passing in operator ID's using Python dot syntax.
- Support define operators that haven't yet been registered
matching Blender's own behavior.
Also add doc-string for bpy.types.Macro.define.
When a user has downloaded an add-on as a zip file, it's not clear in
advance if this is a legacy add-on or a new extension. So they would
have to use trial and error, or inspect the zip file contents.
This uses a simple heuristic to check if the file is a legacy add-on,
and if so automatically calls the legacy operator instead.
The operator now show both extension and legacy add-on properties,
with the latter in a default collapsed subpanel.
Pull Request: https://projects.blender.org/blender/blender/pulls/121926
Extract
- Add to Quick Favorites tooltip.
- "Mask", the name of a newly created mask (DATA_).
- "New" in the context of the new mask ID button.
- A few strings using BLI_STR_UTF8_ defines were not extracted.
Take the special characters out of the translation macros.
- "External" menu items from the filebrowser's Files context
menu (right-click on a file). These items were already extracted,
but not translated.
Improve
- Separate formatted error message "%s is not compatible with
["the specified", "any"] 'refresh' options" into two messages.
Disambiguate
- Use Action context for new F-modifiers' names. This is already used
for the "type" operator prop.
- Translate ImportHelper's default confirmation text using the
Operator context, as it uses the operator name which is extracted
with this context.
- "Scale" can be a noun, the scale of something, or a verb, to scale
something. The latter mostly uses the Operator context, so apply
this context to verbs, and the default contexts to nouns.
- "Scale Influence" can mean "Influence on Scale" (tracking
stabilization) and "to Scale the Influence" (dynamic paint canvas).
- "Object Line Art" as type of Line Art to add, as opposed to the
active object's Line Art settings.
- Float to Integer node: use NodeTree context for the node label, as
this is already extracted and used for the enum.
Do not translate
- Sequencer labels containing only a string formatting field.
Some issues reported by Gabriel Gazzán and Ye Gui.
Pull Request: https://projects.blender.org/blender/blender/pulls/122283
An extension's optional "tagline" field is equivalent to a legacy
add-on's "description". This allows exposing the tagline as a
description in `bl_info`.
The main goal of this change is to expose extension taglines to the
translations, since the legacy description was already extracted.
Pull Request: https://projects.blender.org/blender/blender/pulls/122327
Some UI elements (row and column) can define a heading text.
Optionally, this text can use a custom translation context specified
through `heading_text`. This changes allows extraction of those
headings using the appropriate context instead of the default one.
Pull Request: https://projects.blender.org/blender/blender/pulls/122326
Strings built by concatenating literals and pre-processor-defined
strings would lock the code extracting them for i18n forever.
This commit 'fixes' the issue by adding some support for these cases in
the `inbetween` regex snippet part of the 'extract string' complex regex
system, to avoid the lock.
The code has no way currently to extract the value of these defines
though, so they should not be used in translated strings.
NOTE: PR !122283 should do a propoer fix to these issues, by refactoring
the string building such that only actual strings pieces get processed
by the translation code.
- Allow versions from bl_info to be strings
Versions are now allowed to be strings in extensions using
blender_manifest.toml, so this commit prevents them from being badly
formatted on extraction to add-on translations.
- Do not export Blender copyright text to add-on translations
This text is only relevant for Blender and maybe core add-ons, not
for the general case.
- Copy comment lines from add-on .po files to .py translations
Without this comments added by translators could be lost since they
were not copied over to the Python files.
- Fix indentation in add-on translations
Some lines in the translation dict were off by a few spaces. This
resulted in linting tools complaining about the indentation.
- Do not escape messages in add-on translations multiple times
When extracting add-on messages, they would get escaped multiple
times, resulting in invalid strings when they contained quotes for
example.
This happened because on updating the messages from the ref
ones (those actually extracted from Blender), each ref I18nMessage
would be assigned to the corresponding language I18nMessage, without
copy. When this message was escaped, it happened once for every
language since they were actually the same object.
To avoid this, I18nMessage objects are copied when merging.
-----
Example tuple before PR:
```python
translations_tuple = (
(("*", ""),
((), ()),
("fr_FR", "Project-Id-Version: AnimAll 0...1.1...0 (0)\nReport-Msgid-Bugs-To: \nPOT-Creation-Date: 2024-05-26 17:10+0000\nPO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\nLast-Translator: FULL NAME <EMAIL@ADDRESS>\nLanguage-Team: LANGUAGE <LL@li.org>\nLanguage: __POT__\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit",
(False,
("Blender's translation file (po format).",
"Copyright (C) 2024 The Blender Authors.",
"This file is distributed under the same license as the Blender package.",
"FIRST AUTHOR <EMAIL@ADDRESS>, YEAR."))),
),
(("*", "\\"Location\\" and \\"Shape Key\\" are redundant?"),
(("extensions/user_default/animall/__init__.py:250",),
()),
("fr_FR", "",
(False, ())),
),
...
```
After:
```python
translations_tuple = (
(("*", ""),
((), ()),
("fr_FR", "Project-Id-Version: AnimAll 0.11.0 (0)\nReport-Msgid-Bugs-To: \nPOT-Creation-Date: 2024-05-26 17:06+0000\nPO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\nLast-Translator: FULL NAME <EMAIL@ADDRESS>\nLanguage-Team: LANGUAGE <LL@li.org>\nLanguage: __POT__\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit",
(False, ("FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.",))),
),
(("*", "\"Location\" and \"Shape Key\" are redundant?"),
(("extensions/user_default/animall/__init__.py:250",),
()),
("fr_FR", "",
(False, ())),
),
...
```
Pull Request: https://projects.blender.org/blender/blender/pulls/122273
The extensions system allows to extend Blender with connectivity to the internet. Right now it means Blender can
discover and install add-ons and themes directly from the internet, and notify users about their updates.
By default this is disabled (opt-in), and users can enable it the first time they try to install an extension or visit
the Prefences > Extensions tab. If this is enabled, Blender will automatically check for updates for
extensions.blender.org upon startup.
When will Blender access the remote repositories:
* Every time you open the Preferences → Extensions: ALL the enabled repositories get checked for the latest info (json)
* Every time you try to install by dragging: ALL the enabled repositories get checked for the latest info (json).
* Every time you start Blender: selected repositories get checked for the latest info (json).
------------------
From the Blender code point of view, this means that most of the add-ons and themes originally bundled with Blender
will now be available from the online platform, instead of bundled with Blender. The exception are add-ons which are
deemed core functionality which just happened to be written as Python add-ons.
Links:
* Original Extenesions Platform Announcement: https://code.blender.org/2022/10/blender-extensions-platform/
* Extensions website: https://extensions.blender.org/
* User Manual: https://docs.blender.org/manual/en/4.2/extensions/index.html#extensions-index
* Technical specifications: https://developer.blender.org/docs/features/extensions/
* Changes on add-ons bundling: https://devtalk.blender.org/t/changes-to-add-on-bundling-4-2-onwards/34593
------------------
This PR does the following:
* Move extensions out of experimental.
* No longer install `scripts/addons` & `scripts/addons_contrib`.
* Add `scripts/addons_core` to blender's repository.
These add-ons will still be bundled with Blender and will be always enabled in the future, with their preferences
moved to be more closely integrated with the rest of Blender. This will happen during the remaining bcon2 period.
For more details, see #121830
From scripts/addons:
* copy_global_transform.py
* hydra_storm
* io_anim_bvh
* io_curve_svg
* io_mesh_uv_layout
* io_scene_fbx
* io_scene_gltf2
* pose_library
* ui_translate
* viewport_vr_preview
Extra: bl_pkg (scripts/addons_contrib)
Note: The STL (legacy) add-on is going to be moved to the extensions platform. There is already a C++ version on core
which is enabled by default.
All the other add-ons are already available at extensions.blender.org. To use them you need to:
* Go to User Preferences > Extensions
* You will be greated with an "Online Extensions" message, click on "Enable Repository".
* Search the add-on you are looking for (e.g, Import Images as Planes).
* Click on Install
Over time their maintaince will be transferred over to the community so their development can carry on. If you used to
help maintain a bundled add-on please read: https://devtalk.blender.org/t/changes-to-add-on-bundling-4-2-onwards/34593
Ref: !121825
Implementation of the GPv2 Fill tool in Grease Pencil 3.
This tool creates new strokes where the user clicks, by rendering
strokes into an image and then performing flood-fill and boundary
search operations.
This is a minimal first part, several features of the GPv2 tool are
still missing (gap filling methods, smoothing, dilate/erode).
Co-authored-by: Falk David <falk@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/120693
Copy modules before filtering `addon_modules` to avoid
change of dictionnary size during iterations. Otherwise errors
can be triggerd when running `python -m pytest test.py` since
it may modify the module dict.
Co-authored-by: Alexis-19 <alexis-19@noreply.localhost>
Pull Request: https://projects.blender.org/blender/blender/pulls/121100
When keying custom properties that are defined by an addon,
you can't use square brackets. The GUI buttons already reflect that.
The baking code and the keyframe insertion code didn't respect
that and so were able to key properties that are defined as non-keyable.
## Solutions
I've solved the issue on the C++ side by resolving
the path twice, once without and in case that didn't work the
second time with brackets. While that does solve the issue
this feels really dirty and I feel like I am misusing the system here.
**However it is absolutely needed**.
When resolving a path with brackets to a property defined
by an addon, you get an `IDProperty` disguised as a `PropertyRNA`
which will not have the correct flags set.
By checking if a property `is_animatable` in python, all that do not have that can be skipped.
Also making sure the path is passed without brackets in the correct cases.
Pull Request: https://projects.blender.org/blender/blender/pulls/121520
It was meant to be included into the previous commit in the area,
but was forgotten due to some technicalities.
Also remove the DisplaceSimpleOperation, which is now not used.
Pull Request: https://projects.blender.org/blender/blender/pulls/121580
There are few issues with the logic and implementation of this option:
- While the first pass is faster in the terms of a wall-clock time, it
is often not giving usable results to artists, as the final look of
the result is so much different from what it is expected to be.
- It is not supported by the GPU compositor.
- It is based on some static rules based on the node type, rather than
on the apparent computational complexity.
The performance settings are planned to be moved to the RenderData, and
it is unideal to carry on such limited functionality to more places. There
are better approaches to quickly provide approximated results, which we can
look into later.
Pull Request: https://projects.blender.org/blender/blender/pulls/121558
Use __repr__ for formatting file instead of __str__ because non-standard
characters will be escaped and the string will be properly quoted.
Also, a modules __file__ is not *guaranteed* to be a string
(although it almost always is), nevertheless, __repr__ generally
results more more humanly readable results.
Note that __repr__ was already used to format __file__ in most places.
This PR implements the Cutter Tool for GPv3. The Cutter tool deletes
points in between intersecting strokes. New points are created at the
exact intersection points, so as a result the cutted strokes will fit
perfectly.
For feature parity, the tool follows the GPv2 behavior:
- The cutter tool works on all editable layers.
- Intersections are only detected for curves on the same layer,
so intersection of curves on _seperate_ layers are not handled.
Technical notes
The implementation uses the `compute_topology_change` function
created for the Hard Eraser. So at intersection points, point
attributes will be interpolated.
Pull Request: https://projects.blender.org/blender/blender/pulls/113953
Compute shaders are required since 4.0. There was one occasion where
an older AMD driver failed and support was turned off. This driver
is now marked unsupported.
This PR includes:
- removing the check in viewport compositing
- remove properties from system info
- always construct draw manager.
- remove unused pass logic in draw hair/curves
- add deprecation warning when accessed from python
Pull Request: https://projects.blender.org/blender/blender/pulls/120909
Adds the primitive tools in draw mode to GPv3.
This also adds rotation and scale sub-operators with `r` and `s` keybinds.
Also all control points are editable after extruding.
Pull Request: https://projects.blender.org/blender/blender/pulls/119039
Support freedesktop file association on Linux/Unix via the command line
arguments: `--register{-allusers}` `--unregister{-allusers}` as well
registration actions from the user preferences.
Once registered, the "Blender" application is available from launchers
and `*.blend` files are assoisated with the blender binary used for
registration.
The following operations are performed:
- Setup the desktop file.
- Setup the file association & make it default.
- Copy the icon.
- Setup the thumbnailer (`--register-allusers` only).
Notes:
- Registering/unregistering for all users manipulates files under
`/usr/local` and requires running Blender as root.
From the command line this can be done using `sudo`, e.g.
`sudo ./blender --register-allusers`.
From the GUI, the `pkexec` command is used.
- Recent versions of GNOME execute the thumbnailer in a restricted
environment (`bwrap`) requiring `blender-thumbnailer` to be copied
into `/usr/local/bin` (synlinks don't work).
So thumbnailing copies the binary rather than linking and only works
when registering for all users.
Ref !120283
Extract
- Statuses for the external text editor
- Newly created enum node item
- Newly created plane track data
- Newly created custom orientation data
- Operator names in drag and drop menu (need to use operator's
translation context)
- GN attribute statistic node inputs
Disambiguate
- Single-letter colors: A and B can mean Alpha and Blue, or simply A
and B as in two operands in an operation
- Dissolve: issue reported by Tamar Mebonia in #43295
- Translate in the User Preferences. This introduces a new
BLT_I18NCONTEXT_EDITOR_PREFERENCES ("Preferences") translation
context
- Planar (reported by deathblood)
This one is incomplete, because there is currently no way to
disambiguate presets or GN fields. I don't see how either could be
achieved cleanly.
The former would need to define the context inside the preset and
evaluate the file prior to showing it in the presets menu, which
sound bad.
The latter would need to introduce an additional string inside
`FieldInput`s, which would be controversial given how little it
would be used.
Remove
- Unused translation `iface_("%s")` in toolbar
- Remove obsolete N_() tags in a few node descriptions.
Pull Request: https://projects.blender.org/blender/blender/pulls/119065