Commit Graph

6297 Commits

Author SHA1 Message Date
Thomas Dinges
31eaa2f5ba Merge branch 'blender-v4.1-release' 2024-03-20 08:38:41 +01:00
Jason Fielder
3c25b079ce Fix #109739: Resolve greyed out UI on MacOS
UI would sometimes disappear with the Metal backend.
This occured in situations where there was only a single
GPUContext within a single GHOST window, meaning
the activation routine for the context was never run.

Context activation is required to ensure the backbuffer
was up to date upon resize. Otherwise, re-sizing the
window would cause the screen to turn grey as the
new drawables would not be rendered to.

Authored by Apple: Michael Parkin-White

Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/119299
2024-03-20 08:33:29 +01:00
Campbell Barton
ee64778cac Cleanup: code-comments for struct ID's and use backtick quotes
- Prefix comments before members is used practically everywhere,
  remove C99 syntax from inside comments.
- Replace double quotes with backticks for code styling.
2024-03-20 14:43:35 +11:00
Hans Goudey
62b484544a Fix: Operator depends on cursor ignores macro operators
The change in 23ebc45f70 was slightly incorrect.
2024-03-19 11:58:46 -04:00
Brecht Van Lommel
7a395e2e7f Revert changes from main commits that were merged into blender-v4.1-release
The last good commit was f57e4c5b98.

After this one more fix was committed, this one is preserved as well:
67bd678887.
2024-03-18 15:04:12 +01:00
Brecht Van Lommel
b8ea467475 Merge branch 'blender-v4.1-release' 2024-03-16 19:45:51 +01:00
Guillermo Venegas
1058006e03 Fix #119549: Avoid resetting properties tagged as SKIP_PRESET
Excludes properties tagged as `SKIP_PRESET` from being reset.

Pull Request: https://projects.blender.org/blender/blender/pulls/119550
2024-03-16 19:34:49 +01:00
Harley Acheson
a4a26bf90d UI: Small Confirmation Position
For small confirmations that appear at mouse position, change the
position slightly so that the mouse pointer is less likely to obscure
the confirm button text.

Pull Request: https://projects.blender.org/blender/blender/pulls/119536
2024-03-15 19:52:46 +01:00
Sean Kim
2e6a8ae49c Cleanup: Add docs to lasso and line gesture
This PR adds an explanation to the Lasso Gesture doxygen
section of the generic `wm_gesture_ops.cc` file.

Pull Request: https://projects.blender.org/blender/blender/pulls/119490
2024-03-15 00:27:12 +01:00
Harley Acheson
7a13f0a14d Merge branch 'blender-v4.1-release' 2024-03-14 09:23:14 -07:00
Harley Acheson
479342b1cf UI: Correct Splash RGB Image Corner Rounding
Our splash screen rounds the top corners of the featured image. However
this requires an alpha channel, so an RGB image will not look rounded.
This PR just ensures a 32 plane count.

Pull Request: https://projects.blender.org/blender/blender/pulls/119473
2024-03-14 17:22:22 +01:00
Harley Acheson
7852e0a551 Merge branch 'blender-v4.1-release' 2024-03-13 15:02:59 -07:00
Guillermo Venegas
1640121a63 Fix #119183: Use valid style for popup text size calculation
The current font style can be overridden with a input or other widget text style,
this change ensures that the right font style is set so `BLF_width` don't use a
overridden font text style.

Pull Request: https://projects.blender.org/blender/blender/pulls/119442
2024-03-13 23:01:58 +01:00
Harley Acheson
443ea628c5 UI: Changes to Small Operator Confirmations
Small operator confirmations get separate confirm and cancel buttons,
better descriptions and configurable confirm button text. But still
popup at cursor location and can be cancelled with mouse movement.

Pull Request: https://projects.blender.org/blender/blender/pulls/118346
2024-03-12 23:12:45 +01:00
Sean Kim
68afd22501 Sculpt: Add Lasso Hide tool
This commit adds the `SCULPT_OT_hide_show_lasso_gesture` and the
corresponding Lasso Hide tool.

* Exposes the selection type for both the lasso and box hide tools
  as a option in the header
* Adds functionality into `sculpt_gesture.cc` for handling lasso
  selections with the `Outside` selection type

For `SelectionType::Outside`, the current implementation opts to not
do any filtering on the PBVH node level due to cases where the node
is mostly covered by a single gesture.

Addresses one of the tools in #80390

Pull Request: https://projects.blender.org/blender/blender/pulls/119140
2024-03-12 14:19:02 +01:00
Hans Goudey
23ebc45f70 WM: Add dynamic callback version of operator "depends on cursor" flag
For node tools, I would like to give the option of invoking the operator from the
menu, but waiting for a mouse click for the future "Mouse Position" node. Not
all node tools should do that though, and they all use the same operator type,
so it needs to depend on an operator callback. That's implemented here.

Pull Request: https://projects.blender.org/blender/blender/pulls/118983
2024-03-11 19:23:16 +01:00
Campbell Barton
443e9cba90 Cleanup: unused includes 2024-03-11 14:42:18 +11:00
Campbell Barton
91229f0e16 Cleanup: use full sentences for comments in transform & windowmanager 2024-03-09 23:28:03 +11:00
Campbell Barton
8cbb57ee0a CLI: suppress noisy prints when running commands
Messages such as "Blender quit" get in the way of custom commands,
add G.quiet to suppress noisy "info" prints.
2024-03-08 13:27:29 +11:00
Campbell Barton
75b6dbd132 WM: move prints for loading startup & preferences to logging
Now messages for loading the preferences are logged instead of printed,
with additional logging for the startup file.
Access with the argument --log "wm.files"

Custom command-line actions would print that the preferences were
loading which distracts from the commands output.

Regular blend files loading still prints a message.
2024-03-08 13:27:27 +11:00
Campbell Barton
9372e0dfe0 CLI: support defining custom commands via C++ & Python API
Add support for add-ons to define commands using the new argument
`-c` or `--command`.

Commands behave as follows:

- Passing in a command enables background mode without the need to pass
  in `--background`.
- All arguments following the command are passed to the command
  (without the need to use the `--` argument).
- Add-ons can define their own commands via
  `bpy.utils.register_cli_command` (see examples in API docs).
- Passing in `--command help` lists all available commands.

Ref !119115
2024-03-08 11:10:13 +11:00
Campbell Barton
9dd3f74c85 UI: minor tweaks to full-stop in messages
Use a full-stop after the quoted button name, also wrap strings
in a more readable way.
2024-03-08 10:26:51 +11:00
Hans Goudey
744f3b2823 Cleanup: Grammar in comments: Fix uses of "own"
"Own" (the adjective) cannot be used on its own. It should be combined
with something like "its own", "our own",  "her own", or "the object's own".
It also isn't used separately to mean something like "separate".

Also, "its own" is correct instead of "it's own" which is a misues of the verb.
2024-03-07 16:23:35 -05:00
Hans Goudey
72758f3296 Cleanup: Use FunctionRef for IDRemapper callback
This avoids the need for a separate argument struct in a few cases
and generally makes the remapping friendlier to use with lambdas.
2024-03-07 09:30:22 -05:00
Harley Acheson
6618755912 UI: Improvements to Confirmation of Save Startup
A more informative confirmation dialog to confirm that the user wishes
to save new default startup file.

Pull Request: https://projects.blender.org/blender/blender/pulls/117152
2024-03-07 00:19:31 +01:00
Harley Acheson
00b4fdce2c UI: Improvements to Confirmation of Load Factory
A more informative confirmation dialog to confirm that the user wishes
to load factory startup and settings.

Pull Request: https://projects.blender.org/blender/blender/pulls/117153
2024-03-06 23:25:52 +01:00
Harley Acheson
3bacd93ba6 UI: Improvements to Confirmation of Load Factory Preferences
A more informative confirmation dialog to confirm that the user wishes
to load factory user preferences.

Pull Request: https://projects.blender.org/blender/blender/pulls/117151
2024-03-06 22:57:36 +01:00
Harley Acheson
77e84cb528 Merge branch 'blender-v4.1-release' 2024-03-05 12:18:09 -08:00
Harley Acheson
49c723e117 Fix #118765: Show Startup Popup Warning on Main Window
During startup, popup block warnings should be displayed on the main
window, not a child window even if it is active.

Pull Request: https://projects.blender.org/blender/blender/pulls/119096
2024-03-05 21:16:35 +01:00
Harley Acheson
615edb3f3c UI: Props Dialog Default Properties
Allow activating numerical buttons upon opening of props dialogs. Set
defaults for some dialogs where appropriate.

Pull Request: https://projects.blender.org/blender/blender/pulls/119007
2024-03-05 18:54:50 +01:00
Hans Goudey
25ad66cb4c Merge branch 'blender-v4.1-release' 2024-03-05 11:58:23 -05:00
Hans Goudey
6181341bad Fix #119091: Incorrect path for WM context RNA property
Mistake in 61fb2b17c8
2024-03-05 11:57:22 -05:00
Hans Goudey
5993c517bd Cleanup: Use C++ Array, Span, int2 for lasso coords 2024-03-05 11:29:04 -05:00
Hans Goudey
164eb3c25b Cleanup: Move lasso utility files to C++ 2024-03-05 10:23:11 -05:00
Hans Goudey
840307c59a Fix: Build error on MSVC after recent cleanup, make format
captured structured bindings are a C++20 extension [-Wc++20-extensions]
2024-03-01 14:54:01 -05:00
Hans Goudey
d29ce3d531 UI: Remove uiBut a1 and a2 values
Over the last couple years (!) UI buttons have moved to derived classes,
meaning we don't need to use the same "a1" and "a2" variables to store
different information. At this point, that information is set specifically
by internal UI code, or functions like `UI_but_*_set`.

These values are only set to their default 0 values now (or -1 in some
non-meaningful cases). This commit removes the values from buttons
and removes the remaining a1 and a2 arguments from the UI API.
2024-03-01 14:27:57 -05:00
Hans Goudey
0e2fed5a57 Refactor: UI: Avoid a1 and a1 values for search button preview grid size 2024-02-29 22:39:37 -05:00
Hans Goudey
0b912c93af Cleanup: Remove unused WM search invoke previews function
The last use of this function was removed 6 years ago.
2024-02-29 22:39:37 -05:00
Jacques Lucke
efb511a76d Core: remove support for writing MemFile undo steps as .blend files
In many modes, Blender uses the `MemFile` undo step, which serializes all DNA
data in RAM almost as if writing a .blend file. For auto-save, Blender used to
write the last `MemFile` undo step to disk because that was faster serializing
all of DNA again. Furthermore, saving the `quit.blend` file when closing Blender
also used this.

This functionality is now removed in preparate for supporting implicit sharing
in the undo system (#106903). Auto-save and saving the quit.blend file now use
regular file saving.

The removal of this feature and its implications have also been discussed here:
https://devtalk.blender.org/t/remove-support-for-saving-memfile-undo-steps-as-blend-files-proposal/33544
2024-02-29 17:04:44 +01:00
Jacques Lucke
41b10424c7 WM: explicitly skip auto-save when in modes that don't support it
Auto-save currently only really works in modes that use the `MemFile` undo step,
that excludes things like mesh edit and sculpt mode. Previously, Blender would
attempt to auto-save in those modes, but it would only save the last state from
before the mode was entered, which is useless when staying in the mode for longer.

This problem is *not* fixed here. However, the code now explicitly skips auto-saving
in order to avoid unnecessary short freezes in these modes when Blender auto-saves.
Furthermore, the auto-save will now happen when changing modes.

This reduces the impact of save-time-regressions with #106903.

Pull Request: https://projects.blender.org/blender/blender/pulls/118892
2024-02-29 13:14:58 +01:00
Bastien Montagne
de5451b112 Cleanup: Move BKE_anim_data header to be fully C++. 2024-02-28 11:51:03 +01:00
Harley Acheson
da378e4d30 UI: Changes to Props Dialogs
Improved titles and confirm button text for 15 props dialogs.

Pull Request: https://projects.blender.org/blender/blender/pulls/118640
2024-02-27 20:19:33 +01:00
Campbell Barton
63a295f307 Merge branch 'blender-v4.1-release' 2024-02-27 17:03:48 +11:00
Campbell Barton
b16ef496a6 Fix #113479: Crash on script error after calling modal_handler_add()
Operators that added themselves as modal handlers would crash if there
was a Python exception in the script before returning.

Now modal handlers are removed an exception occurs in exec & invoke
operator callbacks.
2024-02-27 16:38:01 +11:00
Campbell Barton
523909dd73 Merge branch 'blender-v4.1-release' 2024-02-27 13:10:12 +11:00
Campbell Barton
fe8e27ad17 Fix #116680: Crash disabling an add-on used in the file-selector
Clear SpaceFile::op pointer when unregistering an operator to
prevent a use after free error.
2024-02-27 13:04:38 +11:00
Campbell Barton
2303df95b0 Merge branch 'blender-v4.1-release' 2024-02-22 22:15:43 +11:00
Campbell Barton
20c729b902 Fix missing info space redraw when modal operators report while running 2024-02-22 22:12:02 +11:00
Hans Goudey
1844ae2d0b Fix: Missing keymap for paint operators in curves sculpt mode 2024-02-21 10:34:27 -05:00
Brecht Van Lommel
0f2064bc3b Revert changes from main commits that were merged into blender-v4.1-release
The last good commit was 4bf6a2e564.
2024-02-19 15:59:59 +01:00