Commit Graph

111 Commits

Author SHA1 Message Date
Damien Picard
58b8ae1717 UI: Fix a few typos
- "Acion Slot" -> "Action": typo.
- "Specifies the input node used the created zone" -> "by the created
  zone": typo.
- "No reference available {!r}, Update..." -> "update": lower case.
- "uninitialized file-list" -> "Uninitialized": sentence case.

Some issues reported by Alexandr Fatih.

Pull Request: https://projects.blender.org/blender/blender/pulls/148265
2025-10-17 16:13:30 +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
Campbell Barton
8269e17186 Cleanup: defer import of anim_utils 2025-10-01 23:22:43 +00:00
Sybren A. Stüvel
acde9be6fd Fix: correctly update Actions when renaming/re-typing a custom property
Fix: correctly update Actions when renaming/re-typing a custom property

When renaming a custom property on a data-block, only update the
animation in a slot for that data-block. Previously all F-Curves were
updated, even when they were meant for other data-blocks.

This also handles the cases where the type of a custom property is
changed, and not just its name.

This is part of #146586

Pull Request: https://projects.blender.org/blender/blender/pulls/146979
2025-09-30 10:23:20 +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
Casey Bianco-Davis
f8d2a3af38 Python: Rename bpy.types.GreasePencilv3 to bpy.types.GreasePencil
This renames python Grease Pencil type
from `bpy.types.GreasePencilv3` to `bpy.types.GreasePencil`.

Part of #125058.

Pull Request: https://projects.blender.org/blender/blender/pulls/146902
2025-09-29 12:25:23 +02:00
Jacques Lucke
fa03d2558c UI: support searching for more recent files
When trying to find and open an older file, it is annoying when it is not in the
recent files list anymore. This patch increases the length of the recent files
list, without making the menu huge by making better use of menu-search.

Specifically the following is changed: * Number of remembered recent files is
increased from 20 to 200 by default. * The recent files menu is limited to 20
entries. * When activating menu search (by pressing space when in the menu), all
available recent files can be searched. * There is a new "More..." menu entry at
the bottom, which also activates the menu search.

Pull Request: https://projects.blender.org/blender/blender/pulls/146884
2025-09-28 20:22:02 +02:00
Pablo Vazquez
06b13c8fb4 UI: Splash: Adjust layout and add icons
Small layout and links adjustments to the splash screen.

- Extend list of templates to fit the new Storyboarding template.
- Extend the list of recent files by one row, so it matches templates.
- Add icons to templates.
- Rename `Donate` to `Donate to Blender`.
- Move donate link down so it's more prominent.
- Make separator visible.
- Add "Get Involved" link.
- Remove "Tutorials" link. The Support link already provides help, and
it's been a while since we no longer promote tutorials on blender.org.

See PR for details and screenshots.

Pull Request: https://projects.blender.org/blender/blender/pulls/146730
2025-09-26 00:45:10 +02:00
Alex Zhornyak
7a4f8ffc17 Fix #121408: "Online Manual" button doesn't work with add-on preferences
Resolve the situation when addon preferences classes which are
inherited from bpy.types.AddonPreferences are not recognized in
online-manual context help

Ref !145799
2025-09-06 09:55:55 +10:00
Julian Eisel
3c3c01a67c UI: Gray out or hide asset shelf toggle if not available
The "Asset Shelf" checkbox can be confusing for people, they enable it
but it still can't get the shelf to show up. This is because the shelf
is only available in certain contexts (e.g. pose mode and paint modes
in the 3D view, more is planned see blender/blender#135061). Gray out
the toggle with a disabled hint when not available.

The region toggle pie menus will hide the item.

Pull Request: https://projects.blender.org/blender/blender/pulls/113063
2025-08-13 11:38:11 +02:00
Sean Kim
b2140771ea Fix #142706: Batch Rename doesn't work
Caused by 20383e4d82

Additionally, this updates the operator to use the correct object type,
so that the functionality works with new Grease Pencil IDs.

Pull Request: https://projects.blender.org/blender/blender/pulls/142742
2025-07-22 17:41:21 +02:00
Campbell Barton
19ee3932c3 Fix #141948: No error on arbitrary assignments to PropertyGroup
Declare `__slots__` to prevent arbitrary assignment.
2025-07-16 17:44:06 +10:00
Hans Goudey
91803e130f Cleanup: Grammar: Fix uses of "for e.g."
e.g. stands for "exempli gratia" in Latin which means "for example".
The best way to make sure it makes sense when writing is to just expand
it to "for example". In these cases where the text was "for e.g.", that
leaves us with "for for example" which makes no sense. This commit fixes
all 110 cases, mostly just just replacing the words with "for example",
but also restructuring the text a bit more in a few cases, mostly by
moving "e.g." to the beginning of a list in parentheses.

Pull Request: https://projects.blender.org/blender/blender/pulls/139596
2025-05-29 21:21:18 +02:00
Hans Goudey
99c87fbf18 Fix #137299: Exception with batch rename of nodes outside node editor
I'm not sure when this stopped working. The function in question is
quite confusing since it's called twice with two different purposes.
Fixing the exception is simple though. Just checking the data type
for "None" prevents changing the data type to one that's invalid given
the context. I didn't find a simple way to add an error message though.

Pull Request: https://projects.blender.org/blender/blender/pulls/138287
2025-05-02 15:17:23 +02:00
Campbell Barton
8ccdea1934 Cleanup: typos & references to variable names from recent refactor 2025-04-24 02:43:52 +00:00
Campbell Barton
9de0aa1066 Fix: #133486: 'use_region_toggle_pie' AssertionError in MovieClipEditor 2025-04-22 11:25:14 +00:00
Campbell Barton
5e2b421996 WM: support the "Hyper" modifier key on Linux
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
2025-03-26 10:39:55 +11:00
Philipp Oeser
138ede7194 Fix #134092: Keymap Editor can add an extra . to the end of an attribute
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
2025-02-26 09:12:28 +01:00
Pablo Vazquez
e2e992a425 UI: Add icons to Batch Rename data type menu
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
2025-01-21 11:31:24 +01:00
Falk David
b9f253564e VSE: Python API: Deprecate sequence properties and replace with new ones
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
2025-01-21 11:30:20 +01:00
Campbell Barton
be0c9174aa Cleanup: argument wrapping for Python scripts
- 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.
2025-01-14 12:53:32 +11:00
Damien Picard
ec9c7ba465 I18n: Disambiguate "Spaces"
"Spaces" as a character in a text, not a Blender UI element.

Issue reported by Hoang Duy Tran.
2025-01-13 12:40:45 +01:00
Damien Picard
c3d071e469 I18n: Disambiguate "Power"
- 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.
2025-01-13 12:40:45 +01:00
Damien Picard
466af92f7a I18n: Disambiguate "Light"
"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.
2025-01-13 12:40:45 +01:00
Campbell Barton
6ac52551d3 Cleanup: edit comments to avoid confusion type-checking commands
These comments caused vulture to fail.
2025-01-06 16:27:27 +11:00
Campbell Barton
38a76db083 UI: remove redundant undo pushes for menu operators
Operators that trigger menus should not enable UNDO.

Resolves #95906

Ref !131467
2024-12-07 00:41:36 +11:00
Campbell Barton
41ec8a6d44 Fix errors calling tool set operators without a space
This check was added [0] but only for WM_OT_tool_set_by_brush_type.

[0]: 7cbc94d835
2024-11-04 11:55:39 +11:00
Campbell Barton
7cbc94d835 Fix some exceptions in Python operators when poll fails 2024-10-31 18:50:03 +11:00
Sybren A. Stüvel
a564e678f0 Fix #128797: Custom property Data-Block Type only has Object ID Type
In the WindowManager code, use `bpy.types.ID.id_type` enum property to
get all valid ID types, instead of using a property on the `Action`
type.

Pull Request: https://projects.blender.org/blender/blender/pulls/128834
2024-10-10 14:33:31 +02:00
Bastien Montagne
e2705a432a Fix #128767: Regression: Batch Rename failed to rename bones.
Regression from 8c3a3bb9a3, did not realize all items were not
necessarily actual IDs.
2024-10-09 15:57:19 +02:00
Campbell Barton
dadb9ba5dc Cleanup: script formatting 2024-10-02 15:42:46 +10:00
Harley Acheson
8d0fc95fb6 Cleanup: Make format
Just the result of running Make Format
2024-10-01 12:17:43 -07:00
Julian Eisel
33b670a65d Sculpt/Paint: Automatically switch tools when activating brushes
As discussed in #128066, we want that activating a brush makes sure the
most appropriate tool is activated. For example activating an eraser
brush should activate an eraser tool, if available. This makes the
tool and brush binding two ways, which is more clear. Plus it means that
users don't have to care about tools at all if they don't want to, they
can just keep switching brushes and Blender takes care of the tool.

Implementation wise, this works by letting a Python operator lookup a
tool for a given brush type name, when activating a brush.

Design Task: https://projects.blender.org/blender/blender/issues/128066
2024-10-01 18:21:15 +02:00
Campbell Barton
a7ab81d927 PyAPI: remove use of BaseException
BaseException was used as a catch-all in situations where it
didn't make sense and where "Exception" is more appropriate
based on Python's documentation & error checking tools,
`pylint` warns `broad-exception-caught` for e.g.

BaseException includes SystemExit, KeyboardInterrupt & GeneratorExit,
so unless the intention is to catch calls to `sys.exit(..)`,
breaking a out of a loop using Ctrl-C or generator-exit,
then it shouldn't be used.

Even then, it's preferable to catch those exceptions explicitly.
2024-10-01 13:18:46 +10:00
Bastien Montagne
8c3a3bb9a3 Fix #128006: Liboverride objects can be renamed using batch rename.
Do not allow renaming liboverride IDs from batch-rename either.

Users who really want to rename liboverrides should use python/RNA API
instead, this should not be exposed to standard UI tools (as renaming
liboverride IDs can lead to quite some confusing setups).
2024-09-23 15:45:02 +02:00
Red-Andringa
8345ebc704 Fix batch renaming object data from the outliner
Correct typo is_editabe > is_editable.

Ref: !127675
2024-09-16 19:20:18 +10:00
Campbell Barton
97179b10fb Refactor: make "sys_info" an internal module, rename for clarity
- Move sys_info into an internal module to avoid having so many
  top level modules for Blender's internal functionality.
- Rename system_info sub-modules that pre-fill URL's for clarity.
- Move top-level exception handling into the operator.
- Report an error if an unexpected exception occurs.
- Use `Exception` instead of `BaseException` as there is no reason to
  catch the additional exceptions.
- Remove use of sys_info from the command line example,
  replace with in-lined system info.
2024-09-06 11:11:26 +10:00
Alaska
3196ef1636 Add a script to collect system information when Blender isn't opening
This commit adds a python script that can collect some of the
information necessary to fill out a bug report.

The primary use case is to help users collect system information for
a bug report in the case that Blender can't open.

CMD and sh files are included to help users use the Python script.

Ref !122191
2024-09-03 13:26:54 +10:00
Campbell Barton
8a7ff41a85 Cleanup: wrap long lines in Python scripts 2024-08-19 10:48:07 +10:00
YimingWu
4f4add5406 Fix #125426: Update paths in animation when renaming IDProperty
Previously when renaming an IDProperty the existing paths in the
animation/driver system isn't updated, this leads to missing animation
after renaming the property. Now `BKE_animdata_fix_paths_rename_all`
will be called so the animation system records the updated name.

Pull Request: https://projects.blender.org/blender/blender/pulls/125474
2024-08-15 13:56:17 +02:00
Julian Eisel
0baeca8f9e Fix #123735: Tooltip missing from open URL preset operator
Necessary because the "type" property is no longer the default
`bl_property` since 7bc34283ea.
2024-07-25 12:28:50 +02:00
Campbell Barton
4cf9f53946 Cleanup: remove unused BUG_ADDON URL preset 2024-07-24 13:35:41 +10:00
Damien Picard
6a52c76a65 I18n: Translate messages in extensions, operator descriptions, Node Wrangler
- Operator descriptions use tip_() since they will be displayed in
  tooltips.

- Extension messages:
  - Split "(Add-on|Theme) \"{:s}\" already installed!" into two
    messages.
  - Use rpt_() to translate error messages.

- Restore core add-on name and description translation.

- Use DATA_ to translate paint material slot name, so that translation
  happens only if the user enabled it for user-created data.

- Node Wrangler contains functions used to build operators' poll
  methods. This change allows them to be properly translated by using
  str.format() instead of f-strings, and explicit extraction with
  tip_().

Pull Request: https://projects.blender.org/blender/blender/pulls/123795
2024-07-04 10:49:52 +02:00
Dalai Felinto
dd7cc11796 Extensions: Link to visit the extensions platform 2024-06-25 15:13:50 +02:00
Dalai Felinto
33a7cf8c49 Translations: blender.org should not be translatable 2024-06-25 15:13:50 +02:00
Damien Picard
f87d4e4e40 I18n: Extract and disambiguate a few messages
Extract
- Cycles denoiser enum.
- Extensions user preferences UI.
- Node operator poll message from new node function.

Improve
- Split "(Enabled|Disabled) on startup, overriding the preference."
into two messages.

Disambiguate
- "Add" when describing the action of adding something should use the
  Operator context.
- "Dimensions", in noise textures.
- "Transform" as a noun, the matrix transform type of Geometry Nodes,
  as opposed to the verb to move things in space.
- "Parent" as a noun or verb (the parent of an object, to parent an
  object to another).

Some issues reported by Satoshi Yamasaki, deathblood, and Gabriel Gazzán.

Pull Request: https://projects.blender.org/blender/blender/pulls/122969
2024-06-13 12:15:55 +02:00
Damien Picard
602b26f461 I18n: Disambiguate messages from custom properties
These messages are part of enum items not directly used by their
EnumProperty, because they are returned by a function. They cannot be
accessed in RNA at all times, and need to be extracted manually.
2024-06-11 15:09:09 +02:00
Campbell Barton
949dfbfaa8 Cleanup: Python script formatting
- Double quotes for strings.
- Trailing commas when wrapped lines.
2024-06-06 11:26:28 +10:00
Dalai Felinto
40b882437e Extensions: Use the INTERNET_OFFLINE icon for the offline mode message 2024-05-31 13:07:41 +02:00
Campbell Barton
43a47f39f9 UI: always show text on the splash when running in offline mode
see #119521
2024-05-31 18:47:15 +10:00