Changes to recent commit [0].
- Replace poll_message_set with report in the execute function.
- Remove f-string use which violates string formatting convention.
- Remove unnecessary string to bool.
[0]: ee38a7b723f8f12b695ae30ba300ecc93f29fe76
Add a new "Save" to the Themes list in Preferences to save (overwrite)
custom themes. The operator has a poll function to disable for built-in
themes. Shows a confirmation when overwriting.
Pull Request: https://projects.blender.org/blender/blender/pulls/119491
Use File Handlers to handle file drag-n-drop in the View 3d. Drop-boxes
still remain since they handle Texture ID drag-n-drop.
This will add-ons to handle drag-n-drop for images and movies while
still providing access to Blender's native support since File Handlers
let users choose which to invoke if there's multiple configured.
Pull Request: https://projects.blender.org/blender/blender/pulls/117728
Don't assume armature of active object is what is displayed in the properties editor, both in C++ and Python code.
Object pointer was left out from some notifiers, as this means only that object was changed. But an armature datablock can be shared by multiple objects.
Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/119663
The last good commit was f57e4c5b98c075f3dfc61faebbcb43c99a778956.
After this one more fix was committed, this one is preserved as well:
67bd678887d7f8aec9f3b23bbf1aaf29f80d0da4.
With some data-type conversions we can do a best-effort conversion of
UI data like default values and min and max to the new data type.
This can help to make Python scripts simpler and to avoid bugs like
#105965.
Pull Request: https://projects.blender.org/blender/blender/pulls/106161
Use `context.pose_object` when baking a pose, on on top of the objects
in `context.selected_editable_objects`. When in pose mode, it's expected
that the pose of the active will be baked, regardless of whether the
pose object is selected itself.
Pull Request: https://projects.blender.org/blender/blender/pulls/119317
As part of #118623, we discovered that the operator used for adding images in the 3D viewport was not the same when drag and dropping as when adding it from the add menu. This lead to different and potentially confusing behaviour for the user when they use both.
This patch removes the python operator and unifies the functionality into one operator. It also renames the operator to be in line with the other "Add X" object operators.
Pull Request: https://projects.blender.org/blender/blender/pulls/118973
Various fixes to operator preset cleanup:
- Only remove properties that match exactly the properties to exclude
exactly (taking word boundaries into account).
- When the preset path doesn't exist, don't construct paths relative
to the working directory.
- Enforce UTF8 encoded text.
Other minor changes:
- Rename "properties" to "properties_exclude" for clarity.
- Use single underscore for private methods.
- Match each line against a single regex instead of constructing a
string and checking startswith(..) for every property to exclude.
- Use os instead of pathlib, as us used in blender's built in operators
that handle paths.
- Prefer doc-string over bl_description.
- Double quote strings.
- Use single indentation for lists to reduce right-shift.
Ideally the operator itself should be renamed, but I went the conservative approach
since themes are not supported yet. Once they are supported I suppose the operators
could be unified.
Currently, internal I/O operators can be invoked with drag-n-drop path
data, and when this happens a quick popup menu is shown to customize
import settings.
If these operators support operator presets, using a preset can
override path data given by drag-n-drop, and that can be unwanted
behavior.
While this can be fixed by setting path properties to SKIP_SAVE, doing
this would make these properties also to stop using ghost values. These
ghost values are used by the file select window to open operator last
import directory, and using this flag makes the file select windows
always open the home directory.
To fix that, add an explicit flag PROP_SKIP_PRESET that skips properties
writing to presets. Also clarify that PROP_HIDDEN and PROP_SKIP_SAVE
also avoid writing to presets.
Added a operator that can clean operator's specific property presets.
Importing presets from previous versions runs an automatic cleanup.
Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/117673
Extract:
- Operators' poll messages, including Python-defined ones.
- Use default translation context for the region toggle pie menu.
- Newly created F-Curve modifiers.
- Newly created video tracker track.
- Grease Pencil UV area status message
- Status messages in the graph slider operators.
- Status message "Text <text.py>" when opening .blend with
auto-executing Python file.
Disambiguate:
- Track: can mean NLA track, video tracking, a tracking marker, or
a track constraint.
- Tracking: can mean video tracking, or a track constraint.
Issue reported by Gabriel Gazzán.
Pull Request: https://projects.blender.org/blender/blender/pulls/117855
- "can not" -> "cannot" in many places (ambiguous, also see
Writing Style guide).
- "Bezier" -> "Bézier": proper spelling of the eponym.
- Tool keymaps: make "Uv" all caps.
- "FFMPEG" -> "FFmpeg" (official spelling)
- Use MULTIPLICATION SIGN U+00D7 instead of MULTIPLICATION X U+2715.
- "LClick" -> "LMB", "RClick" -> "RMB": this convention is used
everywhere else.
- "Save rendered the image..." -> "Save the rendered image...": typo.
- "Preserve Current retiming": title case for property.
- Bend status message: punctuation.
- "... class used to define the panel" -> "header": copy-paste error.
- "... class used to define the menu" -> "asset": copy-paste error.
- "Lights user to display objects..." -> "Lights used...": typo.
- "-setaudio require one argument" -> "requires": typo.
Some issues reported by Joan Pujolar and Tamar Mebonia.
Pull Request: https://projects.blender.org/blender/blender/pulls/117856
- Rename info to bl_info, to avoid confusion with extensions manifest,
which should eventually be accessible in a similar way.
- Rename module_name to addon_module_name to avoid confusion with
extension repositories name-spaced modules.
- Clarify naming for TOML manifest.
One error that occurs when packaging a multi-file addon into a ZIP is
zipping the contents of the addon, instead of the addon directory.
When installing the ZIP using addon_install, the files that should be
inside a directory instead get extracted into the top-level of the
script directory. There was also no user feedback about what went wrong.
Detect this case and fail with an error.
Ref: !117664
This patch adds support for _Menu Switch_ nodes and enum definitions in
node trees more generally. The design is based on the outcome of the
[2022 Nodes Workshop](https://code.blender.org/2022/11/geometry-nodes-workshop-2022/#menu-switch).
The _Menu Switch_ node is an advanced version of the _Switch_ node which
has a customizable **menu input socket** instead of a simple boolean.
The _items_ of this menu are owned by the node itself. Each item has a
name and description and unique identifier that is used internally. A
menu _socket_ represents a concrete value out of the list of items.
To enable selection of an enum value for unconnected sockets the menu is
presented as a dropdown list like built-in enums. When the socket is
connected a shared pointer to the enum definition is propagated along
links and stored in socket default values. This allows node groups to
expose a menu from an internal menu switch as a parameter. The enum
definition is a runtime copy of the enum items in DNA that allows
sharing.
A menu socket can have multiple connections, which can lead to
ambiguity. If two or more different menu source nodes are connected to a
socket it gets marked as _undefined_. Any connection to an undefined
menu socket is invalid as a hint to users that there is a problem. A
warning/error is also shown on nodes with undefined menu sockets.
At runtime the value of a menu socket is the simple integer identifier.
This can also be a field in geometry nodes. The identifier is unique
within each enum definition, and it is persistent even when items are
added, removed, or changed. Changing the name of an item does not affect
the internal identifier, so users can rename enum items without breaking
existing input values. This also persists if, for example, a linked node
group is temporarily unavailable.
Pull Request: https://projects.blender.org/blender/blender/pulls/113445
Add an operator to remove all unused bone collections. This is added to
the bone collections "specials" menu and the tree view context menu.
A bone collection is considered "unused" when it has no bones assigned,
and also no child collection that has bones assigned.
It is very common for graphical editors with layers to support
locking individual layers to protect them from accidental edits due
to misclicks. Blender itself already supports locking vertex groups.
This adds lock toggles for shape keys, with lock/unlock all operators.
The flags are checked by sculpt brushes, edit mode transform tools,
and Smooth, Propagate and Blend From Shape operators. This selection
aims to cover operations that only deform the mesh, where the shape
key selection matters.
Topology changing operations always apply to all keys, and thus
incorrect shape key selection is less impactful. Excluding them
from the new feature greatly reduces the patch size.
Pull Request: https://projects.blender.org/blender/blender/pulls/104463
The previous commit introduced a new `RPT_()` macro to translate
strings which are not tooltips or regular interface elements, but
longer reports or statuses.
This commit uses the new macro to translate many strings all over the
UI.
Most of it is a simple replace from `TIP_()` or `IFACE_()` to
`RPT_()`, but there are some additional changes:
- A few translations inside `BKE_report()` are removed altogether
because they are already handled by the translation system.
- Messages inside `UI_but_disable()` are no longer translated
manually, but they are handled by a new regex in the translation
system.
Pull Request: https://projects.blender.org/blender/blender/pulls/116804
Pull Request: https://projects.blender.org/blender/blender/pulls/116804
Replaces this search by representing the 3 edge lengths of each triangle
as 3d points and searching with a KD-tree.
On a mesh with ~20k Tris the old method runs in 40s while the new method
takes 0.23s with a difference of <0.001%.
Ref !113720