Commit Graph

397 Commits

Author SHA1 Message Date
Damien Picard
eca984e79d UI: make external text editor presets upper case
The presets for external text editors introduced in e16ec95a16 are
stored in Python files. The names of these files are used to generate
the UI name, and are case-sensitive.

They are currently lower case, but should be title case like other
presets. This commit renames the files so they are title case.

Pull Request: https://projects.blender.org/blender/blender/pulls/110642
2023-08-01 15:53:32 +02:00
Damien Picard
d922233363 Cleanup: remove unused SSS presets
These SSS presets were used for the Blender Internal engine, pre-2.80.

Pull Request: https://projects.blender.org/blender/blender/pulls/110643
2023-08-01 15:52:05 +02:00
Campbell Barton
52acf6a6ec Cleanup: correct file names in comments after C -> C++ renaming
Use back-tick quotes to differentiate these from plain text.
2023-07-31 13:02:30 +10:00
Campbell Barton
344ba9691b WM: use repr for WM_OT_context_toggle_enum
Use instead of "'%s'" to avoid problems in the unlikely instance of
the strings containing characters that need escaping.

Also use a ternary operator instead of indexing a tuple.
2023-07-30 16:14:14 +10:00
Campbell Barton
53e6803977 Cleanup: check for "BaseException" instead of "Exception"
Prefer the more generic exception type as it's possible exceptions
derive from this and not "Exception".

Also use the name 'ex' for exceptions instead of 'e'.
2023-07-30 16:14:13 +10:00
Campbell Barton
9f5be2a861 Cleanup: quiet pylint warnings using BaseException 2023-07-30 16:14:11 +10:00
Campbell Barton
52109ff7f0 Refactor: out addon_utils fake_module(..) into a top-level function
Even though it's private, it's useful to be able to access this for
prototyping support for scanning addons in other other locations.
2023-07-29 22:20:40 +10:00
Campbell Barton
6ff81c6505 PyAPI: internal changes needed to support sub-modules as add-ons
Apply minor changes needed for an add-on to be a sub-module.
2023-07-29 22:15:11 +10:00
Campbell Barton
916f6a7bf3 UI: add weight paint gradient menu items for discoverability 2023-07-29 16:33:14 +10:00
Campbell Barton
69e290d2fe Cleanup: code comments
Note that the previous commit [0] added a workaround for MMB-Emulation,
which should have been a separate commit.
(Ctrl-Shift-LMB for weight paint selection).
Extended the code comment for this.

[0]: cfffd813c1
2023-07-29 16:20:03 +10:00
Campbell Barton
cfffd813c1 Cleanup: use typed enum for UI_ITEM_* flags
Using an int lead to confusion with other flags often used with buttons.
For e.g. these flags could be easily confused with uiItem::flag.
2023-07-29 15:32:45 +10:00
Hans Goudey
a632f1ddfd Sculpt: Remove dynamic topology "Smooth Shading" option
Dynamic topology drawing can now use the smooth status saved in each
edge. Because of that, the "Smooth Shading" draw option is unnecessary
and just adds confusion because of inconsistency between dynamic
topology drawing and other modes.

Fixes #109191

Pull Request: https://projects.blender.org/blender/blender/pulls/110548
2023-07-28 13:44:01 +02:00
Andras-Borsanyi
f418e4f648 Walk Navigation: Controls to adjust jump height interactively
In Walk Navigation mode with gravity enabled, the jump height is
often inappropriate for the scene that you are viewing. This is a small
feature that lets you change the jump height in modal walk navigation
as you go, i.e. if there are varying elevation changes across the scene.

Pressing '.' increases and ',' decreases the jump height (because these keys
are the same for most layouts).

Pull Request: https://projects.blender.org/blender/blender/pulls/109827
2023-07-28 13:43:35 +02:00
Campbell Barton
fb54d3f865 Keymap: Use Alt-LMB for selection in vertex/weight paint modes
Use Alt-LMB for selecting in vertex/weight paint modes for vertex, face
& pose bone selection - replacing Ctrl which was previously used for
selecting. This is needed so Ctrl & Shift can be consistent between all
paint modes.

Loop selection is available With Alt-LMB but only when selection tools
are active (with the LMB select key-map). They're always available with
the RMB select key-map.

This also resolves a conflict where box & lasso select tools couldn't
be used to de-select (via Ctrl) because the Ctrl-LMB was also clearing
the selection.

Part of #105298 design task.
2023-07-28 20:54:53 +10:00
Julien Kaspar
827918c925 Keymap: add/update selection mode shortcuts
Selection modes are typically assigned to the number keys.
These are some updates for more consistency among painting and grease
pencil modes:

- Paint Mask = `M` changed to `1`.
- Vertex Selection = `V` changed to `2`.
- GP: Point Selection = `1`.
- GP: Stroke Selection = `2`.
- GP: Segment Selection = `3`.

Design task: #105298

Ref !108714.
2023-07-28 18:26:57 +10:00
Campbell Barton
88902a273e UI: add menu items for sample weight/color
These were only available as shortcuts without any menu item.
2023-07-28 16:27:24 +10:00
Julien Kaspar
6de6d7267f Keymap: improve consistency for paint modes
Various changes to common keymap entries to:

- Sync up very common shortcuts between all Draw, Paint & Sculpt modes
- Avoid shortcut conflicts and remap blocking shortcuts
- Add missing common shortcuts
- Make some important shortcuts more accessible

Some standards this is setting across these modes are:

- Holding `Ctrl` & `Shift` for inverted/smoothing brush strokes
- `X` (+ modifier keys) for Color operations
  (for example flip, sample & fill).
- `Ctrl R` for remeshing
- `I` and `Alt I` for creating and removing keyframes.

- Sample Color = `S` -> `Shift X`
- Set Vertex Color = `Shift K` -> `Ctrl X`
- Stroke Method Menu = `E` -> `Alt E`

New
- Paint Smooth = `Shift Left Mouse`

- Sample Weight = `Ctrl Left Mouse` -> `Shift X`
- Sample Group = `Shift Left Mouse` -> `Shift Ctrl X`
- Set Weight = `Shift K` -> `Ctrl X`
- Linear Gradient = `Alt Left Mouse` -> `Shift A`
- Radial Gradient = `Ctrl Alt Left Mouse` -> `Shift Alt A`
- Stroke Method Menu = `E` -> `Alt E`

New
- Invert Paint = `Ctrl Left Mouse`
- Smooth Paint = `Shift Left Mouse`

- Sample Color = `S` -> `Shift X`

New
- Smooth Paint = `Shift Left Mouse`

- Face Sets Visibility = `H` -> `Shift H`
- Face Sets Visibility = `Shift H` -> `H`
- Face Set Edit Pie = `W` -> `Alt W`
- Sample Color = `S` -> `Shift X`
- Context Enum Menu = `E` -> `Alt E`
- Subdivision Set (Level -1 relative) = `Pg Down` -> `Alt 1`
- Subdivision Set (Level 1 relative) = `Pg Up` -> `Alt 2`

New
- `paint.brush_colors_flip` = `X`
- `sculpt.detail_flood_fill` = `Ctrl R`
- `sculpt.set_pivot_position` (Mode=Surface) = `Shift Right Mouse`

New
- `brush.scale_size` (scalar=0.9) = `[`.
- `brush.scale_size` (scalar=1.1) = `]`.

Removed
- Delete All Active Frames = `Shift X`

New
- `wm.call_menu (GPENCIL_MT_gpencil_draw_delete)` = `Alt I`

- Delete = `X` -> `Alt I`

New
- `wm.call_menu (GPENCIL_MT_gpencil_draw_delete)` = `Alt I`

- Sample Weight = `Ctrl Left Mouse` -> `Shift X`

New
- `wm.call_menu (GPENCIL_MT_gpencil_draw_delete)` = `Alt I`

New
- `gpencil.tint_flip` = `X`
- `wm.call_menu (GPENCIL_MT_gpencil_draw_delete)` = `Alt I`

Ref !108791.
2023-07-28 12:31:52 +10:00
Campbell Barton
93ac697091 Cleanup: remove redundant transform entries in the "Weight Paint" keymap
The pose keymap already handles these actions.
2023-07-28 12:18:48 +10:00
Nate Rupsis
8183f21258 Animation: Default NLA duplucation hot keys to duplicate linked
## Overview

Much like node groups, or a VSE clip, when we duplicate we actually want a _linked_ duplicate. This PR updates the NLA key board for Duplicate linked to `Shift + D`, and Duplicate to `Alt + D`.

Additionally, update Tool tips to reflect duplicate vs linked duplicate.

Pull Request: https://projects.blender.org/blender/blender/pulls/110316
2023-07-27 18:14:05 +02:00
Bastien Montagne
a1d7ec7139 Core: Implement new blendfile compatibility handling.
This implements the main aspects of changes to blendfile compatibility
as designed in #109151:
* Blender files which file minversion is newer than current Blender
  executable won't be loaded at all.
* Blender files which file version is newer than current Blender will
  triger systematic warning to user:
  * In the status info bar (lower right corner in default UI).
  * When attempting to save (overwrite) them.

This means that the file minversion becomes a hard limit, and not a
soft, warning-only as it used to be. Further more, forward compatibility
warning is now systematic (instead of depending on file minversion),
and more visible for users.

See also https://wiki.blender.org/wiki/Process/Compatibility_Handling
for details over the new policy.

Technically:
* Opening any file with a minversion newer than current Blender file one
  now triggers an early abort, with an error message reported to the user.
  This is handled by a new utils called from `blo_decode_and_check`.
* Any file newer than current Blender version sets a new
  `has_forward_compatibility_issues` flag in Main struct at read time.
* Status bar info area is turned into a template, which uses this flag
  to display special warning UI and tooltip when set.
* A new confirmation popup appears when user tries to save (overwrite)
  such a 'newer' blendfile, stating potential loos of data, and
  proposing by default to 'save as' instead.
* The 'quit unsaved' popup has also been updated to 'save as' instead of
  'save' when the edited file is has potential forward compitibility
  issues.

Part of #109151 (PR !110109).
2023-07-27 16:21:38 +02:00
Germano Cavalcante
d9c3cffd91 UI: Rename 'Proportional Influence' to 'Proportional Editing' in tooltip
"Proportional Editing" is the term officially used by the Blender
community to describe this specific feature.

Also, "Proportional Editing" seems to be more descriptive than
"Proportional Influence", as it emphasizes the ability to
proportionally edit the areas around the selection.
2023-07-27 09:09:22 -03:00
Campbell Barton
1339400845 Cleanup: quite pylint keymap warnings 2023-07-27 16:54:09 +10:00
Julien Kaspar
a7dd864dcf Keymap: simplify default keymap for paint modes
Part of design task #105298 to improve overall consistency.

This removes various shortcuts unused or blocking shortcuts:

- Brush tool shortcuts
  - Mesh sculpt mode shortcuts
     - `X` = Draw
     - `Shift S` = Smooth
     - `P` = Pinch
     - `I` = Inflate
     - `G` = Grab
     - `L` - Layer
     - `Shift T` = Flatten
     - `C` = Clay
     - `Shift C` = Crease
     - `K` = Snake Hook
     - `M` = Mask
  - `D` = Gpencil Vertex Paint - Draw brush

- Duplicate dyntopo shortcut for editing detail size

- Grease Pencil: Undocumented draw tool specific guide shortcuts:
  - `O`, `J`, `Alt J`, `K`, `Alt K`, `Shift K`, `L`, `Alt L`, `Ctrl L`,
    `V`, `M`, `C` & `Alt C`

- `L` = Gpencil: "Alternate" operator shortcut

Also moved erasing box and lasso gesture shortcuts out of specific tools
and into the Draw mode overall.

Ref !108712.
2023-07-27 16:42:17 +10:00
Campbell Barton
98ed1fd011 Fix region toggle pie menu exception on unknown regions
Loading a blend file with unknown regions would raise an exception.
Also remove exception where channels were skipped when the attribute
isn't found as it's no longer needed.
2023-07-27 16:16:23 +10:00
Campbell Barton
3857668756 Remove duplicate keymap item in c14a43acce 2023-07-27 16:00:53 +10:00
Campbell Barton
c14a43acce Fix paint stroke "mode" property being reused when weight painting
Binding a key to weight-paint with mode set (invert/smooth for e.g.)
caused regular weight painting to reuse this setting.

Don't reuse paint "mode" between strokes.
This also allows the default to be removed from the key-map.
2023-07-27 15:58:50 +10:00
Campbell Barton
bdd09a16ef Cleanup: internal keymap function names
- Use km_edit_ prefix for edit-modes.
- Rename "curve" to "curve_legacy".
- Consistent naming for naming for vertex/face selection mask.
- Group object/grease-pencil/paint/edit mode key-map functions together.
2023-07-27 15:17:12 +10:00
Campbell Barton
7548059886 Keymap: restore mirror transform shortcut in weight paint mode
Unintentionally removed in [0]. Weight paint transform should always
follow pose-mode transform.

[0]: d7558a243c
2023-07-27 12:30:44 +10:00
Campbell Barton
88dd1d4408 Keymap: rename "Toolbar Toggle" to "Region Toggle"
The toolbar is only one kind of region that can be toggled.
2023-07-26 21:52:37 +10:00
Campbell Barton
ab7161e41a Keymap: add experimental "Toolbar Toggle Pie" preference
When pressing N-key a pie menu is shown which can toggle regions,
typically the toolbar, sidebar and the header.

This supports toggling regions without having to add a separate shortcut
for each one.

The pie menu locations selected based on the region alignment.

See #107785.
2023-07-26 15:24:30 +10:00
Campbell Barton
d7558a243c Keymap: avoid 3D View transform inheritance
Move shared transform operations out of the 3D viewport key-map into a
template function which each modes key-map uses.

This allows sculpt mode to key-bindings which where bound to transform
actions that don't make sense in sculpt mode.

Note that this enables `alt_navigation` for some 2D viewport actions
where it's not yet used.

Based on design task: #105298.

PR !110019.

Co-authored-by: Julien Kaspar <JulienKaspar>
2023-07-25 21:22:09 +10:00
Campbell Barton
5f764b361c Fix 'bl_keymap_validate' test
Exporting & importing the key-map changed results,
resolve by using float literals.
2023-07-25 20:51:33 +10:00
Damien Picard
39a94e370c I18n: restore unit messages after c++ migration broke extraction
The units defined in blenkernel/intern/unit.c were extracted using a
regex which contained `NULL`. Commit 129f78eee7 converted this file to
c++, and these `NULL` were replaced with `nullptr`, breaking the
regex.

This commit changes the regex to `nullptr` as well to restore the
translations.

Pull Request: https://projects.blender.org/blender/blender/pulls/110420
2023-07-24 17:01:41 +02:00
Germano Cavalcante
017d4912b2 Transform: Use alternative hotkeys for Transform Navigation
In order to avoid navigation hotkey conflicts during transform
operations, this commit implements the "Transform Navigation with Alt"
option.

This option is enabled by default and makes navigation hotkeys require
the `Alt` key during a transforming in the 3D View.

Pull Request: https://projects.blender.org/blender/blender/pulls/109754
2023-07-24 15:51:58 +02:00
Lukas Stockner
b220ec27d7 Cycles: Update Velvet BSDF to Sheen BSDF with new Microfiber sheen model
This patch extends the old Velvet BSDF node with a new shading model,
and renames it to Sheen BSDF accordingly.

The old model is still available, but new nodes now default to the
"Microfiber" model, which is an implementation of
https://tizianzeltner.com/projects/Zeltner2022Practical/.

Pull Request: https://projects.blender.org/blender/blender/pulls/108869
2023-07-24 15:36:36 +02:00
Damien Picard
6f1f2b9830 I18n: do not translate one message already translated with tip_()
The "Name Collisions:" UI message does not need to be translated as
part of the label, as it is already through an explicit call to
tip_().

Pull Request: https://projects.blender.org/blender/blender/pulls/110319
2023-07-24 15:13:30 +02:00
Dalai Felinto
b853f21562 Docs: Update RNA to user manual url map 2023-07-21 15:01:05 +02:00
Dalai Felinto
a51b38dec5 Cleanup: make format 2023-07-21 14:23:49 +02:00
Clément Foucault
7158844424 EEVEE-Next: Irradiance Cache: Add manual trilinear weights
This replaces the trilinear interpolation with manually
placed samples to avoid most light leak.

Add two new parameters to bias the sampling position:
- Normal bias
- View bias

Move the irradiance smoothing parameter per grid.

Pull Request: https://projects.blender.org/blender/blender/pulls/110312
2023-07-20 19:03:08 +02:00
Falk David
7cd5e25743 GPv3: Stroke Simplify operator
This adds the `stroke_simplify` operator.
Implements a version of the Ramer Douglas Peucker algorithm for marking the points to delete.

Pull Request: https://projects.blender.org/blender/blender/pulls/110266
2023-07-20 15:31:51 +02:00
Amelie
924aa0ef07 GPv3: Hard Eraser tool
Implementation of the hard eraser for grease pencil.
The tool "cuts" the strokes, meaning it removes points that are inside the eraser's radius, while adding points at intersections between the eraser and the strokes.

Note that this does not implement the "Stroke" and "Dissolve" mode of the eraser yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/110063
2023-07-20 13:56:23 +02:00
Bastien Montagne
27616ddad3 I18N: Utils module: remove unrelated logic from utils generating languages menu file.
Writing this file in specific places is not the responsibility of that
utils module code. this is for caller's logic to handle (in this case,
mainly the update UI translations add-on).
2023-07-20 11:31:33 +02:00
Christoph Lendenfeld
44fb4fa46a Animation: Merge Push/Relax Rest Pose operators
This patch merges the two operators `Push Pose from Rest Pose`
and `Relax Pose from Rest Pose` into one
new operator `Blend Pose with Rest Pose`

The operator has a default range of -1/1 with a default of 0.
The functionality of `Relax Pose from Rest Pose` is on the positive axis
and `Push Pose from Rest Pose` on the negative.
This is a breaking change so ideal for 4.0

Pull Request: https://projects.blender.org/blender/blender/pulls/108309
2023-07-20 09:27:06 +02:00
casey bianco-davis
1629eb61a1 GPv3: UI and RNA for layer opacity
Adds the UI for layer opacity in the layer panel.

Currently layer blending rendering is not implemented, so the last layer's opacity will affect all of the layers.

Pull Request: https://projects.blender.org/blender/blender/pulls/110177
2023-07-19 17:34:05 +02:00
Clément Foucault
cdb8a8929c GHOST: Delete Mac OpenGL support
The maximum OpenGL versions supported on mac
doesn't meet the minimum required version (>=4.3) anymore.

This removes all the OpenGL paths in GHOST
Cocoa backend and from the drop down menu in
the user preferences.

Pull Request: https://projects.blender.org/blender/blender/pulls/110185
2023-07-19 14:16:03 +02:00
nutti
308da08221 Docs: Fix layout of bpy.types.Object Python API documents
Fix the layout of Python API documents of bpy.types.Object.
2023-07-18 23:32:00 +10:00
Jeroen Bakker
6a3c865129 Cleanup: Make format 2023-07-18 12:04:13 +02:00
Amelie
d9277b19f3 GPv3: Stroke smoothing operator
Implementation of the smoothing operator for grease pencil strokes.
Works on `CurvesGeometry` position and other attributes, such as radius.

Based on the gaussian blur like algorithm in `BKE_gpencil_stroke_smooth_point` by Henrik Dick.

Pull Request: https://projects.blender.org/blender/blender/pulls/109635
2023-07-18 11:54:34 +02:00
Jeroen Bakker
03ead30027 Eevee-next: Reflective Light Baking
This PR introduces baking reflective light from light probes. Light probes
are baked on the fly when the light probe data has changed. It doesn't update
directly when other scene data is changed in the viewport.

When doing image rendering the light probes are updated on each frame.

Currently the world probe and closest reflection probe are composited
together in shader. This allows different resolutions. We expect that we
eventually composite it before usage. This would improve the performance.
Unclear if we would support both compositing options eventually.

Pull Request: https://projects.blender.org/blender/blender/pulls/109909
2023-07-14 11:22:18 +02:00
Christoph Lendenfeld
7acd6e61ab Animation: Butterworth Smoothing filter
Implements the Butterworth Filter
(https://en.wikipedia.org/wiki/Butterworth_filter) for smoothing FCurves.

This filter is ideal for smoothing dense data, like motion capture recordings.
It has the advantage of keeping the shape of the curve
intact while reducing minimal fluctuations.
The disadvantage is the impulse response has a twang,
meaning extreme spikes cause fluctuations to either side.

The implementation is based on the GPL code found here:
https://exstrom.com/journal/sigproc/dsigproc.html

In order to avoid phase shifting, the filter is run forward and backward,
effectively doubling the filter order.

The Redo panel offers the following options

* Frequency Cutoff: 0-n value, where 0 means it cuts everything
so the curve will become straight, the max value is the Nyquist frequency
and depends on the frame rate and the "Samples per Frame" option

* Filter Order: Higher values mean the frequency cutoff is steeper

* Samples per Frame: Before the filter is applied, the curve is resampled
at this interval to avoid errors when there are uneven spaces between frames.
If the keys are on subframes, e.g. a 60fps file in a 30fps scene, increase this value to 2

* Blend: 0-1 value to blend between the original curve and the filter result

* Blend In/Out: The number of frames at the start and end for which
to blend between the filtered and unfiltered curve.
This can help reduce any resulting jumps in the animation at the selection border

The operator can be called from the Key menu. (Key->Smooth->Butterworth Smooth)

Pull Request: https://projects.blender.org/blender/blender/pulls/106952
2023-07-13 09:10:42 +02:00