Magic Mask looses mask if I adjust a different node

Get answers to your questions about color grading, editing and finishing with DaVinci Resolve.
  • Author
  • Message
Offline

JossSang

  • Posts: 11
  • Joined: Thu Sep 15, 2022 4:32 pm
  • Real Name: Joss Sanglier

Magic Mask looses mask if I adjust a different node

PostThu Sep 15, 2022 5:03 pm

I have only just upgraded to Studio, so I am still swimming through Magic Mask.

If I create and track a mask on one node, it is all fine. If I then go to a different node on the same clip and change something (nudge the gamma, perhaps), my mask vanishes, and I need to track it again.

I don't have the most powerful system out, as a note.
Former London-based sound engineer and voice producer for decades who did the odd offline edit on Umatic! Learning Resolve from scratch for fun.
Offline

michael_72

  • Posts: 90
  • Joined: Tue May 21, 2019 9:21 am
  • Real Name: Michael Nilsson

Re: Magic Mask looses mask if I adjust a different node

PostFri Sep 16, 2022 8:03 am

I was just about to post an identical post as this... I have a pretty decent rig with up to date drivers so I don't think it is a horsepower issue... I have an AMD system, could that be a problem...?

Magic mask is truly magic, I am blown away by it... Fast, accurate and a time saver if only this glitch was ironed out... The mask data seems to be lost very arbitrarily, sometimes even without me changing parameters in other nodes...

Should the effect be applied only in parallel nodes or in the beginning or the end of a node tree, is there some workflow logic that I am missing...?
MacBook Pro Max M2
RAM: 96 GB
HD: Internal SSD 4TB
I/O-card: UltraStudio Monitor 3G
Monitor 1 (GUI): Apple Studio Display
Monitor 2 (REF): Eizo Coloredge CG319x
OS: MacOS Sonoma 14.5
NLE: Davinci Resolve Studio 19
Offline

Steve Alexander

  • Posts: 5661
  • Joined: Mon Mar 23, 2015 2:15 am

Re: Magic Mask looses mask if I adjust a different node

PostFri Sep 16, 2022 12:20 pm

Think of it this way, if the video fed into the node with the magic mask changes in any way (by either a previous node or some other change on the edit page), the mask will be deleted under the hood.

With this in mind, you can imagine how you might have a separate path to a magic mask node and then borrow the alpha channel from that node to use in a downstream node, etc.
aka Barkinmadd
Resolve Studio 20 | Fusion Studio 20 | 16" MacBook Pro M1 MAX, 32 GPU cores, 64 GB RAM, 2 TB SSD, Sequoia 15.4.1
Offline
User avatar

GalinMcMahon

  • Posts: 933
  • Joined: Sun Sep 29, 2019 10:14 pm
  • Real Name: Galin McMahon

Re: Magic Mask looses mask if I adjust a different node

PostFri Sep 16, 2022 2:53 pm

There is a ton of discussion on this. Instructions at the bottom of: viewtopic.php?f=21&t=165381
Water cooled laptop w/4090
1+4 TB nvmes
64GB RAM
Stream Deck
Resolve Studio 20b4
Offline

Steve Alexander

  • Posts: 5661
  • Joined: Mon Mar 23, 2015 2:15 am

Re: Magic Mask looses mask if I adjust a different node

PostFri Sep 16, 2022 3:28 pm

GalinMcMahon wrote:There is a ton of discussion on this. Instructions at the bottom of: viewtopic.php?f=21&t=165381


Yes, I've seen your solution proposed by others as well. I think there are some cases where the magic mask tracking is lost unnecessarily and hence embedding it within a compound clip as you describe can offer an additional level of protection. I think BMD still has some work to do to make the magic mask more robust when it comes to upstream changes that would not necessarily invalidate the previous mask/tracking.
aka Barkinmadd
Resolve Studio 20 | Fusion Studio 20 | 16" MacBook Pro M1 MAX, 32 GPU cores, 64 GB RAM, 2 TB SSD, Sequoia 15.4.1
Offline

Andy Mees

  • Posts: 4121
  • Joined: Wed Aug 22, 2012 7:48 am

Re: Magic Mask looses mask if I adjust a different node

PostFri Sep 16, 2022 3:44 pm

To summarise, as it currently stands, Magic / Object Masks are inherently fragile... they are mostly static mask files generated by an algorithm, one for each frame. The algorithm looks at all the input pixels of a given reference frame in a clip instance, and, guided by a user defined stroke (or strokes), dynamically generates a mask for the arbitrary pixel area that it believes the user is most likely targeting on that reference frame. Tracking that chosen area generates a static cached mask file for each tracked non reference frame of the clip instance.

So far, so good. In practice, you jump into the Color Page, add a corrector node, define your object with a simple Magic Mask stroke and 'Viola!' ... you marvel at the result, track it and move on. Hurrah!

But then you adjust something... uh oh... maybe it was in the same node, maybe in another node or maybe you just made a tiny adjustment on another page... whatever you did, the (static) mask track is now gone and only the occasional (dynamic) reference frame lives to tell the tale.

As Steve says, it's because (regardless of your best intentions) your adjustment has caused a change to the input pixels of the Magic Mask, and, as far as the software is concerned, if the input data has changed then any previously cached data based on that input must be discarded / regenerated.

As suggested, you can certainly protect yourself against unexpected loss of cached masks by careful separation and management of your Color Page node operations ... there are some examples of that in this thread... but once in a while you might still lose them, it shouldn't happen often, but all cache files are somewhat temporary by nature.

And as Galin posted, another way some folks have developed to protect themselves, against casual magic mask cache loss, is to nest any magic mask generation operations inside a Compound Clip ie create a compound clip from the source clip instance, open the compound clip in its own timeline, add the magic mask to the source image as needed, generate the mask cache, and then finally step back out to the parent timeline... thereafter, when you manipulate the pixels of the compound clip, you are manipulating a separate pre-masked object rather than manipulating the pixels of the source clip itself (ie the mask input), thus the mask is preserved. Do be aware though that nesting magic masks inside compound clips comes with the current drawback that such contained masks can be 'hidden' from other standard software operations. Eg Using the Magic Mask >> Regenerate Object Mask > All Clips function at the main timeline level will not regenerate masks for any such nested clips; similarly, the automatic mask regeneration that's triggered via the Delivery Page 'Render' command will skip any nested masks.
Offline

Steve Alexander

  • Posts: 5661
  • Joined: Mon Mar 23, 2015 2:15 am

Re: Magic Mask looses mask if I adjust a different node

PostFri Sep 16, 2022 4:19 pm

Brilliant summary and words of wisdom, Andy! Thanks for posting this (should be pinned, lol).
aka Barkinmadd
Resolve Studio 20 | Fusion Studio 20 | 16" MacBook Pro M1 MAX, 32 GPU cores, 64 GB RAM, 2 TB SSD, Sequoia 15.4.1
Offline

Sam Steti

  • Posts: 3158
  • Joined: Tue Jun 17, 2014 7:29 am
  • Location: France

Re: Magic Mask looses mask if I adjust a different node

PostSat Sep 17, 2022 9:19 am

Steve Alexander wrote:Brilliant summary and words of wisdom, Andy! Thanks for posting this (should be pinned, lol).

Yes indeed, except on line 7-8 : I can assert that the correct expression is "Et voilà" :lol: :lol: :lol:

(just kidding, I know it's a typo)
*MacMini M1 16 Go - Sonoma - Ext nvme SSDs on TB3 - 14 To HD in 2 x 4 disks USB3 towers
*Legacy MacPro 8core Xeons, 32 Go ram, 2 x gtx 980 ti, 3SSDs including RAID
*Resolve Studio everywhere, Fusion Studio too
*https://www.buymeacoffee.com/videorhin
Offline

Andy Mees

  • Posts: 4121
  • Joined: Wed Aug 22, 2012 7:48 am

Re: Magic Mask looses mask if I adjust a different node

PostSat Sep 17, 2022 10:31 am

Doh! Sam, by way of an apology, please accept the below entirely intentional violas... :)
Image Image
Offline

Sam Steti

  • Posts: 3158
  • Joined: Tue Jun 17, 2014 7:29 am
  • Location: France

Re: Magic Mask looses mask if I adjust a different node

PostSat Sep 17, 2022 10:38 am

Fully accepted 8-) :mrgreen:
*MacMini M1 16 Go - Sonoma - Ext nvme SSDs on TB3 - 14 To HD in 2 x 4 disks USB3 towers
*Legacy MacPro 8core Xeons, 32 Go ram, 2 x gtx 980 ti, 3SSDs including RAID
*Resolve Studio everywhere, Fusion Studio too
*https://www.buymeacoffee.com/videorhin
Offline

JossSang

  • Posts: 11
  • Joined: Thu Sep 15, 2022 4:32 pm
  • Real Name: Joss Sanglier

Re: Magic Mask looses mask if I adjust a different node

PostMon Sep 26, 2022 12:55 pm

Thanks for all the info, everyone!

I went a little cross-eyed, but only a little.

I would have jumped in earlier, but I forgot to have notifications on. Oops!

I can see why it happens now from the above explanations, but perhaps, therefore, it needs a little more intelligence built in, or perhaps a simple command that effectively locks the mask cache or whatever until unlocked.

Or perhaps a warning:

"Hi, this is Magic Mast from clip number ###. My input pixels have changed, do you want me to ignore them?"

I look forward to further developments. But this is all fun.
Former London-based sound engineer and voice producer for decades who did the odd offline edit on Umatic! Learning Resolve from scratch for fun.
Offline

FlyingZayin

  • Posts: 56
  • Joined: Thu Apr 11, 2019 9:45 am
  • Location: GZ, GD, China
  • Real Name: Mark Vadim

Re: Magic Mask looses mask if I adjust a different node

PostThu Sep 07, 2023 6:45 am

Andy Mees wrote:another way some folks have developed to protect themselves, against casual magic mask cache loss, is to nest any magic mask generation operations inside a Compound Clip ie create a compound clip from the source clip instance, open the compound clip in its own timeline, add the magic mask to the source image as needed, generate the mask cache, and then finally step back out to the parent timeline... thereafter, when you manipulate the pixels of the compound clip, you are manipulating a separate pre-masked object rather than manipulating the pixels of the source clip itself (ie the mask input), thus the mask is preserved. Do be aware though that nesting magic masks inside compound clips comes with the current drawback that such contained masks can be 'hidden' from other standard software operations. Eg Using the Magic Mask >> Regenerate Object Mask > All Clips function at the main timeline level will not regenerate masks for any such nested clips; similarly, the automatic mask regeneration that's triggered via the Delivery Page 'Render' command will skip any nested masks.


>>FF>> Fast Forward to September, 2023. Davinci Studio 18.5.

I'm having a longish (about 30 seconds) clip that I have to use MM twice on.
First, I need to color correct the object in the foreground, separating it from the rest of the picture.
Second, I need to split the clip into three parts of about 10 secs each.
Third, I need to take one of these parts to Fusion, once again MM-out the same object, and make a 3d text orbiting around it.

My actions:
For the First, I do as advised: compound the whole clip, open in timeline, MM the object, colorize it to my liking, all good, back to main timeline.
For the Second, I split the compound clip - so nice, nothing is lost, everything stays in place. But I'm rejoicing a bit too early, because...
When I proceed to the Third, and open the needed fragment in Fusion, create MM node, draw the mask, and click "track" - nothing happens. The node doesn't blink green, no tracking occurs, no matter what I do (restart DVR, reboot the computer, toggle between Better and Faster MM modes, etc., I literally tried every option available).

Looks like Fusion doesn't like applying MM to compound clips to which MM had already been applied somewhere upstream.
Now what, BlackMagicDesign? How many more surprises with Magic Mask are you hiding up your sleeve?
Offline

DefinitelyMatt

  • Posts: 1
  • Joined: Tue Sep 10, 2024 5:16 pm
  • Real Name: Matt Lesniewski

Re: Magic Mask looses mask if I adjust a different node

PostTue Sep 10, 2024 6:05 pm

Magic Mask has been the best and most infuriating tool to use! I cannot imagine anyone who would want their mask to disappear because they made a small change to any part of their grade... At the very least there should be an option to bake in the mask.

However in the meantime, this is the best solution I've found.

Instead of using magic mask in line with your other nodes, create a new node and link it to the source point, then slap on a lut or something to give it some contrast, add a node to that for your magic mask, then link it back to a node where the rest of your grade is with a mask link.

Here's a basic example:

O-->(02) LUT-->(04) Magic Mask-->(05) MM SAT

O-->(01) LUT-->(03) Contrast-->(05) MM SAT-->O

This way any changes you make to Node 01, 03 or any additional nodes you add after will not mess up your magic mask.

It's not perfect though... If you make any changes in your edit tab like extending the clip, reframing or stabilisation that will still undo your magic mask.

I really hope this makes sense and helps someone save a few hours of banging their head against their desk.
Attachments
Screenshot 2024-09-10 at 18.51.27.png
Screenshot 2024-09-10 at 18.51.27.png (118.19 KiB) Viewed 1041 times

Return to DaVinci Resolve

Who is online

Users browsing this forum: Bing [Bot], dirk-pel, Element8, Firehouse Creative, panos_mts, Shy1art and 263 guests