Commit Graph

5291 Commits

Author SHA1 Message Date
Julian Eisel
02fb605f8a Cleanup: Don't unset region visibility in unrelated WM function
`WM_draw_region_free()` should manage region-draw data, and not change
region state. This should be done by normal region state management
functions. Especially for a flag like `ARegion::visible` which is just
the cached result of the region's visibility evaluation, not the proper
way to actualy manage the region visibility.
2023-10-30 12:40:00 +01:00
Campbell Barton
dffee8b323 Revert "Revert "Fix #112441: Restore Key Map Item does not restore the active property""
This reverts commit 0f36ac4e66.

This revert was only done for testing and wasn't ment to be pushed.
2023-10-29 20:08:39 +11:00
Brecht Van Lommel
d7c2ef16fe Merge branch 'blender-v4.0-release' 2023-10-26 15:51:19 +02:00
Douglas Paul
c50b682858 Fix #114156: animation player assert on launch on macOS
Adds missing calls to GPU_render_begin and GPU_render_end,
required for Metal.

Pull Request: https://projects.blender.org/blender/blender/pulls/114157
2023-10-26 15:50:20 +02:00
Brecht Van Lommel
3832059c61 Merge branch 'blender-v4.0-release' into main 2023-10-25 16:21:13 +02:00
Brecht Van Lommel
a5cf5a00fb Fix #113849: animation player crash on launch on macOS
GPU backend detection was missing, causing it to try using the
non-existent OpenGL backend.

Thanks to Douglas Paul for helping identify the problem.
2023-10-25 16:19:44 +02:00
Campbell Barton
dbd7c5f35a WM: reduce noisy logging storing/loading operator properties
Don't log wm.operator operator properties when no properties
are stored/loaded, this was noisy, especially for the
INFO_OT_reports_display_update operator when runs from a timer.
2023-10-25 16:01:45 +11:00
Campbell Barton
be9b604190 WM: use a fake clipboard when simulating input
Allow simulated interactions to run without clobbering the users
clipboard text.
2023-10-25 15:51:22 +11:00
Campbell Barton
15692501b2 Merge branch 'blender-v4.0-release' 2023-10-24 23:35:15 +11:00
Campbell Barton
0f36ac4e66 Revert "Fix #112441: Restore Key Map Item does not restore the active property"
This reverts commit bb39f4fa41.
2023-10-24 23:35:06 +11:00
Campbell Barton
cdbde7d941 Fix #113603: User modified key-map preferences for add-ons don't load
Regression from [0] where the key-map was attempting to load preferences
for key-map items for add-on operators which were not yet defined.
Resolve by postponing keymap updating until after loading add-ons.

[0]: 6de294a191
2023-10-24 23:32:16 +11:00
Bastien Montagne
65a6350250 Merge branch 'blender-v4.0-release' 2023-10-23 12:13:57 +02:00
Damien Picard
c7a6ede996 Fix #113981: ID plural names using spaces instead of underscores
Translation markers `N_()` were added to IDs' plural names in !113912.
I also renamed some of those because I thought there were only display
names.

This commit reverts the renaming, leaving only the addition of the
markers.

Pull Request: https://projects.blender.org/blender/blender/pulls/114030
2023-10-23 12:05:28 +02:00
Campbell Barton
cdac2b813e Merge branch 'blender-v4.0-release' 2023-10-23 12:31:14 +11:00
Campbell Barton
d2b86610f0 Fix animation player continuing to playback audio when paused
Using arrow keys for frame stepping would keep playing back audio.
Also move play/pause to utility functions.
2023-10-23 12:20:44 +11:00
Campbell Barton
25ec651018 Cleanup: clarify naming for the animation player
The animation player used abbreviations in confusing ways:
`wait2` with no `wait1`, `indicator` without noting what was indicated,
`fstep` & `sstep` terms also weren't all that obvious.
Use clearer & more verbose names.
2023-10-23 11:49:17 +11:00
Campbell Barton
fd212e3f6c Merge branch 'blender-v4.0-release' 2023-10-23 11:28:04 +11:00
Campbell Barton
4b1d185887 Fix crash when the animation player fails to create a texture (take 2)
Alternate fix for [0], a crash when a texture fails to load since this
seems to cause animation playback to fail on WIN32, see #113849.

While I can't redo the error, the main change was setting up
`immVertexFormat` before calling `ocio_transform_ibuf`.

[0]: 34899ec13d.
2023-10-23 11:26:55 +11:00
Campbell Barton
a65f806658 Revert "Fix crash when the animation player fails to create a texture"
This reverts commit 34899ec13d.

This causes issues on WIN32 which I'm unable to reproduce.
Resolving the error with textures failing to load can be done with
fewer changes.
2023-10-23 11:25:13 +11:00
Campbell Barton
dcc6a9d73b Revert "Fix crash when the animation player fails to create a texture"
This reverts commit 34899ec13d.
2023-10-23 10:58:56 +11:00
Harley Acheson
fd63c01c4f Cleanup: Make format
Formatting changes resulting from Make Format
2023-10-21 18:06:50 -07:00
Falk David
eab204b0a4 Fix: GPv3: Radial brush size control broken
Since 07749b38 the hack in the radial control code is no longer needed,
because the brush is in screen space (pixels) anyway.
2023-10-21 17:49:27 +02:00
Campbell Barton
a398de672a Merge branch 'blender-v4.0-release' 2023-10-21 20:40:20 +11:00
Campbell Barton
b592e5c69a Fix error in animation player arguments (font_id & frame_step swapped)
Regression in [0], even though this doesn't seem to cause problems,
the arguments were obviously wrong.

[0]: 4f3e2ee857
2023-10-21 20:34:15 +11:00
Sergey Sharybin
85c557ffa2 Cleanup: Rename BLI_string_utils.h to BLI_string_utils.hh
All users of it are now C++, which opens doors to add C++ to the
public API.
2023-10-20 10:27:26 +02:00
Bastien Montagne
3aa5644751 Merge branch 'blender-v4.0-release' 2023-10-19 21:42:26 +02:00
Damien Picard
e3fc935349 I18n: disambiguate and extract a few messages
Extract:
- Sculpt filter types from the Sculpt menu. Some of these types use a
  custom label, different  from those defined in the operator RNA,
  which was never extracted.
- "Today" and "Yesterday" from the file browser modification date.
- All name_plural from IDs, as these are used in the UI to list which
  data block is to be removed, when calling outliner.orphans_purge.

Disambiguate:
- "Area", meaning the measurement of a surface as opposed to a place.

Some messages reported by Satoshi Yamasaki in #43295.

Pull Request: https://projects.blender.org/blender/blender/pulls/113912
2023-10-19 21:39:58 +02:00
Sergey Sharybin
8c0446981d Cleanup: Fix -Wformat in playanim
Depending on compiler and bitness, size_t and uint64_t can be different
types. Since uint64_t format is used explicitly cast size_t to uint64_t
to solve compiler warning.

Happens with Clang 15 on macOS.
2023-10-19 10:26:38 +02:00
Campbell Barton
a38a49b073 GHOST/Wayland: IME support using the text-input protocol
Tested with IBUS on GNOME 45.
Added a capabilities flag to GHOST since support for IME works on
Wayland but not on X11, so runtime detection is needed.
2023-10-19 17:29:32 +11:00
Bastien Montagne
c5a408f5a1 WM Jobs: Add job's own reporting mechanism.
wmJob's shared data (with their worker threads), #wmJobWorkerStatus, now
also contains a #ReportList pointer.

Job worker code is now expected to use `BKE_report` APIs to populate this
new shared reportlist, instead of calling the (absolutely) not
thread-safe `WM_reports` API. This will be tackled in later commits.

Note that since commit 9859622a66, #ReportList and `BKE_report` API
is now thread-safe, so no further handling for this is required in the
wmJob code itself.

The periodic wmJob update handling (done through timers currently)
takes care of moving reports from the job data to the WM data.

Implements #112537.

Pull Request: #113548.
2023-10-18 12:48:52 +02:00
Bastien Montagne
9727373821 WM Reports: Add public API to move reports from a ReportList to WM one.
There was already such a `wm_add_reports` function, but it was private.
It is now available in the public API, and renamed to
`WM_reports_from_reports_move`.
2023-10-18 12:48:52 +02:00
Omar Emara
9f1538b586 Cleanup: Move compositor headers to c++
Pull Request: https://projects.blender.org/blender/blender/pulls/113758
2023-10-16 10:45:54 +02:00
Harley Acheson
1423ece1eb Cleanup: Compilation Error in wm_playanim.cc
If compiling without WITH_AUDASPACE a structure contains too many
initializers. Caused by 4454561a5f
2023-10-15 07:56:11 -07:00
Campbell Barton
46dedaf960 Cleanup: use C++ style casts in for the animation player 2023-10-15 15:04:35 +11:00
Campbell Barton
a3243cf5c3 PlayAnim: errors loading images are now shown in the UI
It's unlikely most users will see these messages in the stdout,
show them after the filepath as well as logging them.
2023-10-15 15:04:32 +11:00
Campbell Barton
63cb5ec1b2 Cleanup: use full sentences for comments in playanim 2023-10-15 15:04:30 +11:00
Campbell Barton
4454561a5f Cleanup: move animation globals into a struct
Avoid having many top-level static variables, make these more clearly
global by moving them into a struct.

Also use less cryptic terms for members.
2023-10-15 15:04:28 +11:00
Campbell Barton
492653e52d Cleanup: move PlayAnimPict from a global into PlayState
Avoid having as many globals, preferring PlayState where possible.
2023-10-15 15:04:27 +11:00
Campbell Barton
e6b9465601 Cleanup: reduce indentation for the animation player argument parsing 2023-10-15 15:04:25 +11:00
Campbell Barton
e6933e526c PlayAnim: place the indicator closest to the mouse cursor
The indicator placement was always rounded to the left.
2023-10-14 17:14:14 +11:00
Campbell Barton
f9b403c349 Cleanup: comments, reduce variable scope 2023-10-14 17:02:43 +11:00
Campbell Barton
286c893df7 PlayAnim: support dropping multiple files at once
Previously only a single file was supported (only the first file was
used), now all files are loaded.
2023-10-14 16:04:38 +11:00
Campbell Barton
b1cd144d7e PlayAnim: don't expand sequences when passing in multiple files
Only expand image sequences when a single file is passed in.
This allows shell globing to expand images without expanding each.

Prepare for support multiple file drag & drop where it also doesn't
make sense to expand sequences when dropping multiple files.
2023-10-14 16:00:56 +11:00
Campbell Barton
e23cb0c743 Cleanup: simplify animation player argument handling
The first argument was always ignored, this added a minor complication
to drag & drop as the new argument needed to have a dummy first argument.
2023-10-14 16:00:54 +11:00
Bastien Montagne
9859622a66 BKE_reports: make the API thread-safe.
This commit makes using (most of) `BKE_report` API safe in
multi-threaded situation.

This is achieved by adding a `std::mutex` lock to the `ReportList`
struct (in a slightly convoluted way unfortunately, due to this being a
DNA struct). This lock is then used to make most operations on
`Reportlist` data thread-safe.

Note that while working on this, a few other minor issues aroze in
existing usages of Reportlist by the WM code, mainly the fact that
`wm_init_reports` and `wm_free_reports` were both useless:
  - init was called in a context where there is not yet any WM, so it
    was doing nothing.
  - free was called on a WM that would be later freed (as part of Main
    freeing), which would also call cleanup code for its `reports` data.
Both have been removed.

Further more, `wm_add_default` (which is the only place where a WM ID is
created) did not initialize properly it reports data, this has been
fixed.

This change is related to the wmJob thread-safety tasks and PRs (#112537,
!113548).

Pull Request: https://projects.blender.org/blender/blender/pulls/113561
2023-10-13 11:29:59 +02:00
Campbell Barton
91c5eca81f Fix crash dragging images into the animation player
Resolve issues with the animation player drag & drop.

- IMB_exit ran before attempting to load the dropped image,
  crashing when the image was loaded.
- The old event consumer wasn't removed from the system
  causing events to be processed that accessed freed stack memory.
2023-10-13 17:51:53 +11:00
Campbell Barton
51467b0611 Fix crash dragging images into the animation player
Resolve issues with the animation player drag & drop.

- IMB_exit ran before attempting to load the dropped image,
  crashing when the image was loaded.
- The old event consumer wasn't removed from the system
  causing events to be processed that accessed freed stack memory.
2023-10-13 17:49:36 +11:00
Campbell Barton
08e5f94a70 Fix #113309: Broken key-map after "Reload Scripts"
Regression caused by [0]. Resolve by adding a 'keep_properties' argument
to KeyConfig.update so the key-map items can be restored after the
operators have been reloaded.

[0]: 88a875ec3a
2023-10-13 14:37:48 +11:00
Campbell Barton
604c0d8d5c Cleanup: add "_data" suffix to wm_keymap_item_free
Clarify that the wmKeyMapItem it's self isn't freed.
2023-10-13 14:37:48 +11:00
Campbell Barton
63586d0f6b Fix #113309: Broken key-map after "Reload Scripts"
Regression caused by [0]. Resolve by adding a 'keep_properties' argument
to KeyConfig.update so the key-map items can be restored after the
operators have been reloaded.

[0]: 88a875ec3a
2023-10-13 14:37:07 +11:00