Commit Graph

6055 Commits

Author SHA1 Message Date
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
Campbell Barton
3e26a1a39c Cleanup: set WITH_INPUT_IME=OFF when unsupported
This avoids having to do platform checks before checking WITH_INPUT_IME.
2023-10-18 22:04:25 +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
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
845f7f6d44 Cleanup: move AudaSpace members into their own struct
Avoid having common terms like 'source' as static variables.
2023-10-13 12:10:10 +11:00
Campbell Barton
432bef802f Cleanup: use early returns in wm_window_title
Also avoid unnecessary std::string creation.
2023-10-13 11:22:01 +11:00
Campbell Barton
3488533ac3 Merge branch 'blender-v4.0-release' 2023-10-13 10:31:50 +11:00
Campbell Barton
e86fbcd4f0 Merge branch 'blender-v4.0-release' 2023-10-13 10:31:44 +11:00
Campbell Barton
df108825c0 Fix subtle path handling bugs caused by recent changes to the title
Resolve issues with corner-cases introduced by [0].

- Comparing the filename & filepath was no longer a valid way to check
  for a directory component since the extension was stripped.
- Use BLI_path_extension_or_end which doesn't confuse extensions with
  the dot from hidden files.

The variable name include_directory was also misleading.

[0]: 1a648f5b22
2023-10-13 10:29:55 +11:00
Campbell Barton
fb58aa5900 Cleanup: typos, duplicate words 2023-10-13 10:21:06 +11:00
Julian Eisel
dab7ac1739 Refactor: Make drop-box callbacks more general, not drawing specific
These callbacks were named for the purpose of drawing (and that's probably
their main use case still), but nothing limits them to be used for that only.
They can be useful for non-drawing related things, essentially they act as
drop-box entering and exiting event handlers. Reflect that in the name, so also
more clear when they will be called, as opposed to what they are typically used
for. Drop-boxes already have such event handler callbacks, this makes their API
naming more consistent.
Also better differentiates between drawing and handling callbacks, the
difference matters (attempting to draw during handling won't work).
2023-10-12 18:39:24 +02:00
Harley Acheson
56aa7f58e9 Merge branch 'blender-v4.0-release' 2023-10-12 07:58:44 -07:00
Harley Acheson
1a648f5b22 UI: Window Title Blender Path Changes
Do not show extension of initial name, and include full file name
in the path section.

Pull Request: https://projects.blender.org/blender/blender/pulls/113560
2023-10-12 16:56:56 +02:00
Christoph Lendenfeld
3792c2720d Refactor: remove ED_ prefix from autokeying functions
No functional changes

Since the functions now live in a namespace,
they no longer need the prefix

as a result there are now 2 functions named
`autokeyframe_object`
which is fine because they take different parameters

If both are needed is for a future patch to investigate

Pull Request: https://projects.blender.org/blender/blender/pulls/113612
2023-10-12 16:32:29 +02:00
Christoph Lendenfeld
a3831fe7af Refactor: Move autokeyframing functions to animrig
No functional changes

The following functions have been moved
`autokeyframe_cfra_can_key`
`autokeyframe_object`
`ED_autokeyframe_object`
`ED_autokeyframe_pchan`
`ED_autokeyframe_property`

they are all in a new file
keyframing_auto.cc
while the declarations are in
ANIM_keyframing.cc

The autokeyframe makros also have been moved

Pull Request: https://projects.blender.org/blender/blender/pulls/113607
2023-10-12 15:44:58 +02:00
Campbell Barton
69f437c061 Cleanup: remove redundant call to BLI_freelistN 2023-10-13 00:05:47 +11:00
Campbell Barton
1c9eae982a Merge branch 'blender-v4.0-release' 2023-10-13 00:04:16 +11:00
Campbell Barton
59db44ad65 Fix animation player failing to play back JPEG 2000 image sequences 2023-10-13 00:02:02 +11:00
Campbell Barton
82105bc408 Merge branch 'blender-v4.0-release' 2023-10-12 23:42:30 +11:00
Campbell Barton
78d1e9f48c Merge branch 'blender-v4.0-release' 2023-10-12 23:42:27 +11:00
Campbell Barton
63e9de4992 Fix memory leak in the animation player when videos have no duration 2023-10-12 23:41:10 +11:00
Campbell Barton
d0507470c0 Fix crash in the animation player when a video file fails to load 2023-10-12 23:41:10 +11:00
Campbell Barton
2316b73a1d Merge branch 'blender-v4.0-release' 2023-10-12 17:23:57 +11:00
Campbell Barton
4ea76b8530 Fix #113273: Status bar not refreshed when canceling the operation
Resolve regression in [0].

[0]: 42f8b49581
2023-10-12 17:21:34 +11:00
Campbell Barton
b4504c7840 Cleanup: spelling in comments 2023-10-12 16:03:18 +11:00
Campbell Barton
1eabc2d4cd Merge branch 'blender-v4.0-release' 2023-10-12 16:00:26 +11:00
Campbell Barton
4e4fc8c276 Fix #107523: Cursor not cleared when panning stops 2023-10-12 15:59:22 +11:00
Harley Acheson
e00bd55576 Merge branch 'blender-v4.0-release' 2023-10-11 08:26:58 -07:00
Harley Acheson
1b28b79768 Revert: Fix #111666: Hide Mouse in Redo Panel Inputs #113428
Reverting this as Campbell would prefer a solution that does not
involve modal cursors.

Pull Request: https://projects.blender.org/blender/blender/pulls/113551
2023-10-11 17:25:38 +02:00
Brecht Van Lommel
46d32d8966 Merge branch 'blender-v4.0-release' into main 2023-10-10 15:36:39 +02:00
Brecht Van Lommel
478e1ab6d3 Fix build error on Windows after BLI_read changes
Don't use posix-only ssize_t in platform independent code.

Pull Request: https://projects.blender.org/blender/blender/pulls/113493
2023-10-10 15:36:15 +02:00
Campbell Barton
028c4b440c Merge branch 'blender-v4.0-release' 2023-10-10 22:28:53 +11:00