WIP: Surface Deform Grease Pencil Modifier - Blender 3.6 #113396

Draft
Elisabetta Abbattista wants to merge 27 commits from bettiabba/blender:Surface-Deform-GP-Modifier-Blender-v3.6 into blender-v3.6-release

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
First-time contributor

Surface Deform Grease Pencil Modifier - Blender 3.6

The Surface Deform modifier allows an arbitrary mesh surface to control the deformation the Grease Pencil, essentially transferring its motion/deformation. There are two main uses for this.

  1. Easy rigging of elaborate GP drawings. Make them follow a rigged mesh cage with clean topolgy.

  2. Making GP drawn details follow a mesh. Frames can be added dynamically making it a powerful tool of 3D and 2D blending.

Options

immagine

The Surface Deform modifier panel.

Target

The object to which to bind.

Warning - Target Mesh Validity
While there are no restrictions with regard to the modified GP, the target object’s mesh has a few constraints, which if not followed, will prevent a successful binding:

  • It must not contain edges with more than two faces.

  • It must not contain concave faces.

  • It must not contain overlapping vertices (doubles).

  • It must not contain faces with collinear edges.

Interpolation Falloff

How much a vertex bound to one face of the target will be affected by the surrounding faces. This essentially controls how smooth the deformations are. This setting only applies when binding; it can be set differently for different frames but not changed retroactively.

Note: While lower values result in smoother deformations, they may also introduce slight artifacts.

Strength

The overall amount of influence the modifier has on deforming the GP.

Vertex Group

Allows you to define the influence per vertex (point).

  • Invert <->
    Inverts the influence of the selected vertex group, meaning that the group now represents points that will not be deformed by the modifier.
    The setting reverses the weight values of the group.

Binding Operators

Note that until a bound frame is visible, this modifier will have no effect at all. When a bound frame is visible, any change in the target mesh will deform the Grease Pencil.

When a frame is bound, on the timeline it will turn the same color of the scrubbing background to indicate it is bound and locked. The locked frame cannot be moved or removed on the timeline. To move the frame, please unbind it first.

immagine

Bound frames become greyed out.

Bind All

Each frame of the modified Grease Pencil gets bound to the state the target mesh is in that timeline frame, all layers at once.

Bind Current Frame

The current frame of the modified Grease Pencil gets bound to the state the target mesh is in the current timeline frame,all layers at once. The current frame is the Grease Pencil frame that is visible right now due to the current timeline position.

Unbind All

Executing this frees all the frames of the modified Grease Pencil from the target, and resets it to its original shape.

Unbind Current Frame

Executing this frees just the current frame of the modified Grease Pencil from the target, and resets it to its original shape. The current frame is the Grease Pencil frame that is visible right now due to the current timeline position.

Note: The GP’s are bound with regard to global coordinates, but later transformations on the objects are ignored. This means that one can freely transform the target after binding, without affecting the modified object. The modified mesh will only pick up changes to the target object’s mesh itself.

Note: The further a mesh deviates from the target mesh surface, the more likely it is to get undesirable artifacts. For this reason it is recommended to have a clean topology on the binding mesh; the topology should follow the pattern of the drawing as closely as possible.

The bake panel

immagine

The bake panel.

The purpose of this panel is to bake the deformation of the modifier on the grease pencil, creating new, unbound keyframes. All layers are baked at once.
Note: the freshly baked frames are unbound. They can be bound if desired.
This note is also the text at the bottom of the panel, to avoid any confusion.

Bake Current Frame

Bakes the frame at the current timeline position.

Bake Range

Bakes all the frame in the range specified below.

Range start

The start of the frame range to be baked.

Range end

The end of the frame range to be baked.

Fill range

Click on the clock icon at the side of the range to use the "Fill range" operator. It fills the range start and end fields with the current timeline's start and end.

Examples

Usage 1 - Mesh cage
immagine

Grease Pencil deformed by a mesh cage using the Surface Deform modifier.

Usage 2 - Follow a 3D model
immagine

This character model features drawn details in Grease Pencil. When bound to the model, they are gonna follow the deformations.

Step by step guide

Usage 1 - Mesh cage

What you need: a Grease Pencil drawing.

  1. Add a Mesh Object in the same spot where your GP is.

  2. Model the mesh to create a mesh cage around your drawing. The topology must be as simple as possible, and it must flow in the directions of the desired deformations. A flat surface may give best results.

  3. Add the surface deform modifier to the GP.

  4. Add the mesh cage as target.

  5. Execute “Bind Current Frame” in the Surface Deform modifier panel.

The GP should now move along with your mesh cage.

  1. Add a Armature Object in the same spot where your GP and cage are.

  2. Create the rig that is going to deform the GP. You can use rigify and even download GP-specific metarigs.

  3. Weight paint the mesh. You should notice how the GP moves along in the process and adjust it accordingly.

  4. The GP is now ready for animation. You can animate it right away or link it in a scene file.

Usage 2 - Follow a 3D model

What you need: a rigged, animated character.

  1. Create a new blank GP.

  2. Add the surface deform modifier.

  3. Add the mesh you want the GP to follow as target.

  4. Select the GP and enter draw mode.

  5. Draw the first frame.

  6. Execute “Bind Current Frame” in the Surface Deform modifier panel.

  7. Move along the timeline until you want to change the line.

  8. Insert a new GP frame by either pressing i, using the context menu or turn on autokey .

  9. Draw the new frame.

  10. Execute “Bind Current Frame” in the Surface Deform modifier panel.

  11. Repeat point 7-10 until the end of the animation.

Video tutorial:

coming soon

## Surface Deform Grease Pencil Modifier - Blender 3.6 The Surface Deform modifier allows an arbitrary mesh surface to control the deformation the Grease Pencil, essentially transferring its motion/deformation. There are two main uses for this. 1. Easy rigging of elaborate GP drawings. Make them follow a rigged mesh cage with clean topolgy. 2. Making GP drawn details follow a mesh. Frames can be added dynamically making it a powerful tool of 3D and 2D blending. ### Options ![immagine](/attachments/c78cef9a-5586-4993-bd6b-ca0866d06071) ###### The Surface Deform modifier panel. #### **Target** The object to which to bind. Warning - Target Mesh Validity While there are no restrictions with regard to the modified GP, the target object’s mesh has a few constraints, which if not followed, will prevent a successful binding: - It must not contain edges with more than two faces. - It must not contain concave faces. - It must not contain overlapping vertices (doubles). - It must not contain faces with collinear edges. #### **Interpolation Falloff** How much a vertex bound to one face of the target will be affected by the surrounding faces. This essentially controls how smooth the deformations are. This setting only applies when binding; it can be set differently for different frames but not changed retroactively. Note: While lower values result in smoother deformations, they may also introduce slight artifacts. #### **Strength** The overall amount of influence the modifier has on deforming the GP. #### **Vertex Group** Allows you to define the influence per vertex (point). - **Invert <->** Inverts the influence of the selected vertex group, meaning that the group now represents points that will not be deformed by the modifier. The setting reverses the weight values of the group. ### **Binding Operators** Note that until a bound frame is visible, this modifier will have no effect at all. When a bound frame is visible, any change in the target mesh will deform the Grease Pencil. When a frame is bound, on the timeline it will turn the same color of the scrubbing background to indicate it is bound and locked. The locked frame _cannot be moved or removed_ on the timeline. To move the frame, please unbind it first. ![immagine](/attachments/8facd182-55cb-4f68-945c-fef0977a53d9) ###### Bound frames become greyed out. #### **Bind All** Each frame of the modified Grease Pencil gets bound to the state the target mesh is in that timeline frame, all layers at once. #### **Bind Current Frame** The current frame of the modified Grease Pencil gets bound to the state the target mesh is in the current timeline frame,all layers at once. The current frame is the Grease Pencil frame that is visible right now due to the current timeline position. #### **Unbind All** Executing this frees all the frames of the modified Grease Pencil from the target, and resets it to its original shape. #### **Unbind Current Frame** Executing this frees just the current frame of the modified Grease Pencil from the target, and resets it to its original shape. The current frame is the Grease Pencil frame that is visible right now due to the current timeline position. Note: The GP’s are bound with regard to global coordinates, but later transformations on the objects are ignored. This means that one can freely transform the target after binding, without affecting the modified object. The modified mesh will only pick up changes to the target object’s mesh itself. Note: The further a mesh deviates from the target mesh surface, the more likely it is to get undesirable artifacts. For this reason it is recommended to have a clean topology on the binding mesh; the topology should follow the pattern of the drawing as closely as possible. ### The bake panel ![immagine](/attachments/ca389067-90b4-40b4-8792-93e1d881c113) ###### The bake panel. The purpose of this panel is to bake the deformation of the modifier on the grease pencil, creating new, unbound keyframes. All layers are baked at once. Note: the freshly baked frames are unbound. They can be bound if desired. This note is also the text at the bottom of the panel, to avoid any confusion. #### **Bake Current Frame** Bakes the frame at the current timeline position. #### **Bake Range** Bakes all the frame in the range specified below. #### **Range start** The start of the frame range to be baked. #### **Range end** The end of the frame range to be baked. #### **Fill range** Click on the clock icon at the side of the range to use the "Fill range" operator. It fills the range start and end fields with the current timeline's start and end. ### Examples **Usage 1 - Mesh cage** ![immagine](/attachments/f9d54085-96f5-44b4-bb31-db87e5348ee1) ###### Grease Pencil deformed by a mesh cage using the Surface Deform modifier. **Usage 2 - Follow a 3D model** ![immagine](/attachments/e9e387a9-1e0c-436a-bfbc-d7861b4e411d) ###### This character model features drawn details in Grease Pencil. When bound to the model, they are gonna follow the deformations. ### Step by step guide #### Usage 1 - Mesh cage What you need: a Grease Pencil drawing. 1. Add a Mesh Object in the same spot where your GP is. 2. Model the mesh to create a mesh cage around your drawing. The topology must be as simple as possible, and it must flow in the directions of the desired deformations. A flat surface may give best results. 3. Add the surface deform modifier to the GP. 4. Add the mesh cage as target. 5. Execute “Bind Current Frame” in the Surface Deform modifier panel. The GP should now move along with your mesh cage. 6. Add a Armature Object in the same spot where your GP and cage are. 7. Create the rig that is going to deform the GP. You can use rigify and even download GP-specific metarigs. 8. Weight paint the mesh. You should notice how the GP moves along in the process and adjust it accordingly. 9. The GP is now ready for animation. You can animate it right away or link it in a scene file. #### Usage 2 - Follow a 3D model What you need: a rigged, animated character. 1. Create a new blank GP. 2. Add the surface deform modifier. 3. Add the mesh you want the GP to follow as target. 4. Select the GP and enter draw mode. 5. Draw the first frame. 6. Execute “Bind Current Frame” in the Surface Deform modifier panel. 7. Move along the timeline until you want to change the line. 8. Insert a new GP frame by either pressing i, using the context menu or turn on autokey . 9. Draw the new frame. 10. Execute “Bind Current Frame” in the Surface Deform modifier panel. 11. Repeat point 7-10 until the end of the animation. Video tutorial: coming soon
Elisabetta Abbattista added 11 commits 2023-10-07 17:08:12 +02:00
Iliya Katushenock added this to the Grease Pencil project 2023-10-07 17:16:26 +02:00

Blender 3.6 is LTS currently, so i not sure if you can send new modifier in to 3.6.

Blender 3.6 is LTS currently, so i not sure if you can send new modifier in to 3.6.
Author
First-time contributor

Blender 3.6 is LTS currently, so i not sure if you can send new modifier in to 3.6.

Hello. This patch is for use of MAD Enternatinment, I don't expect it to be added to official Blender.
However, the modifier concept may get a rework in the next few months and be potred to GP geometry nodes. Still uncertain.

> Blender 3.6 is LTS currently, so i not sure if you can send new modifier in to 3.6. Hello. This patch is for use of MAD Enternatinment, I don't expect it to be added to official Blender. However, the modifier concept may get a rework in the next few months and be potred to GP geometry nodes. Still uncertain.
Elisabetta Abbattista added 3 commits 2023-10-08 17:00:08 +02:00
Member

@blender-bot build

@blender-bot build
Elisabetta Abbattista added 1 commit 2023-10-10 10:58:51 +02:00
buildbot/vexp-code-patch-coordinator Build done. Details
b8cb216c7e
added BKE_mesh.hh
Member

@blender-bot build

@blender-bot build
Elisabetta Abbattista added 1 commit 2023-10-10 11:57:19 +02:00
Member

@blender-bot build

@blender-bot build
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR113396) when ready.
Elisabetta Abbattista added 3 commits 2023-10-11 17:21:58 +02:00
Elisabetta Abbattista added 1 commit 2023-10-11 17:35:03 +02:00
Elisabetta Abbattista added 1 commit 2023-10-11 17:48:07 +02:00
Elisabetta Abbattista added 5 commits 2023-10-14 15:37:44 +02:00
Elisabetta Abbattista added 1 commit 2023-10-24 15:12:23 +02:00
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR113396) when ready.
All checks were successful
buildbot/vexp-code-patch-coordinator Build done.
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u Surface-Deform-GP-Modifier-Blender-v3.6:bettiabba-Surface-Deform-GP-Modifier-Blender-v3.6
git checkout bettiabba-Surface-Deform-GP-Modifier-Blender-v3.6
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
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#113396
No description provided.