GPv3: Brush radius unit option #120257

Merged
Falk David merged 29 commits from filedescriptor/blender:gpv3-scene-brush-size into main 2024-05-14 15:20:44 +02:00
Member

This implements and exposes the View/Scene brush radius option.

  • View: Brush units are in pixels. Zooming in and out in the viewport will make the brush stay the same size relative to the view, but grow/shrink relative to the scene.
  • Scene: Brush units are in meters. Zooming in and out in the viewport will make the brush grow/shrink relative to the view, but stay the same size relative to the scene.

The default radius unit is Scene, which is what GPv2 did.

The "2D Animation Template" was updated to disable using the radius in the unified paint settings. This means that using the template by default will use the brush radius, which also mimics the behavior of GPv2.

The user can change the radius brush unit from the Advanced panel.
image

This implements and exposes the `View`/`Scene` brush radius option. * `View`: Brush units are in pixels. Zooming in and out in the viewport will make the brush stay the same size relative to the view, but grow/shrink relative to the scene. * `Scene`: Brush units are in meters. Zooming in and out in the viewport will make the brush grow/shrink relative to the view, but stay the same size relative to the scene. The default radius unit is `Scene`, which is what GPv2 did. The "2D Animation Template" was updated to disable using the radius in the unified paint settings. This means that using the template by default will use the brush radius, which also mimics the behavior of GPv2. The user can change the radius brush unit from the `Advanced` panel. ![image](/attachments/e024c1c4-5b21-4159-b57e-68419d0d216b)
Falk David added 10 commits 2024-04-04 15:43:41 +02:00
Falk David added 1 commit 2024-04-08 14:51:03 +02:00
Falk David added 2 commits 2024-04-09 12:49:41 +02:00
Falk David added 4 commits 2024-04-30 16:22:24 +02:00
f9df4e585c Update 2D animation startup file
This makes sure to turn off the unified paint settings for the
brush size in the default `Scene`.

When loading the template, the draw tool uses the size
defined by the brush.
This is needed for GPv3, because we make use of the unified
paint settings, but don't want to use them when loading
the template.
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
116ddf21f9
Merge branch 'main' into gpv3-scene-brush-size
Falk David changed title from WIP: GPv3: Brush radius unit option to GPv3: Brush radius unit option 2024-04-30 16:32:32 +02:00
Falk David added 2 commits 2024-04-30 16:43:05 +02:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
92b3765444
Move brush conversion to `greasepencil::convert::legacy_main`
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR120257) when ready.
Falk David added this to the Grease Pencil project 2024-04-30 17:28:24 +02:00
Falk David requested review from Bastien Montagne 2024-04-30 17:58:13 +02:00

Everything worked very well in my tests, just two point to think about:

  1. When using scene units, having the radius size in meters (for example, 0.01 m) is not so user friendly for 2D artist. Maybe overrides the system units with millimeters or inches depending on the unit system could be a solution?

  2. Having the option to unify the Radius for all brushes was always a pending task. is now the right time to implement it?

image

Everything worked very well in my tests, just two point to think about: 1. When using scene units, having the radius size in meters (for example, 0.01 m) is not so user friendly for 2D artist. Maybe overrides the system units with millimeters or inches depending on the unit system could be a solution? 2. Having the option to unify the Radius for all brushes was always a pending task. is now the right time to implement it? ![image](/attachments/36c9e81c-5b70-44a0-a06a-85cac279f60f)
3.0 KiB
Author
Member

@mendio Thanks for testing!

  1. I worked on this a bit, but it's tricky to get right. What I did is allow a prop to use the "adaptive" unit display. This is normally a setting for the whole scene, but in this case it's useful for just that prop. That aproach was not accepted though. We'd need more input from the UI module.
  2. This already works. It's just that the button is missing in the topbar. You can seit it in the tool settings in the side pane.
@mendio Thanks for testing! 1. I worked on this a bit, but it's tricky to get right. What I did is allow a prop to use the "adaptive" unit display. This is normally a setting for the whole scene, but in this case it's useful for just that prop. That aproach was not accepted though. We'd need more input from the UI module. 2. This already works. It's just that the button is missing in the topbar. You can seit it in the tool settings in the side pane.
Bastien Montagne requested changes 2024-05-03 11:44:40 +02:00
Dismissed
Bastien Montagne left a comment
Owner

Only checked the versioning part for now.

Besides moving it to regular versioning, think you also need apply the same treatment to GP brushes in BLO_update_defaults_startup_blend.

And both of these versioning calls should be disabled until to full switch to GPv3 is done, since I do not see how to prevent invalid behaviors otherwise...

Only checked the versioning part for now. Besides moving it to regular versioning, think you also need apply the same treatment to GP brushes in `BLO_update_defaults_startup_blend`. And both of these versioning calls should be disabled until to full switch to GPv3 is done, since I do not see how to prevent invalid behaviors otherwise...
@ -2961,6 +2961,20 @@ void legacy_gpencil_object(Main &bmain, Object &object)
legacy_gpencil_object_ex(conversion_data, object);
}
static void legacy_gpencil_brushes(Main &bmain)

This should be part of the regular versioning code, it cannot be called here.

The main reason being, there is no way to prevent re-applying the conversion multiple time on the same data, since this code is executed outside of any fileversion control.

Further more, such basic conversion should be kept out of the do_versions_after_setup area - the less processing we have here, the better.

This should be part of the regular versioning code, it cannot be called here. The main reason being, there is no way to prevent re-applying the conversion multiple time on the same data, since this code is executed outside of any fileversion control. Further more, such basic conversion should be kept out of the `do_versions_after_setup` area - the less processing we have here, the better.
filedescriptor marked this conversation as resolved
Author
Member

After an in-person discussion with @mont29 about the versioning:

  • Since GPv2 doesn't use the affected brush settings at all (to be double-checked), the versioning should be done as part of the regular versioning code with a subversion bump. This can be done as part of the PR then and not have to wait.
  • Instead of changing the 2D Animation template binary blend file, this should be handled by BLO_update_defaults_startup_blend instead (also to be double checked).
After an in-person discussion with @mont29 about the versioning: * Since GPv2 doesn't use the affected brush settings at all (to be double-checked), the versioning should be done as part of the regular versioning code with a subversion bump. This can be done as part of the PR then and not have to wait. * Instead of changing the 2D Animation template binary blend file, this should be handled by `BLO_update_defaults_startup_blend` instead (also to be double checked).
  1. This already works. It's just that the button is missing in the topbar. You can seit it in the tool settings in the side pane.

haha...Great! just testing that and noticed that when turned on the unit system used change and also the default values for Radius and Strength

image

Scene radius unit should be the default for Grease Pencil brushes with 0.03 m radius, to get a line similar to the stroke primitive when you first draw. (Whether you use the 2D animation template or not)

image

> 2. This already works. It's just that the button is missing in the topbar. You can seit it in the tool settings in the side pane. haha...Great! just testing that and noticed that when turned on the unit system used change and also the default values for Radius and Strength ![image](/attachments/577bdb59-b45a-4ac1-8a05-ecb5e5e129e1) Scene radius unit should be the default for Grease Pencil brushes with 0.03 m radius, to get a line similar to the stroke primitive when you first draw. (Whether you use the 2D animation template or not) ![image](/attachments/3b9615b9-dbac-4061-8f7e-3b313a6442e1)
Falk David added 5 commits 2024-05-06 13:48:18 +02:00
Falk David added 2 commits 2024-05-07 13:32:33 +02:00
Author
Member

@mendio The presets now use the correct settings. But I can't change the default for the unified paint settings, so if you don't use the template, then the scene will use unified paint settings and the brush will be in view space.

Maybe what we need to do is also show the unified paint settings toggle in the top bar so that you can easily turn that off without needing to open the side panel.

@mendio The presets now use the correct settings. But I can't change the default for the unified paint settings, so if you don't use the template, then the scene will use unified paint settings and the brush will be in view space. Maybe what we need to do is also show the unified paint settings toggle in the top bar so that you can easily turn that off without needing to open the side panel.
Falk David requested review from Bastien Montagne 2024-05-07 13:36:04 +02:00
Falk David added 1 commit 2024-05-07 13:38:07 +02:00
Bastien Montagne approved these changes 2024-05-14 13:08:07 +02:00
Bastien Montagne left a comment
Owner

Versioning side of the PR looks good now, I believe the usability side of it has already been validated by the module, so LGTM.

Versioning side of the PR looks good now, I believe the usability side of it has already been validated by the module, so LGTM.
Falk David added 1 commit 2024-05-14 14:49:23 +02:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
aca997e86d
Merge branch 'main' into gpv3-scene-brush-size
Author
Member

@blender-bot build

@blender-bot build
Falk David added 1 commit 2024-05-14 14:53:30 +02:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
26751ea10a
Formatting
Author
Member

@blender-bot build

@blender-bot build
Falk David merged commit 5d7e785fdd into main 2024-05-14 15:20:44 +02:00
Falk David deleted branch gpv3-scene-brush-size 2024-05-14 15:20:46 +02:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
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
EEVEE & Viewport
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
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
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
EEVEE & Viewport
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
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
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 project
No Assignees
4 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#120257
No description provided.