Commit Graph

4148 Commits

Author SHA1 Message Date
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
Falk David
d7555b5064 Fix: Grease Pencil: UI: Wrong usage of contains operator
Introduced with 1fa2be8a9b.
This should have used `==` instrad of `in`.
2025-10-13 10:50:14 +02:00
Harley Acheson
6691529dcc Fix #147926: Incorrect Icon used for Generic Collection
We have icons that represent specific individual collections. like
Icon_Outliner_Collection for a default (uncolored) collection, and
Icon_Collection_color_x for ones with colors. For "collections" as a
general thing though we have icon_group. Sometimes we confuse the two,
for example the list of tabs to show in Properties uses a different
icon than the actual category icon. This PR fixes the complaint by
using the correct icon for each of these purposes.

Pull Request: https://projects.blender.org/blender/blender/pulls/147942
2025-10-13 01:26:16 +02:00
Damien Picard
a2f94ab1ad Fix #147062: OSL Camera: Aperture size depends on focal length
In OSL custom cameras, the current aperture size depends on the focal
length of the Blender camera, even though it is not usable by the
shader. This gives incoherent values to the depth of field.

To ignore this factor, this commit makes the custom camera behave the
same as the orthographic camera, by not being multiplied by the focal
length.

To compensate for that, the multiplication must happen inside the
shader. This adjustment was done in the advanced camera shader
template.

Pull Request: https://projects.blender.org/blender/blender/pulls/147346
2025-10-13 00:23:25 +02:00
John Kiril Swenson
99b9f6cafc Fix #147655: VSE: Sequencer scene datablock missing in combined view
UI code forgot to check for `SEQUENCER_PREVIEW` view type.
2025-10-13 00:01:38 +02:00
Casey Bianco-Davis
1fa2be8a9b Fix #147394: Grease Pencil: Opacity operator missing for the menu
The Grease Pencil operator for changing the Opacity of selected strokes
was missing from the transform menu, which is the where the `Radius`
operator lives.

This prevented the operator from being searched.

4.5 backport candidate.

Pull Request: https://projects.blender.org/blender/blender/pulls/147672
2025-10-12 02:10:14 +02:00
Janne Nylander
88308e108e Fix #147739: Python animation baking script was checking bone selection from wrong type of bone
The script was checking if a bone was selected via Bone.select.
As of 5.0, this is not available. Instead, PoseBone.select should be used.

Pull Request: https://projects.blender.org/blender/blender/pulls/147743
2025-10-10 17:29:08 +02:00
Damien Picard
84fc90bb43 I18n: Extract many messages from ED_push_undo
This function is used to add undo steps. It includes a message, for
use in the Undo History menu. This label uses the "Operator" context
for translation.

This commit adds automatic extraction of two functions `ED_undo_push`
and `ED_undo_grouped_push`, as well as manual extraction for many
strings not declared in the function calls.

In order to extract those messages using the proper context, the
extraction logic had to be changed so that a custom context could be
specified. The regexes can now be either a pattern, or
a (ctxt_override, pattern) tuple.

Pull Request: https://projects.blender.org/blender/blender/pulls/147581
2025-10-10 16:01:35 +02:00
Bastien Montagne
d57d76f23d I18n: Refactor: Introduce class for message regexes, includes ctxt
This new class for C++ message extraction regexes includes an optional
translation context override.
2025-10-10 16:01:34 +02:00
Sean Kim
c415febbbb Fix #147568: Editable image in texture paint slot grayed out
Introdued with a926f5b67d

Pull Request: https://projects.blender.org/blender/blender/pulls/147578
2025-10-09 21:06:31 +02:00
Omar Emara
5841cb21f7 Fix #146759: Radial Tilling node crashes in the compositor
The Radial Tilling node crashes in the compositor in GPU mode. This is
because the compositor does not yet support 2D vectors in shader code
generation, but properly supports and expects them in the interface,
which the Radial Tilling node declares. This results in a bad shader
which crashes Blender.

To properly fix this, we need to:

- Support 2D vectors in compositor GPU material shader code generation.
- Support 2D vectors in shader node GPU stack construction.
- Adjust the interface of radial tilling to actually use 2D vectors.

This seems risky for 5.0, so this patch temporarily drops support for
the node in the compositor in 5.0. Then once 2D vectors are supported,
it can be enabled again.

Pull Request: https://projects.blender.org/blender/blender/pulls/147627
2025-10-09 17:23:12 +02: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
Falk David
f9a76822a8 Fix #147437: VSE: Some python operators are broken
Since the introduction of the sequencer scene,
some of the sequencer python operators have
been using `context.scene` when they should be using
`context.workspace.sequencer_scene`.

This fixes `SequencerFadesAdd`, `SequencerFadesClear`,
`SequencerDeinterlaceSelectedMovies`,
`SequencerSplitMulticam`, and `SequencerCrossfadeSounds`.

Pull Request: https://projects.blender.org/blender/blender/pulls/147560
2025-10-09 15:46:05 +02:00
Damien Picard
86ea2bd1ce I18n: Sort sockets in translation extraction, for stable .po files
Socket names and descriptions were not sorted, which could result in
changes between invocations of the translation extraction script.
2025-10-09 12:09:56 +02:00
Damien Picard
98814c1dcd I18n: Translate reports using "WM_global_report(f)"
In bd06baf6e6, "WM_report" was renamed to "WM_global_report", but this
name was not changed in the translation extraction regex. Same for the
format version of this function.

Reported by Ye Gui in #43295.
2025-10-09 12:09:56 +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
Damien Picard
2750cc1a70 I18n: Translate Geometry Nodes modifier warnings
Geometry Nodes can generate warnings inside node trees using a Warning
node. This is used to report warnings in the modifier interface.

This commit allows translation of these warnings in the interface
template, and extracts the messages from built-in asset node groups,
by looking at each warning node.

Pull Request: https://projects.blender.org/blender/blender/pulls/147584
2025-10-09 12:09:44 +02:00
Damien Picard
c35de6f92d I18n: Translate labels using node UI function from node_add_menu.py
In 2a1a658492, layout functions for nodes were refactored and new
methods were introduced, but this change was not applied to the
translation extraction script.

This commit adds these method names and argument order to Python
extraction: "node_operator", "node_operator_with_outputs",
"simulation_zone", "repeat_zone", "for_each_element_zone",
"closure_zone".

Tooltips specified in a special structure are manually extracted using
`n_()`.

Actual translation is done manually in the UI methods inside NodeMenu,
in order to override the context, which by default would have been
"Operator".

Reported by Ye Gui in #43295.

Pull Request: https://projects.blender.org/blender/blender/pulls/147582
2025-10-09 12:09:25 +02:00
Sybren A. Stüvel
8b5c13ac28 Anim: do not access clipboard in Paste Global Transform poll function
Remove access to the clipboard from the Paste Global Transform operator
poll function, as it can cause slowdowns when there is a lot of data on
the clipboard.

This also means that the parsing code has to be a bit more lenient to the
contents of the clipboard. And, because the error message that there is
no matrix on the clipboard is now going to be shown more often, I made it
a bit more friendly.

Pull Request: https://projects.blender.org/blender/blender/pulls/147562
2025-10-09 11:01:25 +02:00
Damien Picard
227ce1711a Cleanup: Remove unused color balance modifier draw function
Sequencer modifiers are no longer drawn from Python since 866fcd0a09.
The function `draw_color_balance` that draws the Color Balance
modifier is no longer called anywhere, so it can be removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/147571
2025-10-09 10:42:22 +02:00
Richard Antalik
a82f3a0fe0 UI: Add tab filter popover to vertical tabs
This adds unobtrusive tab button for selecting displayed tabs to the
tabs region. The idea is, that this way, the filter is much more
discoverable than it being hidden in options popover. The button is
grayed out, when all tabs are visible.

To only draw arrow, is achieved by setting `UILayout.emboss` to `NONE`
or `NONE_OR_STATUS`

Pull Request: https://projects.blender.org/blender/blender/pulls/135132
2025-10-09 04:51:18 +02:00
Harley Acheson
2eaac0ad74 Fix #147574: Icon_Group Use Instead of Icon_Outliner_Collection
We have icons that represent specific individual collections. like
Icon_Outliner_Collection for a default (uncolored) collection, and
Icon_Collection_color_x for ones with colors. For "collections" as a
general thing though we have icon_group. Sometimes we confuse the two,
for example the list of tabs to show in Properties uses a different
icon than the actual category icon. This PR fixes the complaint by
using the correct icon for each of these purposes.

Pull Request: https://projects.blender.org/blender/blender/pulls/147652
2025-10-08 23:04:11 +02:00
Jacques Lucke
4ca8cf27aa Fix: quick fur operator reads asset from wrong file
The assets files were moved a couple of days ago.
2025-10-08 20:00:15 +02:00
Hans Goudey
085276d8ba UI: Nodes: Sort packed groups below assets in add menu search
Previously items in the "Group" list would usually show up first because
their menu path is shorter. Now, adjust their search weight so they show
up lower than the corresponding asset. That this is just a heuristic,
because we don't have a good way to directly deduplicate groups
that are just packed assets in the add menu currently.

Pull Request: https://projects.blender.org/blender/blender/pulls/147629
2025-10-08 16:15:03 +02:00
Pablo Vazquez
6a109a75dd Fix: Compositor: Add Asset Shelf toggle to View menu
Add missing Asset Shelf entry in the View menu in the Compositor.

Pull Request: https://projects.blender.org/blender/blender/pulls/147615
2025-10-08 14:57:53 +02:00
Andrej730
dec032e12e Anim: Indicate Parent Inverse Matrix State in UI
Show the Parent Inverse matrix in the Object properties, Transform
panel. The matrix is shown decomposed as location/rotation/scale.

Pull Request: https://projects.blender.org/blender/blender/pulls/113364
2025-10-08 11:13:24 +02:00
Pratik Borhade
3432c0b238 Fix #147431: Node Editor: 'Join in Named Frame' missing from menus
Operator isn't exposed in UI, now added inside Node menu.
Missed in 8ec093a2d8

Pull Request: https://projects.blender.org/blender/blender/pulls/147499
2025-10-08 11:10:36 +02:00
Pratik Borhade
e816f4976a Fix: Grease Pencil: Stroke method shortcut in sculpt mode
Use `Alt E` to invoke stroke method enum menu. This is done for other
objects/modes, except grease pencil.

Mentioned in #147019

Pull Request: https://projects.blender.org/blender/blender/pulls/147034
2025-10-08 11:10:14 +02:00
Campbell Barton
bd8fc0807c UV: update align, randomize & follow active quads for recent API changes
Recent changes to UV selection missed updating this operator.
2025-10-08 17:45:52 +11: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
John Kiril Swenson
76c03744a8 VSE: Add render options for sequencer scene and active scene
Addresses #146305.

Ever since moving to the "sequencer scene" paradigm, attempting to
render an image or animation when a sequencer with strips is present
often seems to outright ignore the sequencer in most cases. This is
because the sequencer scene usually differs from the active scene (which
is the true render target), so one must first switch their active scene
to the sequencer scene before rendering.  This is confusing and
seems like a regression in behavior. To improve clarity, this patch does
the following:

When a sequencer scene with at least one strip (and the sequencer step
enabled in the pipeline) exists in the current workspace, new options
"Render Sequencer Image" and "Render Sequencer Animation" appear.  These
options may be invoked by alt-F12 and ctrl-alt-F12, respectively.

Additionally, if such a valid sequencer scene is the same as the active
scene, then only the regular render options are listed, since in this
case they are identical to the sequencer render operators, meaning F12
still works predictably.

To switch back and forth between sequencer and main scene render
outputs, a new toggle has been added to the image editor to "Show
Sequencer Scene" output. This button only appears for the render result
if there is a valid sequencer scene that differs from the active scene.

Pull Request: https://projects.blender.org/blender/blender/pulls/146934
2025-10-07 18:12:08 +02:00
Falk David
0c18c1cfc2 Anim: VSE: Add overlay to visualize scene strip range when using scene syncing
This adds an overlay to the animation editors to visualize the current scene strip
in and out points in the scene timeline when the `Sync Scene Time` option in
the sequencer is used.

* Adds an overlay toggle + panel to the dopesheet.
* Adds a new theme setting (for the overlay) under
  `Common` > `Animation` > `Scene Strip Range`.
* Adds the overlay drawing to the dopesheet.

Pull Request: https://projects.blender.org/blender/blender/pulls/146165
2025-10-07 17:34:47 +02:00
Brady Johnston
56bb70fee8 Geometry Nodes: Advect Grid node
Given a grid of velocities, this node advects the values of the input
grid. Different options for integration scheme and clamping are
exposed. Currently their names are just as defined in OpenVDB.

Pull Request: https://projects.blender.org/blender/blender/pulls/147273
2025-10-07 16:19:19 +02:00
Cartesian Caramel
8f41d46d74 Constraint: Geometry Attribute
Add a new constraint called "Geometry Attribute", which directly
samples vector, quaternion, or 4x4 matrix attributes from geometry and
applies these to an object's or bone's transform.

This can be used to transfer data generated by geometry nodes to the
object or bone level. By default the constraint will sample a vector
on the vertex domain. The default attribute is `position` for
simplicity, but the attribute value does not have to have anything to
do with neither the transform of the geometry object nor the geometry
itself.

Pull Request: https://projects.blender.org/blender/blender/pulls/136477
2025-10-07 15:14:22 +02:00
Nika Kutsniashvili
f145e1f7e2 Anim: Time jump operator
Adds a new operator that jumps time by a given number of frames or seconds, forward or backward.
Surprisingly, it was lacking in Blender, and prompted many users (including me) to create extensions.

This PR adds two properties: `time_jump_unit` for choosing whether to jump by frames or seconds
and `time_jump_delta` property that defines by how many frames or seconds the operator should jump,
as well as an actual operator that changes the current frame (`screen.time_jump`).

`time_jump_delta` is a float that gives users the ability to jump by half a second, for example, or by subframes.
Default is set to 1 second, which translates to as many frames jump as frame rate / frame base.
The operator is intentionally not bound by frame range, and can go in negative frames as well.
This is very important because it's extremely common to set frame range to the current workload,
but wish to see animation beyond that.

Operators are added in the new footer for animation editors alongside with pop-up menu where
properties can be changed.

Shortcuts are also added: Ctrl+Left/Right Arrow, which was surprisingly free in Blender.
Now timeline controls are:
- **Right Arrow**: Next Frame
- **Ctrl + Right Arrow**: Jump Forward (by default also Next Second)
- **Shift + Right Arrow**: Jump to End

Pull Request: https://projects.blender.org/blender/blender/pulls/140677
2025-10-07 13:43:20 +02:00
Pablo Vazquez
14cf38a49e UI: Remove Tutorials from Help menu
As mentioned in !146730, blender.org does not provide a list of
tutorials anymore, instead, the "Support" section has links to user
communities, enterprise support, and mentions tutorials as part of
a community activity.

Also add "Get Involved", which is a hub for inviting contributors in
all areas.

Pull Request: https://projects.blender.org/blender/blender/pulls/147414
2025-10-07 13:10:39 +02:00
quackarooni
1a6d932fbd Fix: Nodes: Inaccurate placement of framed nodes in swap operators
The swap operators use `Node.location` for location calculations. This expresses
a node's location relative to their parent frames.

This can lead to inaccurate location calculations if nodes have different parent
frames. This was partly addressed by using the custom `temporary_unframe`
context manager. However, that method is sensitive to the order of steps
executed by the operator, making it easy to accidentally let a few location bugs
go through.

This patch fixes the issue by using `Node.location_absolute` which gives the
node's absolute location. This also gets rid of the need for
`temporary_unframe`, and makes the location calculations more straightforward.

Pull Request: https://projects.blender.org/blender/blender/pulls/147424
2025-10-07 12:33:30 +02:00
Philipp Oeser
8d4f883d27 Fix #147476: errors/crashes calling node menus outside the Node Editor
Calling node menus in the context of a different editor can lead to
errors in many places (e.g. checking on space_data tree_type/
node_tree_sub_type), so to resolve, add a very general poll function to
the NodeMenu class.

Pull Request: https://projects.blender.org/blender/blender/pulls/147512
2025-10-07 11:47:47 +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
Campbell Barton
62d72bd0b5 UV: initial implementation of UV sync select
Support sync selection in the UV editor, with face-corner selection,
so it's possible to select individual UV vertices/edges in the UV editor
without UV's attached to the same underlying edge also becoming selected.

There is limited support for maintaining the UV selection when selecting
from the 3D viewport, common operations such as picking &
box/circle/lasso select support this, however other selection operations
such as "Select Random" or "Select Similar" will clear this data,
causing all UV's connected to selected mesh elements to become selected.
We may add support for additional operators as needed.

Details:

- UV Sync Selection is now enabled by default.
- In edit-mode the UV selection is stored in BMLoop/BMFace which are
  written to custom-data layers when converted to a Mesh.
- To avoid unnecessary overhead - this data is created on demand.
  Operators may clear this data - selecting all or none do so,
  as there is no reason to store this data for a uniform selection.
- The Python API includes functions to synchronize the selection to/from
  UV's as well as flushing based on the mode.
- Python scripts that manipulate the selection will either need to clear
  this synchronized state or maintain it.

See:
- Design task: #78393.
- Implementation task: #131642.

Ref !138197
2025-10-07 01:41:16 +00:00
Sean Kim
88b5319596 Refactor: Split out pressure curve display from main property function
Adds a new `prop_custom_pressure` helper method to `UnifiedPaintPanel`
specifically for drawing brush properties that have custom,
collapsible paint curves and migrates existing usages.

Pull Request: https://projects.blender.org/blender/blender/pulls/147161
2025-10-07 03:10:44 +02:00
Campbell Barton
8663f704a2 Cleanup: remove use of f-strings in core scripts 2025-10-07 10:19:46 +11:00
Campbell Barton
cc1a3f19b4 Cleanup: resolve various pylint warnings from recent changes 2025-10-07 10:19:46 +11:00
Campbell Barton
77f5119f77 Cleanup: import modules lazily 2025-10-07 10:19:46 +11:00
Campbell Barton
01806a62e3 Cleanup: spelling (make check_spelling_*) 2025-10-07 10:19:46 +11:00
Harley Acheson
5953ff318c UI: Add Preference for Menu Close on Leave
This PR changes the current behavior that closes menus that are open
when your mouse is moved out of its "safe" area (a bit wider than its
visible bounds). With this PR applied menus stay open unless you click
elsewhere, hover a neighboring menu, press escape, or select an item.
Although this PR turns off menu mouse leave, it also adds a preference
that can be used to turn it back on.

Pull Request: https://projects.blender.org/blender/blender/pulls/145523
2025-10-06 20:19:12 +02:00
W_Cloud
247c19f6cf Fix #147355: Nodes: Inconsistent vector add menu
- Add the missing `Vector Math` node to the Compositor add menu.
- Adjust the position of the `Separate XYZ` node in Geometry Nodes.
- Adjust the position of the `Vector Math` node in Shader Nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/147435
2025-10-06 19:09:01 +02:00