Regression: Grease pencil: applying armature does not work. It is now similar to removing the armature modifier #103234

Closed
opened 2022-12-15 08:00:24 +01:00 by Tim · 16 comments

Hi! First of all thank you for your great job!

System Information
Operating system: Windows 11
Graphics card: NVIDIA GeForce RTX 2080 SUPER

Blender Version
Broken: 3.4.0, 3.3.0, 3.2.0
Worked: 3.1.2

Caused by cff6eb6580.

Short description of error
The applying armature doesn't work for grease pencil. It is now similar to removing the armature modifier

Exact steps for others to reproduce the error

  1. Create grease pencil with two strokes.
  2. Create armature with two bones chain.
  3. Assing each stroke to its bone.
  4. Make some pose - rotate one of the bone.
  5. Apply the armature modifier.
    Result is similar to removing the modifier - all strokes will return to initial poses.

image.png image.png image.png

#103234.blend

Best wishes,
Tim

Hi! First of all thank you for your great job! **System Information** Operating system: Windows 11 Graphics card: NVIDIA GeForce RTX 2080 SUPER **Blender Version** Broken: 3.4.0, 3.3.0, 3.2.0 Worked: 3.1.2 Caused by cff6eb6580. **Short description of error** The applying armature doesn't work for grease pencil. It is now similar to removing the armature modifier **Exact steps for others to reproduce the error** 1. Create grease pencil with two strokes. 2. Create armature with two bones chain. 3. Assing each stroke to its bone. 4. Make some pose - rotate one of the bone. 5. Apply the armature modifier. Result is similar to removing the modifier - all strokes will return to initial poses. ![image.png](https://archive.blender.org/developer/F14058665/image.png) ![image.png](https://archive.blender.org/developer/F14058681/image.png) ![image.png](https://archive.blender.org/developer/F14058685/image.png) [#103234.blend](https://archive.blender.org/developer/F14058745/T103234.blend) Best wishes, Tim
Author

Added subscriber: @Tim-Kravchenko

Added subscriber: @Tim-Kravchenko
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Can confirm, will check

Broken: all versions.

Not true, this was working in 3.1.2

Can confirm, will check > Broken: all versions. Not true, this was working in 3.1.2
Author

In #103234#1460832, @lichtwerk wrote:
Can confirm, will check

Broken: all versions.

Not true, this was working in 3.1.2

Thanks, @lichtwerk! I checked only 3.3.0 and 3.4.0. So I thought it never worked)

> In #103234#1460832, @lichtwerk wrote: > Can confirm, will check > >> Broken: all versions. > Not true, this was working in 3.1.2 Thanks, @lichtwerk! I checked only 3.3.0 and 3.4.0. So I thought it never worked)

Added subscribers: @antoniov, @frogstomp-4

Added subscribers: @antoniov, @frogstomp-4

@lichtwerk there was a change in applying layer transformation in 3.2: https://developer.blender.org/D14844
Possible cause maybe?
cc @antoniov

@lichtwerk there was a change in applying layer transformation in 3.2: https://developer.blender.org/D14844 Possible cause maybe? cc @antoniov
Member

@frogstomp-4 : think it is something else that broke this, will bisect...

@frogstomp-4 : think it is something else that broke this, will bisect...

In #103234#1460843, @frogstomp-4 wrote:
@lichtwerk there was a change in applying layer transformation in 3.2: https://developer.blender.org/D14844
Possible cause maybe?
cc @antoniov

This patch was for bake animation and it's not related to this modifier.

> In #103234#1460843, @frogstomp-4 wrote: > @lichtwerk there was a change in applying layer transformation in 3.2: https://developer.blender.org/D14844 > Possible cause maybe? > cc @antoniov This patch was for bake animation and it's not related to this modifier.
Member

Caused by cff6eb6580.
Seems like the armature modifier needs to do this with the original bGPdata (it passes the evaluated object to generic_bake_deform_stroke though)

Caused by cff6eb6580. Seems like the armature modifier needs to do this with the **original** bGPdata (it passes the **evaluated** object to `generic_bake_deform_stroke` though)
Philipp Oeser changed title from Grease pencil: applying armature does not work. It is now similar to removing the armature modifier to Regression: Grease pencil: applying armature does not work. It is now similar to removing the armature modifier 2022-12-15 09:38:43 +01:00
Member

Havent checked why this mixture of original and evaluated is needed (in fact, it doesnt seem like this is actually needed, see second example), but here are two changes that potentionally "fix":



diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c b/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c
index d4ada842d0b..a5d13796249 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c
@@ -178,9 +178,10 @@ void generic_bake_deform_stroke(
 {
   Scene *scene = DEG_get_evaluated_scene(depsgraph);
   bGPdata *gpd = ob->data;
+  bGPdata *gpd_orig = (bGPdata *)DEG_get_original_id(&gpd->id);
   int oldframe = (int)DEG_get_ctime(depsgraph);
 
-  LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
+  LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd_orig->layers) {
     LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) {
       if (retime) {
         scene->r.cfra = gpf->framenum;


diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c
index d99d9950efb..5163f4d7020 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c
@@ -118,14 +118,12 @@ static void bakeModifier(Main *UNUSED(bmain),
                          GpencilModifierData *md,
                          Object *ob)
 {
-  Object *object_eval = DEG_get_evaluated_object(depsgraph, ob);
   ArmatureGpencilModifierData *mmd = (ArmatureGpencilModifierData *)md;
-  GpencilModifierData *md_eval = BKE_gpencil_modifiers_findby_name(object_eval, md->name);
 
   if (mmd->object == NULL) {
     return;
   }
-  generic_bake_deform_stroke(depsgraph, md_eval, object_eval, true, deformStroke);
+  generic_bake_deform_stroke(depsgraph, md, ob, true, deformStroke);
 }
 
 static bool isDisabled(GpencilModifierData *md, int UNUSED(userRenderParams))
Havent checked why this mixture of original and evaluated is needed (in fact, it doesnt seem like this is actually needed, see second example), but here are two changes that potentionally "fix": ``` diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c b/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c index d4ada842d0b..a5d13796249 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c @@ -178,9 +178,10 @@ void generic_bake_deform_stroke( { Scene *scene = DEG_get_evaluated_scene(depsgraph); bGPdata *gpd = ob->data; + bGPdata *gpd_orig = (bGPdata *)DEG_get_original_id(&gpd->id); int oldframe = (int)DEG_get_ctime(depsgraph); - LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { + LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd_orig->layers) { LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) { if (retime) { scene->r.cfra = gpf->framenum; ``` ``` diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c index d99d9950efb..5163f4d7020 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c @@ -118,14 +118,12 @@ static void bakeModifier(Main *UNUSED(bmain), GpencilModifierData *md, Object *ob) { - Object *object_eval = DEG_get_evaluated_object(depsgraph, ob); ArmatureGpencilModifierData *mmd = (ArmatureGpencilModifierData *)md; - GpencilModifierData *md_eval = BKE_gpencil_modifiers_findby_name(object_eval, md->name); if (mmd->object == NULL) { return; } - generic_bake_deform_stroke(depsgraph, md_eval, object_eval, true, deformStroke); + generic_bake_deform_stroke(depsgraph, md, ob, true, deformStroke); } static bool isDisabled(GpencilModifierData *md, int UNUSED(userRenderParams)) ```

@lichtwerk The right fix is this:

diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c
index d99d9950efb..5163f4d7020 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c
@@ -118,14 +118,12 @@ static void bakeModifier(Main *UNUSED(bmain),
                          GpencilModifierData *md,
                          Object *ob)
 {
-  Object *object_eval = DEG_get_evaluated_object(depsgraph, ob);
   ArmatureGpencilModifierData *mmd = (ArmatureGpencilModifierData *)md;
-  GpencilModifierData *md_eval = BKE_gpencil_modifiers_findby_name(object_eval, md->name);
 
   if (mmd->object == NULL) {
     return;
   }
-  generic_bake_deform_stroke(depsgraph, md_eval, object_eval, true, deformStroke);
+  generic_bake_deform_stroke(depsgraph, md, ob, true, deformStroke);
 }
 
 static bool isDisabled(GpencilModifierData *md, int UNUSED(userRenderParams))
@lichtwerk The right fix is this: ``` diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c index d99d9950efb..5163f4d7020 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c @@ -118,14 +118,12 @@ static void bakeModifier(Main *UNUSED(bmain), GpencilModifierData *md, Object *ob) { - Object *object_eval = DEG_get_evaluated_object(depsgraph, ob); ArmatureGpencilModifierData *mmd = (ArmatureGpencilModifierData *)md; - GpencilModifierData *md_eval = BKE_gpencil_modifiers_findby_name(object_eval, md->name); if (mmd->object == NULL) { return; } - generic_bake_deform_stroke(depsgraph, md_eval, object_eval, true, deformStroke); + generic_bake_deform_stroke(depsgraph, md, ob, true, deformStroke); } static bool isDisabled(GpencilModifierData *md, int UNUSED(userRenderParams)) ```

This issue was referenced by 6aacbdd716

This issue was referenced by 6aacbdd716fa979f2d02ae2b7c0fcb2fdc0554e4

This issue was referenced by d4a6108ef2

This issue was referenced by d4a6108ef292ee43aa0d5315fdcfd51c9a5da629

This issue was referenced by e0ef5f3602

This issue was referenced by e0ef5f360222148d52e68d820df499dd6da5ce8a

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Antonio Vazquez self-assigned this 2022-12-15 10:53:40 +01:00
Sign in to join this conversation.
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
5 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#103234
No description provided.