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

Open
Julian Eisel wants to merge 2 commits from JulianEisel/blender:temp-grease-pencil-draw-primitive-brush-tools into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Member

Part of blender/blender!125449.

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.
Part of blender/blender!125449. 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.
Julian Eisel added 1 commit 2024-09-05 19:21:40 +02:00
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.
Julian Eisel added this to the Brush Assets & Asset Shelf project 2024-09-05 19:22:22 +02:00
Julian Eisel force-pushed temp-grease-pencil-draw-primitive-brush-tools from dcfeb45ac9 to 4bbbb54f90 2024-09-06 12:04:22 +02:00 Compare
Julian Eisel added 1 commit 2024-09-06 12:39:02 +02:00
Julian Eisel requested review from Campbell Barton 2024-09-06 12:39:41 +02:00
Author
Member

The 'USE_BRUSHES' flags are commented out and there's a TODO comment. This is just so this doesn't depend on !125911 and compiles/runs without it. Pretend this wasn't the case for review :)

The `'USE_BRUSHES'` flags are commented out and there's a TODO comment. This is just so this doesn't depend on !125911 and compiles/runs without it. Pretend this wasn't the case for review :)
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u temp-grease-pencil-draw-primitive-brush-tools:JulianEisel-temp-grease-pencil-draw-primitive-brush-tools
git checkout JulianEisel-temp-grease-pencil-draw-primitive-brush-tools
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#127204
No description provided.