GPv3: Vertex Paint Mode #125674
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
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 project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#125674
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "filedescriptor/blender:gpv3-vertex-paint-mode"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This adds the vertex paint mode from GPv2 to GPv3.
Implements the following tools:
WIP: GPv3: Vertex Paint modeto WIP: GPv3: Vertex Paint ModeAre these still implemented as operators? Not as brushes in new asset shelf like mesh vertex paint mode?
No they show up as brushes in the asset shelf.
aad0b47738
to93a62c7cfa
WIP: GPv3: Vertex Paint Modeto GPv3: Vertex Paint Mode@blender-bot build
@blender-bot build
Found just some minor formatting errors. Works nicely in my feeble programmer art attempts.
I'd suggest changing the grid initialization loops for the smear tool, but other optimizations can be done separately if and when needed. I expect most time in larger drawings will be spent in the common point mask constructors anyway.
Good work!
@ -2372,0 +2406,4 @@
def draw(self, _context):
layout = self.layout
# layout.operator("gpencil.vertex_color_set", text="Set Color Attribute")
Can be removed, or todo?
I have a branch that implements the vertex paint operators. I can remove the commented code in this PR though.
@ -793,1 +797,3 @@
mode = OB_MODE_VERTEX_GPENCIL_LEGACY;
/* Just toggle paintmode flag... */
gpd->flag ^= GP_DATA_STROKE_VERTEXMODE;
/* set mode */
Comment formatting
@ -802,1 +818,3 @@
mode = ob->restore_mode;
if (ob->type == OB_GPENCIL_LEGACY) {
bGPdata *gpd = static_cast<bGPdata *>(ob->data);
/* try to back previous mode */
formatting
@ -371,3 +388,3 @@
static void GREASE_PENCIL_OT_sculpt_paint(wmOperatorType *ot)
{
ot->name = "Grease Pencil Draw";
ot->name = "Grease Pencil Sculpt";
Unrelated fix?
@ -0,0 +105,4 @@
/* Compute the colors in the grid by averaging the vertex colors of the points that
* intersect each cell. */
Array<int> points_per_cell(grid_array_length, 0);
for (const int y : IndexRange(color_grid_.size)) {
Hmm, doing a single loop over the point selection should be faster and simpler here, especially if it's single-threaded. I know i suggested doing this per grid cell in the first place, sorry 😁My thinking was that grid cells could be filled in parallel that way, but it's actually not necessary if the point selection mask construction is the slowest part (which it probably is). I would expect a lot more points than grid cells, so avoiding multiple loops over points is probably best.
If necessary i think this can be optimized with a
parallel_reduce
orEnumableThreadSpecific
:@ -918,0 +969,4 @@
/* The stroke is editable if the material is editable. If the material is not editable,
* then the stroke is only editable if the layer disables the locked material option. */
return (editable_material_indices.contains(material_index) ||
layer.use_locked_material()) &&
Move this condition outside of the predicate and just switch between 2 indexmask constructor calls.
Opened a separate PR to handle this #127423. Will update this function to use this option.
There may still be some bias in the smear brush calculations, but it's difficult to be sure without extensive testing. Should be fine for now.
@ -0,0 +36,4 @@
int2 coords_to_pos(const float2 coord, const float2 center) const
{
const int2 pos = int2(math::floor((coord - center) / float(this->cell_size_px)));
return pos + this->size / 2;
Should this be
ceil(size/2)
(or(size + 1)/2
)? I think this could discard points on the fringes if the grid size is odd.Example (just one axis):
1.0
for simplicity5
-2.1
-> position-3
-3 + int(5/2) = -1
Now the point is considered outside the grid. The corner position relative to the center should be rounded up, so the relative position becomes
-3 + int((5+1)/2) = 0
@blender-bot build