GPv3: Overlay for Weight Paint mode #118273

Merged
Falk David merged 14 commits from SietseB/blender:gpv3-weight-paint-overlay into main 2024-04-23 18:23:49 +02:00
Member

This PR implements the viewport overlay for Weight Paint mode in GPv3.

In Weight Paint mode the stroke points are colored depending on their
weights in the active vertex group.

GPv3 Weight Paint mode overlay.png

This PR implements the viewport overlay for Weight Paint mode in GPv3. In Weight Paint mode the stroke points are colored depending on their weights in the active vertex group. ![GPv3 Weight Paint mode overlay.png](/attachments/2643a941-09a6-4a57-96bf-cf0cc31d1d15)
Sietse Brouwer added 5 commits 2024-02-14 14:19:45 +01:00
Sietse Brouwer added this to the Grease Pencil project 2024-02-14 14:20:00 +01:00
Sietse Brouwer requested review from Falk David 2024-02-14 14:20:32 +01:00
Member

@fclem I'm not sure about the approach of reusing the selection buffers to fill the weight values with. What's your opinion on that?

@fclem I'm not sure about the approach of reusing the selection buffers to fill the weight values with. What's your opinion on that?
Sietse Brouwer added 1 commit 2024-02-23 20:51:52 +01:00
Clément Foucault approved these changes 2024-02-25 15:22:28 +01:00
Clément Foucault left a comment
Member

I guess that's fine. This patch is only making the edit point follow the edit strand shader.

The only issue I see with that is that you are loosing the selection state visibility. It is an issue with particle edit since only the selected points can be painted on. I don't know how it maps to GPencil on that subject. But I would rather see the behavior unified.

So I'm ok with the patch as it is, but consider the UX of different mode behaving differently.

I guess that's fine. This patch is only making the edit point follow the edit strand shader. The only issue I see with that is that you are loosing the selection state visibility. It is an issue with particle edit since only the selected points can be painted on. I don't know how it maps to GPencil on that subject. But I would rather see the behavior unified. So I'm ok with the patch as it is, but consider the UX of different mode behaving differently.
Falk David requested changes 2024-02-26 15:45:41 +01:00
Dismissed
Falk David left a comment
Member

Added a few comments.

Added a few comments.
@ -8,0 +9,4 @@
vec3 weight_to_rgb(float t)
{
if (t == no_active_weight) {
Member

Couldn't this be -1 instead ?

Couldn't this be `-1` instead ?

IIRC This was specifically chosen to be a very uncommon value to be able to detect invalid weights around valid range of |0..1]. Maybe @angavrilov will remember exactly why.

IIRC This was specifically chosen to be a very uncommon value to be able to detect invalid weights around valid range of |0..1]. Maybe @angavrilov will remember exactly why.
Member

But it's just used as "the color when there is no weight for this vertex". Seems weird to try and use a random value for this.

But it's just used as "the color when there is no weight for this vertex". Seems weird to try and use a random value for this.
Member

Anyway, since this is used the same way in other places, seems better to refactor it separately if at all.

Anyway, since this is used the same way in other places, seems better to refactor it separately if at all.
filedescriptor marked this conversation as resolved
@ -212,0 +297,4 @@
const int def_nr = BLI_findstringindex(
&curves.vertex_group_names, active_defgroup_name, offsetof(bDeformGroup, name));
const Span<MDeformVert> dverts = curves.deform_verts();
const VArray<float> weights = (def_nr < 0 || layer.is_locked()) ?
Member

Hm I think we should just use the attributes API here.

const VArray<float> weights = *curves.attributes().lookup_or_default<float>(active_defgroup_name, bke::AttrDomain::Point, no_active_weight);
Hm I think we should just use the attributes API here. ``` const VArray<float> weights = *curves.attributes().lookup_or_default<float>(active_defgroup_name, bke::AttrDomain::Point, no_active_weight); ```
SietseB marked this conversation as resolved
Sietse Brouwer added 1 commit 2024-02-26 23:27:19 +01:00
Author
Member

@filedescriptor Not entirely sure about the status of this one... Should I give my two cents on the no_active_weight matter? Or change something in the PR?

@filedescriptor Not entirely sure about the status of this one... Should I give my two cents on the `no_active_weight` matter? Or change something in the PR?
Member

@SietseB No changes are needed. Because I'm working on changing the render engine, all the PRs that touch rendering are held hostage right now 😅

@SietseB No changes are needed. Because I'm working on changing the render engine, all the PRs that touch rendering are held hostage right now 😅
Lukas Tönne approved these changes 2024-03-19 11:16:04 +01:00
Member

There is a complier warning

blender/source/blender/draw/intern/draw_cache_impl_grease_pencil.cc:297:29: warning: variable ‘dverts’ set but not used [-Wunused-but-set-variable]
  297 |     const Span<MDeformVert> dverts = curves.deform_verts();
      |                             ^~~~~~

Looks like that line can just be removed.

There is a complier warning ``` blender/source/blender/draw/intern/draw_cache_impl_grease_pencil.cc:297:29: warning: variable ‘dverts’ set but not used [-Wunused-but-set-variable] 297 | const Span<MDeformVert> dverts = curves.deform_verts(); | ^~~~~~ ``` Looks like that line can just be removed.
Sietse Brouwer added 2 commits 2024-03-19 16:01:52 +01:00
Author
Member

I removed the bread crumb 😉

I removed the bread crumb :wink:
Sietse Brouwer added 2 commits 2024-04-02 18:52:24 +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
61248b8ac2
Cleanup after merge with main
Falk David approved these changes 2024-04-08 11:29:35 +02:00
Member

@blender-bot build

@blender-bot build
Sietse Brouwer added 1 commit 2024-04-09 10:38:52 +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
06123bbadf
Cleanup: make format on .glsl
Member

@blender-bot build

@blender-bot build
Falk David added 2 commits 2024-04-23 18:00:44 +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
2348995341
Merge changes
Member

@blender-bot build

@blender-bot build
Falk David merged commit 7b3e063704 into main 2024-04-23 18:23:49 +02:00
Sietse Brouwer deleted branch gpv3-weight-paint-overlay 2024-04-23 18:54:48 +02:00
Sign in to join this conversation.
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#118273
No description provided.