Commit Graph

3492 Commits

Author SHA1 Message Date
Jeroen Bakker
b6da18172b Cleanup: Make format 2024-09-16 13:30:21 +02:00
Julian Eisel
7180df49dd Fix: Incorrect tool brush check for grease pencil vertex paint mode
This vertex paint code was just recently added in 942499382d, so the
property wasn't renamed correctly after b64bf66257 (which was created
earlier, just committed later).
2024-09-16 13:11:37 +02:00
Julian Eisel
65fdb3fa30 Grease Pencil: Properly support brushes with draw mode primitive tools
Part of blender/blender!125449.

Since brush assets were merged, the brush asset selector and some other brush
UIs wouldn't show up for the primitive tools. This is addressed now. The
primitive tools use the same brush as the brush tool, although only the draw
brushes will work properly. !125449 addresses this so the primitive tools
remember their own draw brush, separate from the brush tool.

Turns out that these primitive tools were never tagged as using brushes by
setting the `data_block` member (or setting the `'USE_BRUSHES'` option since
b64bf66257). The UI was just hardcoded to display things like the brush selector
for primitive tools. So as far as the tool system knew, these tools did not use
brushes.

Tagging the tools properly exposed some issues that are addressed here (see PR
for details).

Pull Request: https://projects.blender.org/blender/blender/pulls/127204
2024-09-16 13:04:08 +02:00
Bastien Montagne
d52d70324d Fix (chat-reported) Py-defined operators id being added to translation files.
Yet another consequence/fix from fixing the type value of
`bpy.types.*.bl_rna` in our BPY code (21b820cd33).
2024-09-16 12:56:35 +02:00
Bastien Montagne
81cdcf8326 Fix (unreported) I18N tool failing to process RTL languages on Linux. 2024-09-16 12:41:11 +02:00
Bastien Montagne
902693a6a5 Add Urdu language entry. 2024-09-16 12:41:11 +02:00
Julian Eisel
b64bf66257 Refactor: Tools: Change how tools are marked as using brushes
The previous way of considering tools with the `data_block` member set
as using brushes was rather unclear/confusing, but also a bit outdated
with the brush assets changes. Since then most sculpt/paint modes use a
unified brush tool, there was no tool for every brush type (aka brush
tool) anymore. So now the `data_block` member was just set dynamically to
match the active brush type which is otherwise irrelevant to the tool
system now.

Further, this will become important to bring back some of the tools that
use brushes in grease pencil draw mode, see #116337. For that we want to
keep the unified brush tool, but still allow other tools that only use a
specific brush type. So marking a tool as using brushes should be done
separately from indicating a specific brush type.

Removing/replacing the `data_block` member should happen separately
still, pending further developments (e.g. see #125449).

Pull Request: https://projects.blender.org/blender/blender/pulls/125911
2024-09-16 12:20:25 +02:00
Andres Stephens
7cff7998ad Fix: #127522: Preferences: GPv3: Show GP3 categories in the keymap editor
Shows the GPv3 keymap categories in the list for editing, adding and discoverability.

Fix for #127522.

Pull Request: https://projects.blender.org/blender/blender/pulls/127533
2024-09-16 12:05:41 +02:00
Pratik Borhade
c2a317a6d5 GPv3: Vertex paint context menu
Add right click context menu in vertex paint mode.

Resolves #127567.

Pull Request: https://projects.blender.org/blender/blender/pulls/127608
2024-09-16 12:02:30 +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
Jesse Yurkovich
b8f236510d Fix: error in node wrangler format string 2024-09-16 04:50:18 +02:00
Jacques Lucke
92febd5fb2 Fix: error in node wrangler format string 2024-09-14 13:29:45 +02:00
Sietse Brouwer
eaad744c7f GPv3: Operators for Normalize active and Normalize all vertex groups
This PR implements the Normalize operators in Weight Paint mode for
GPv3:
- Normalize weights of the active vertex group. This operator normalizes
all the vertex weights in the active vertex group to a value between 0.0
and 1.0.
- Normalize All. This operator normalizes the weights of all vertex
groups, so that for each vertex, the sum of the weights is 1.0. Weights
of locked vertex groups are not changed. By default, the active vertex
group also stays unchanged, unless it's necessary to reach a normalized
state.

The operators are added to the 'Weight' menu in Weight Paint mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/126302
2024-09-13 16:59:20 +02:00
casey bianco-davis
3c67ae7785 GPv3: Rename Cutter tool to Trim
This rename the `Cutter` tool's name, code and icon to `Trim`.
The legacy Grease Pencil code is unchanged.

This was discussed in the 2024-07-30 Grease Pencil Module Meeting.

Reasons for the change:
 - Match the `Trim Stroke Ends` setting on brushes.
 - Match the `stroke_trim` operator.
 - Name is more clear and more commonly used.
 - Frees the name for a future boolean cutting tool.

Pull Request: https://projects.blender.org/blender/blender/pulls/126452
2024-09-13 16:56:51 +02:00
Sybren A. Stüvel
8ba5c50f5c Anim: disallow switching action slots when using NLA Tweak Mode
When an NLA strip is in tweak mode, the Action editor no longer allows
switching the assigned slot. This is now consistent with it also not
allowing switching of the Action.

The slot used by the NLA strip can be changed in the NLA strip
properties panel of the NLA editor, in the same way that the Action
itself can be changed there.
2024-09-13 15:54:24 +02:00
Falk David
8cbdbf5634 GPv3: Vertex Paint operators
This adds the following operators:
* Set Vertex Color
* Reset Vertex Colors
* Invert
* Brightness/Contrast
* HSV
* Levels

Also populates the `Paint` menu with them in vertex paint mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/127572
2024-09-13 15:42:21 +02:00
Campbell Barton
c6afb0e270 Core: remove sdlew/WITH_SDL_DYNLOAD & disable SDL by default
Disable dynamic SDL loading as well as disable SDL for release builds.

This was only used for audio output which can already use OpenAL
if there are back-ends not natively supported by Blender.

- Remove extern/sdlew/
- Remove the WITH_SDL_DYNLOAD build option.
- Remove `bpy.app.sdl.available`.

Ref !127554
2024-09-13 22:44:35 +10:00
Mateusz Grzeliński
6822e61c6f Fix #126792: "extension install" sub-command fails to install
Do not report error when local repo does not have manifest and we are
asking for remote repositories.
If the errors list is filled with any error the operation is considered
failure.

Ref: !127360
2024-09-13 16:43:49 +10:00
Pablo Vazquez
d254a12be9 UI: Text Editor: Use column for find settings
Replace the aligned row of three unrelated toggles with more descriptive
check-boxes in a column.

It's not like we are short of space in that sidebar either.

Ref: !127530
2024-09-13 16:30:45 +10:00
Campbell Barton
81e2ccbf2b Cleanup: spelling in comments 2024-09-13 10:56:26 +10:00
Pablo Vazquez
1e98b7d2a3 UI: Show material link type icon in dropdown
Enums that are displayed as icon-only should have their icons defined
in RNA, not just through the layout in Python. That way they are shown
in the dropdown itself and users make the connection between the listed
item label and the icon while collapsed.
2024-09-12 19:23:15 +02:00
Pablo Vazquez
f4eb0d810d UI: Add missing new/open icons in menus
Image -> New and Clip -> Open were missing ellipsis and icon, to be
consistent with every other new/open entry in menus.
2024-09-12 18:34:53 +02:00
Pablo Vazquez
8845e3243d UI: Remove duplicate icons on menus
As per the human interface guidelines, do not use the same icon in
consecutive items within a group in a menu.

* Operator Search in Top Bar's Edit menu
* Viewport Render Keyframes in Viewport's View menu
2024-09-12 16:19:34 +02:00
Julien Duroure
00bc059894 glTF: Fix typo in a previous commit 2024-09-12 15:50:58 +02:00
Pablo Vazquez
32a2c9ea32 UI: Add missing ellipsis to File menu items
As per the writing style guidelines, add ellipsis to labels of
operators that do not run immediately but open settings or require
further steps.

Pull Request: https://projects.blender.org/blender/blender/pulls/127475
2024-09-12 15:48:41 +02:00
Pablo Vazquez
14208b6dfa UI: Compositor: Show Parent button when available
The Parent Node Tree operator button to go up a level in nested
node trees is always visible in the header, regardless if we are
currently in a nested tree or not.

Only show the button when it is actually possible to go a level up.
This frees up space in the header when at the top level.
2024-09-12 15:44:06 +02:00
Pablo Vazquez
3986b99e42 UI: Compositor: do not expand backdrop channels
To be consistent with other editors (Image Editor, Sequencer), and use
less space in the header.
2024-09-12 15:44:06 +02:00
Julien Duroure
a9bfca5483 glTF exporter: fix missing hook parameters leading to crash 2024-09-12 15:41:00 +02:00
Julien Duroure
0169abd220 glTF exporter: account for library when gathering image URI
When using "keep original" option
2024-09-12 15:19:32 +02:00
Falk David
c07c9d5729 GPv3: Change "use_locked_material" option
This option is meant to ignore any material locking when it
comes to editing strokes that might use locked materials.

There were some issues with the current implementation.
* The name did not reflect what it was supposed to do, so it
   was renamed to `ignore_locked_materials`.
* The description of the option has been updated to better
   reflect the behavior.
* Some util functions have been refactored

Pull Request: https://projects.blender.org/blender/blender/pulls/127423
2024-09-12 14:20:16 +02:00
Sybren A. Stüvel
3417934eff Anim: add Action Slot assignment to NLA strip
For an NLA strip to use a slotted Action, it needs to specify which slot
to use in that action. This is now handled by two new properties on the
strip in DNA & RNA: `action_slot_handle` and `action_slot_name`.

These serve the same purpose as their counterparts on the `AnimData`
struct.

Note that this commit does NOT add NLA evaluation support for slotted
Actions. It merely allows assigning them. Evaluation, tweak mode
support, etc. will be implemented in future commits.

Pull Request: https://projects.blender.org/blender/blender/pulls/127359
2024-09-12 14:08:16 +02:00
Falk David
8f86a04c72 Fix: GPv3: Missing context mode case in overlay options panel
The vertex paint mode options was missing in this panel.
2024-09-12 13:39:28 +02:00
Julien Duroure
044d20fe46 glTF importer: Fix light spot default values check 2024-09-12 12:05:48 +02:00
Julien Duroure
4c441c1c64 glTF exporter: fix accessor min/max float check 2024-09-12 12:02:51 +02:00
Julien Duroure
936ca7636a glTF exporter: Removes a duplicate lookup 2024-09-12 11:49:16 +02:00
Julien Duroure
89c389c465 glTF: hook UI, distinct import & export draw code 2024-09-12 11:42:22 +02:00
Jacques Lucke
1a52f2bbab Fix #126924: instable fire simulation by default
The cfl_condition default was changed in 9a0a75eff0 with the intention
of making liquids behave better. However, that degraded the simulations of fire.

Now the property will be set to its old value if the quick smoke operator is used.
Can't think of a great way always use the old value for smoke simulations for now.
2024-09-11 17:48:20 +02:00
Philipp Oeser
d1aa30f1ac UI: Expose "Frame Selected" in image editor mask mode
Was already included in `IMAGE_MT_view_pie`, but missing from
`IMAGE_MT_view`

NOTE: the functionality has problems, see #127352, but that will be
tackled separately

Pull Request: https://projects.blender.org/blender/blender/pulls/127391
2024-09-11 13:30:40 +02:00
Pablo Vazquez
095aab986b Keymap: Map Back/Next mouse buttons in File Browser
Assign mouse button 4 and 5 to navigate back/next in the
File Browser. These button numbers are usually mapped to
this actions on browsers.

Additionally to the existing Alt/Option+Left/Right shortcuts.
Both in Blender default keymap and Industry Compatible.

Pull Request: https://projects.blender.org/blender/blender/pulls/127413
2024-09-11 12:29:19 +02:00
Campbell Barton
54153629f4 Fix #127329: Keyboard interrupt doesn't work from Python 2024-09-11 14:30:51 +10:00
Falk David
942499382d GPv3: Vertex Paint Mode
This adds the vertex paint mode and all of the tools
from GPv2:
 * Average
 * Blur
 * Draw
 * Replace
 * Smear

Pull Request: https://projects.blender.org/blender/blender/pulls/125674
2024-09-10 18:56:31 +02:00
YimingWu
168c568058 Fix #126946: GPv3: Handle erase mode when using a tablet pen
Pressing ctrl-click should switch the drawing tool into a eraser
for grease pencil. This is now handled by detecting
`EVT_TABLET_ERASER` and switch to `BRUSH_STROKE_ERASE` mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/126962
2024-09-10 11:59:08 +02:00
Sietse Brouwer
9c9b562d54 GPv3: Smooth active vertex group operator
This PR implements the "Smooth" operator in Weight Paint mode for GPv3.
The Smooth operator smooths the weights in the active vertex group by
applying a gaussian blur to the vertex weights.

The operator has two properties:
- `factor` (0.0 - 1.0): The extent to which the smoothed weight is
applied to the original weight, where 0.0 is 'keep the original weight'
and 1.0 is 'replace fully with the smoothed weight'.
- `repeat`: The number of times the smoothing is executed. A higher
value means more smoothing.

The operator is added to the 'Weight' menu in Weight Paint mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/126429
2024-09-09 10:59:06 +02:00
Sybren A. Stüvel
416625738e Anim: avoid Python exception in Dope Sheet header
Fix a Python exception when drawing the Dope Sheet header in Shape Keys
mode, when the active Object type cannot have shape keys.
2024-09-09 10:49:59 +02:00
Sybren A. Stüvel
bbccf912b4 Anim: remove the 'Animation Debug' panel
Remove the 'Animation Debug' panel from the 3D Viewport. It was always
meant as a temporary debugging tool, and it's no longer needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/127200
2024-09-06 10:59:04 +02:00
Jeroen Bakker
458faa6486 Preferences: GPU backend selection
This PR allows users to select a GPU backend.

In the system tab of the user preferences the GPU backend can be selected in the `Display Graphics` panel.
It will require a restart of Blender before the changes become effective.

During startup minimum requirements are checked. Blender will switch automatically
to OpenGL when no compatible Vulkan device could be detected. A dialog will be shown
to inform the user.

The setting of the in the `Display Graphics` panel are still overridden when blender is started
using the `--gpu-backend` option. When starting blender with `--debug-gpu` the backend
detection will print to the console.

See PR for detailed information and screenshots of the UI.

Implements #126504
Pull Request: https://projects.blender.org/blender/blender/pulls/126545
2024-09-06 08:28:41 +02:00
Campbell Barton
43f7b50df3 Fix #127127: bpy.types sometimes reference their parent's "bl_rna"
Accessing `bl_rna` for type defined in `scripts/modules/bpy_types.py`
could return their parent-classes RNA when accessed via their parent
types __subclasses__() method.
2024-09-06 14:57:26 +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
Sybren A. Stüvel
383c3c8253 Anim: Add Action+Slot selectors to Property editor tabs
Add Action + Action Slot selectors to various Property Editor tabs.
This follows the pattern established in
f917b60036.

Support for `CacheFile` data-blocks is not included here. That needs
some discussion, as currently its interface is part of the Modifier
stack (and thus implemented in C++ and not Python, and using a
different layout).

Since this PR is about adding to the Property Editor, some data-blocks
that have no representation there are thus excluded (like `Mask`).
Even when they could actually use an Action+Slot selector somewhere.

Pull Request: https://projects.blender.org/blender/blender/pulls/127074
2024-09-05 12:11:35 +02:00
Sybren A. Stüvel
efcd0e04b3 Fix #126896: Shape Key Editor can't browse actions
The new Action selector (51fd355c01) avoids the need to use
`space_data.action` in the dope sheet (that attribute was a bit of a
hack; the new Action selector was made to avoid that). It failed to take
the dope sheet's shape key mode into account properly, though. This is
now fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/127177
2024-09-05 12:02:23 +02:00