Maniphest T76872

2nd Mask (created after existing keyframe) gets broken handles
Closed, ResolvedBUG

Assigned To
Sergey Sharybin (sergey)
Authored By
Ian Hubert (mrdodobird)
May 19 2020, 6:34 AM
Tags
  • Masking
  • VFX & Video
  • BF Blender
  • Motion Tracking
Subscribers
Ian Hubert (mrdodobird)
Philipp Oeser (lichtwerk)
Sergey Sharybin (sergey)

Description

System Information
Operating system: Windows 64 bit
Graphics card: GTX1080

Blender Version
Broken: every 2.8 version I've tried (2.80 - 2.83), and back through 2.70

Description of the thing

  • Open blender,
  • Open a tracking/masking workspace
  • Load in a movie clip

now what works / doesnt work:

  • GOOD: insert first spline (Add > Circle), insert second spline (Add > Circle) on the same frame, change handle type on one point of second spline from Auto to Aligned, scub timeline
  • FAIL: insert first spline (Add > Circle), insert keyframe (I), insert second spline (Add > Circle) on the same frame, change handle type on one point of second spline from Auto to Aligned, scub timeline (handles on second spline go nuts)
  • GOOD: insert first spline (Add > Circle), insert keyframe (I), insert second spline (Add > Circle) on the same frame, change handle type on one point of second spline from Auto to Aligned, insert keyframe (I), scub timeline
  • FAIL: insert first spline (Add > Circle), insert keyframe (I), go to next frame, insert second spline (Add > Circle), change handle type on one point of second spline from Auto to Aligned, scub timeline (handles on second spline go nuts)
  • FAIL: insert first spline (Add > Circle), insert keyframe (I), go to next frame, insert second spline (Add > Circle), change handle type on one point of second spline from Auto to Aligned, insert keyframe (I), scub timeline (handles on second spline go nuts)
My assumption here is that inserting a shapekey with only the first spline present fills data in MaskLayerShape for that frame [but only data for points of the first spline].
Now if you add a second spline, data for its points are "missing" from MaskLayerShape.
BKE_mask_layer_evaluate_animation / BKE_mask_layer_shape_to_mask / mask_layer_shape_to_mask_point will just use random garbage in that case?

Original report (but this can be reproduced without autokeying, see above):

Hello! This is regarding auto-keyframing with masking :)

So, if you turn on auto keyframing in the masking workspace, and create your first mask, everything behaves as you'd expect (although you have to double click to "apply" the keyframe, which is admittedly unexpected).

But if you then create a SECOND mask with auto keyframing enabled, at some point all the points will warble into a weird shape (even though you haven't added keyframes), and it'll become mostly useless.

It's always the second mask created after "auto-keyframing" is turned on

Here's a quick video showing it:
https://youtu.be/OWEEhA_3njA

I attached a blend file and a small video file (the video file doesn't matter though- it happens with all I've tried- but they can't be packed into the .blend file)

Thank you!!

Exact steps for others to reproduce the error
Open blender,
Open a tracking/masking workspace
Load in a movie clip
Turn on "Auto Keyframing"
Create a mask, animate it.
Create another mask, and scrub through the timeline- it'll get all tangled.

Revisions and Commits

rB Blender
D7786

Related Objects

Mentioned In
rB51f8dbe081f6: Mask: Fix possible nan values in the weight interpolation
rB059f79bdd745: Clarify autokeyframe tootip
D7788: Clarify autokeyframe tootip
D7786: Fix autokeyframing masks not updating properly
Mentioned Here
D7786: Fix autokeyframing masks not updating properly

Event Timeline

Ian Hubert (mrdodobird) created this task.May 19 2020, 6:34 AM
Ian Hubert (mrdodobird) updated the task description.
Ian Hubert (mrdodobird) edited projects, added Masking; removed Add-ons (Community).
Philipp Oeser (lichtwerk) changed the task status from Needs Triage to Confirmed.May 19 2020, 11:44 AM
Philipp Oeser (lichtwerk) changed the subtype of this task from "Report" to "Bug".
Philipp Oeser (lichtwerk) added a subscriber: Philipp Oeser (lichtwerk).

Confirming on first sight.

Could it be that there is just an update missing?

What I mean is I think I can get it to be reliable if

  • I move points [keyframe is inserted, but some update is missing -- if I start using the timeline and move points again then this will end up getting unpredictable (probably inserting keys in places which dont correspond to what is displayed on screen)]
  • dont move the timeline yet
  • do something that properly tags updates [e.g. select some other points]
  • select my original points again, move timeline/points etc...

Looking into this.
@Ian Hubert (mrdodobird) : in the meantime: can you confirm this is more reliable for you if you change selection after the autokeyframe has been inserted?

Ian Hubert (mrdodobird) added a comment.May 19 2020, 12:27 PM

AH! Cool hey, thanks, Philipp!

So- I thought I had my head wrapped around this (this is my first bug, so I checked everything like crazy), but I found a couple things out.

1.) it doesn't have anything to do with auto-keyframing. After you add a mask with keyframes, the next mask will get the weird warbles.
2.) I can avoid the issue if I create a new mask layer and add the mask to that, (which is honestly a pretty reasonable workaround for most instances)

But also- if I'm understanding your suggestion right, I've done a few tests with it, in every order I can think of, and it doesn't seem like changing the selection makes any difference.

Philipp Oeser (lichtwerk) mentioned this in D7786: Fix autokeyframing masks not updating properly.
Philipp Oeser (lichtwerk) added a subscriber: Sergey Sharybin (sergey).May 19 2020, 12:38 PM

Youtube video seems to be private.

Ah, I think I can properly reproduce now (I was using the mask primitives and not using the handles)
If you add another shape and use the handles, these indeed are mangled.

Not sure if this is properly supported after all? [makes me thing of meshes/curves -- where adding geometry after doing shapekeys is not such a good idea as well...]

maybe @Sergey Sharybin (sergey) can comment?

Anyways, D7786: Fix autokeyframing masks not updating properly should still make masking experience with auto-keyframing more pleasant?

Philipp Oeser (lichtwerk) added a comment.May 19 2020, 12:41 PM
In T76872#934599, @Ian Hubert (mrdodobird) wrote:

AH! Cool hey, thanks, Philipp!

So- I thought I had my head wrapped around this (this is my first bug, so I checked everything like crazy), but I found a couple things out.

1.) it doesn't have anything to do with auto-keyframing. After you add a mask with keyframes, the next mask will get the weird warbles.
2.) I can avoid the issue if I create a new mask layer and add the mask to that, (which is honestly a pretty reasonable workaround for most instances)

But also- if I'm understanding your suggestion right, I've done a few tests with it, in every order I can think of, and it doesn't seem like changing the selection makes any difference.

Hi, we were typing at the same time:

  • yes, your issue is not related to autokeyframing, adding anything to a mask after it has keyframes will show this
  • changing selection would just make the mask update properly after the auto-keyframe has been inserted, so it doesnt hop into other places when scrubbing...
Ian Hubert (mrdodobird) added a comment.May 19 2020, 1:00 PM

Oh! sorry about that- the video is public now, though it sounds like you've already seen what it shows.

The additional "phantom keyframes" that appear on the second mask do appear to match up somewhat to the keyframes possessed by the first mask.

And yes! This would definitely make auto keyframing more pleasant!

Although on the subject of a pleasant rotoscoping experience (which can be a bit of a slog at the best of times), Sergey (hello! :) ) do you know why you still have to double click to add the keyframe if auto-keyframing is enabled? That's different from auto-keyframing behavior everywhere else in blender, and it's fairly confusing when you first start masking.

Philipp Oeser (lichtwerk) mentioned this in D7788: Clarify autokeyframe tootip.May 19 2020, 1:50 PM
Philipp Oeser (lichtwerk) changed the subtype of this task from "Bug" to "Report".May 19 2020, 2:48 PM

Changing back to Report from Bug until we know if this is supposed to be supported...

Evan Wilson (EAW) added a project: VFX & Video.May 19 2020, 4:43 PM
Philipp Oeser (lichtwerk) mentioned this in rB059f79bdd745: Clarify autokeyframe tootip.May 19 2020, 6:54 PM
Philipp Oeser (lichtwerk) added a commit: rBa8a6b3627af4: Fix autokeyframing masks not updating properly.May 25 2020, 2:09 PM
Christopher_Anderssarian added projects: BF Blender, Motion Tracking.May 31 2020, 12:54 PM
Sergey Sharybin (sergey) added a comment.Jun 24 2020, 4:28 PM

@Philipp Oeser (lichtwerk) mask surely shouldn't be mangled after modifying it.
Could be missing DEG_id_update_tag call. How do i reproduce the issue with the attached file?

Philipp Oeser (lichtwerk) added a comment.Jun 24 2020, 4:42 PM

I have this on the list for tomorrow to look at again

Philipp Oeser (lichtwerk) added a comment.Jun 25 2020, 12:09 PM

Changing the handle type seems to play an important part, animation of just the point positions seems to be fine.

@Sergey Sharybin (sergey): To recap how this can be reproduced:

  • Open blender,
  • Open a tracking/masking workspace
  • Load in a movie clip

now what works / doesnt work:

  • GOOD: insert first spline (Add > Circle), insert second spline (Add > Circle) on the same frame, change handle type on one point of second spline from Auto to Aligned, scub timeline
  • FAIL: insert first spline (Add > Circle), insert keyframe (I), insert second spline (Add > Circle) on the same frame, change handle type on one point of second spline from Auto to Aligned, scub timeline (handles on second spline go nuts)
  • GOOD: insert first spline (Add > Circle), insert keyframe (I), insert second spline (Add > Circle) on the same frame, change handle type on one point of second spline from Auto to Aligned, insert keyframe (I), scub timeline
  • FAIL: insert first spline (Add > Circle), insert keyframe (I), go to next frame, insert second spline (Add > Circle), change handle type on one point of second spline from Auto to Aligned, scub timeline (handles on second spline go nuts)
  • FAIL: insert first spline (Add > Circle), insert keyframe (I), go to next frame, insert second spline (Add > Circle), change handle type on one point of second spline from Auto to Aligned, insert keyframe (I), scub timeline (handles on second spline go nuts)

My assumption here is that inserting a shapekey with only the first spline present fills data in MaskLayerShape for that frame [but only data for points of the first spline].
Now if you add a second spline, data for its points are "missing" from MaskLayerShape.
BKE_mask_layer_evaluate_animation / BKE_mask_layer_shape_to_mask / mask_layer_shape_to_mask_point will just use random garbage in that case?

Not exactly sure why this is only a problem with handles (but maybe my analysis is also wrong).
This also seems to happen when adding a second spline (using CTRL+LMB), changing the handle type is not even necessary in that case.

Philipp Oeser (lichtwerk) renamed this task from 2nd Mask Created After Auto-Keyframing Enabled gets Mystery Keyframes to 2nd Mask (created after existing keyframe) gets broken handles.Jun 25 2020, 12:13 PM
Philipp Oeser (lichtwerk) updated the task description.
Philipp Oeser (lichtwerk) updated the task description.
Philipp Oeser (lichtwerk) changed the subtype of this task from "Report" to "Bug".

Will classify as bug for now.

Sergey Sharybin (sergey) moved this task from Backlog to Bugs on the VFX & Video board.Jul 1 2020, 12:51 PM
Sergey Sharybin (sergey) closed this task as Resolved by committing rB2e7e13442c91: Fix T76872: Mask created after existing keyframe gets broken handles.Mar 29 2021, 4:19 PM
Sergey Sharybin (sergey) claimed this task.
Sergey Sharybin (sergey) added a commit: rB2e7e13442c91: Fix T76872: Mask created after existing keyframe gets broken handles.
Sergey Sharybin (sergey) mentioned this in rB51f8dbe081f6: Mask: Fix possible nan values in the weight interpolation.