GPv3: Weight Paint Mode #117890
Labels
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
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#117890
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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 is an overview task for adding weight painting into Gease Pencil 3.
Weight painting tools
WPAINT_TOOL_DRAW
WPAINT_TOOL_BLUR
WPAINT_TOOL_AVERAGE
WPAINT_TOOL_SMEAR
Adding the mode
We should try and use the
OB_MODE_WEIGHT_PAINT
andCTX_MODE_PAINT_WEIGHT
flags to avoid having to add more redundant code.PAINT_OT_weight_paint_toggle
so it works withOB_GREASE_PENCIL
objects. (!117945)mode_toggle_poll_test
accepts grease pencil (!117945)Add case inobject_mode_op_string
for mode togglingAdding the main draw operator
grease_pencil_draw_ops.cc
implement an operator (maybeGREASE_PENCIL_OT_weight_brush_stroke
) that will be used for all the weight painting tools. SeeGREASE_PENCIL_OT_brush_stroke
for reference. The operator uses the commonpaint_stroke
API.OB_MODE_WEIGHT_PAINT
and with a valid weight paint tool/brush.blender_default.py
.Adding a tool
source/blender/editors/sculpt_paint/grease_pencil_intern.hh
declare a new operation (e.g.new_weight_draw_operation
)grease_pencil_weight_draw.cc
).GreasePencilStrokeOperation
and overrides the following functionsvoid on_stroke_begin(const bContext &C, const InputSample &start_sample) override;
void on_stroke_extended(const bContext &C, const InputSample &extension_sample) override;
void on_stroke_done(const bContext &C) override;
Executor
struct. See e.g.PaintOperation::on_stroke_extended
for how that's used.start_weight_brush_operation
get the brush fromBKE_paint_brush_for_read(scene.toolsettings->wpaint.paint)
and check theweightpaint_tool
(seeeBrushWeightPaintTool
) and create the new operation that was implemented.VIEW3D_PT_tools_active
the_defs_weight_paint.generate_from_brushes
in'PAINT_WEIGHT':
should work.Overlays
source/blender/draw/intern/draw_cache_impl_grease_pencil.cc
create something likegrease_pencil_weight_batch_ensure
. This should create aGPUVertBuf
for the weights similar togrease_pencil_edit_batch_ensure
which reads the selection.source/blender/draw/engines/overlay/overlay_grease_pencil.cc
to make the draw calls (similar toOVERLAY_edit_grease_pencil_cache_populate
)blender/source/blender/draw/engines/overlay/overlay_engine.cc
in this caseelse if (in_paint_mode && !pd->hide_overlays) {
, call the new populate function if the object type is grease pencil.Operators
Operators that are not painting operators should be implemented in
blender/source/blender/editors/grease_pencil/intern/grease_pencil_weights.cc
.GPENCIL_OT_weight_toggle_direction
GPENCIL_OT_weight_sample
GPENCIL_OT_generate_weights