GPv3: Armature Modifier #118752

Merged
Lukas Tönne merged 5 commits from LukasTonne/blender:gp3-armature-modifier into main 2024-02-26 19:36:19 +01:00
Member

Armature deformation modifier for Grease Pencil v3.

Changes compared to GPv2:

  • multi DNA field was unused and was removed.
  • vert_coords_prev array is unused and was removed (gets passed to armature functions but never gets allocated).
  • GPv3 modifier uses the common influence struct to store the vertex group name, for consistency. The GREASE_PENCIL_INFLUENCE_INVERT_VERTEX_GROUP flag is copied to deformflag as ARM_DEF_INVERT_VGROUP before evaluation, which is used internally by armature functions.
  • BKE_armature_deform_coords_with_curves is added as another variant of the deform function, but uses C++ parameter types (spans instead of raw pointers). It gets a Span<MDeformVert> directly instead of deducing it internally from the object type. This is because we want to do this curve-by-curve and already use arbitrary vector spans for positions.
Armature deformation modifier for Grease Pencil v3. Changes compared to GPv2: - `multi` DNA field was unused and was removed. - `vert_coords_prev` array is unused and was removed (gets passed to armature functions but never gets allocated). - GPv3 modifier uses the common `influence` struct to store the vertex group name, for consistency. The `GREASE_PENCIL_INFLUENCE_INVERT_VERTEX_GROUP` flag is copied to `deformflag` as `ARM_DEF_INVERT_VGROUP` before evaluation, which is used internally by armature functions. - `BKE_armature_deform_coords_with_curves` is added as another variant of the deform function, but uses C++ parameter types (spans instead of raw pointers). It gets a `Span<MDeformVert>` directly instead of deducing it internally from the object type. This is because we want to do this curve-by-curve and already use arbitrary vector spans for positions.
Lukas Tönne added 2 commits 2024-02-26 16:53:22 +01:00
Lukas Tönne added this to the Grease Pencil project 2024-02-26 16:53:25 +01:00
Hans Goudey reviewed 2024-02-26 16:58:20 +01:00
@ -660,0 +671,4 @@
vert_coords.size(),
deformflag,
vert_coords_prev ? reinterpret_cast<float(*)[3]>(vert_coords_prev->data()) : nullptr,
defgrp_name.data(),
Member

Generally calling .data() for something that expects a C-string is wrong, since StringRef doesn't guarantee the null terminator. That probably just happened to work for the strings used so far. I'd use StringRefNull here.

Generally calling `.data()` for something that expects a C-string is wrong, since `StringRef` doesn't guarantee the null terminator. That probably just happened to work for the strings used so far. I'd use `StringRefNull` here.
LukasTonne marked this conversation as resolved
@ -0,0 +120,4 @@
curves_mask.foreach_index(blender::GrainSize(128), [&](const int curve_i) {
const IndexRange points = points_by_curve[curve_i];
/* deform verts */
Member

This comment could just be removed?

This comment could just be removed?
LukasTonne marked this conversation as resolved
Hans Goudey reviewed 2024-02-26 16:58:49 +01:00
@ -0,0 +138,4 @@
const ModifierEvalContext *ctx,
bke::GeometrySet *geometry_set)
{
auto *amd = reinterpret_cast<GreasePencilArmatureModifierData *>(md);
Member

const auto

`const auto`
LukasTonne marked this conversation as resolved
Lukas Tönne added 3 commits 2024-02-26 18:21:19 +01: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-windows-amd64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
5f12b84e94
Treat modifier data as const.
Author
Member

@blender-bot build

@blender-bot build
Hans Goudey approved these changes 2024-02-26 18:29:26 +01:00
Falk David approved these changes 2024-02-26 19:30:02 +01:00
Lukas Tönne merged commit 5599172499 into main 2024-02-26 19:36:19 +01:00
Lukas Tönne deleted branch gp3-armature-modifier 2024-02-26 19:36:22 +01: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
3 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#118752
No description provided.