Grease Pencil: Properly support brushes with draw mode primitive tools #127204

Merged
Julian Eisel merged 6 commits from JulianEisel/blender:temp-grease-pencil-draw-primitive-brush-tools into main 2024-09-16 13:04:25 +02:00

6 Commits

Author SHA1 Message Date
abdb6ba208 Update to work with changes merged from !125911 2024-09-16 12:55:19 +02:00
9363d6617a Merge branch 'main' into temp-grease-pencil-draw-primitive-brush-tools 2024-09-16 12:33:54 +02:00
5766091403 Fix error from merge conflict 2024-09-16 12:31:01 +02:00
9db2a55dc1 Merge branch 'main' into temp-grease-pencil-draw-primitive-brush-tools 2024-09-16 12:24:54 +02:00
10caa4a56f Avoid depending on #125911 2024-09-06 12:38:27 +02:00
4bbbb54f90 Grease Pencil: Properly support brushes with draw mode primitive tools
Since brush assets were merged, the brush asset selector and some other
brush UIs wouldn't show up for the primitive tools.

Turns out that these primitive tools were never tagged as using brushes
by setting the `data_block` member (or setting the `'USES_BRUSHES'`
option since blender/blender!125911). 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:
- Tool settings displayed twice. Removed the redundant UI definitions.
- Custom tool cursor would be overridden by brush cursor. Fixed by not
  activating brush cursors if tools have their own cursor defined.
- Interactions like mouse presses would not be registered by the tool,
  events were blocked by the grease pencil stroke keymap. Fixed by
  disabling the grease pencil stroke keymap while the primitive tools
  are active.
2024-09-06 12:03:35 +02:00