GPv3: Create weights on draw for new strokes. #119302
No reviewers
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#119302
Loading…
Reference in New Issue
No description provided.
Delete Branch "casey-bianco-davis/blender:GPv3-Create-weights-on-draw"
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?
Implements the legacy
weight_data_add
button for GPv3.Note: This PR properly accounts for the bone's transformation when applying so that the stroke does not appear to teleport after drawing, unlike the legacy system.
You are really on fire, I see a lot of great PRs from your hand – very nice!
A few tiny remarks from a fellow community contributor.
Btw, I like the addition of compensating for the bone transformation. It's one of those smart little things that make Grease Pencil artist-friendly.
@ -596,0 +616,4 @@
const bDeformGroup *defgroup = static_cast<const bDeformGroup *>(
BLI_findlink(BKE_object_defgroup_list(object), def_nr));
In case there is no vertex group:
@ -596,0 +620,4 @@
const StringRef vertex_group_name = defgroup->name;
blender::bke::greasepencil::assign_to_vertex_group_from_selection(
curves, IndexMask(points), vertex_group_name, 1.0f);
Any reason to switch here from
IndexRange
toIndexMask
? Ignore my question when there is 🔕And at first glance I thought this function had something to do with the
.selection
attribute. So perhaps something likeassign_to_vertex_group_from_range
is a better name?@ -596,0 +623,4 @@
curves, IndexMask(points), vertex_group_name, 1.0f);
/* Loop through all modifiers trying to find the pose channel for the vertex group name. */
bPoseChannel *channel = NULL;
Here and below:
NULL
->nullptr
@ -596,0 +635,4 @@
continue;
}
GreasePencilArmatureModifierData *amd = (GreasePencilArmatureModifierData *)md;
reinterpret_cast<GreasePencilArmatureModifierData *>(md)
@ -596,0 +655,4 @@
break;
}
/* nothing valid was found. */
Nitpick: Capital N.
Thanks for looking into this. One concern I have is about trying to inverse the deformation of modifiers in the paint tool. From what I could find, this wasn't done in GPv2? Generally, if we wanted to support this, we should be using the
get_evaluated_grease_pencil_drawing_deformation
API. This would allow you to get a matrix per curve/point with the deformation. And each modifier that supports this deformed space, would write into the edit component.The legacy system did not convert the points when applying the weights.
I will look in to using
get_evaluated_grease_pencil_drawing_deformation
but currently it does not work withdeform_mats
Checkout
From your project repository, check out a new branch and test the changes.