Rotate a clip about the center of its mask on Fusion

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

purplemagic

  • Posts: 58
  • Joined: Tue Jan 05, 2021 9:23 pm
  • Real Name: Justin Lewis

Rotate a clip about the center of its mask on Fusion

PostThu Jan 07, 2021 10:17 pm

I'm trying to build a Fusion composite that rotates a clip about the center of its circular mask.

So I added an elliptical mask to the Media In, and attached the Media In to a Tranform which will in turn rotate it.

When I set the Pivot of the Tranform to the same as that of the mask and adjust the Tranform's Rotation Angle, the clip starts rotating but soon goes off the screen! On the other hand, if the mask is placed at the exact center of the screen, it works fine.

What did I do wrong here?

Thanks.
Offline

Sander de Regt

  • Posts: 3948
  • Joined: Thu Nov 13, 2014 10:09 pm

Re: Rotate a clip about the center of its mask on Fusion

PostFri Jan 08, 2021 9:53 am

I don't think you did anything wrong per se, but are you using the transform only for rotating or also scaling and positioning?

Can you share a composition? (select all your nodes - copy/paste between [code][/code] tags)
Sander de Regt

ShadowMaker SdR
The Netherlands
Offline

purplemagic

  • Posts: 58
  • Joined: Tue Jan 05, 2021 9:23 pm
  • Real Name: Justin Lewis

Re: Rotate a clip about the center of its mask on Fusion

PostFri Jan 08, 2021 8:14 pm

Sander de Regt wrote:I don't think you did anything wrong per se, but are you using the transform only for rotating or also scaling and positioning?

Can you share a composition?


After further investigation, I found that the clip goes off screen only when I manually move the mask in the Node Editor after the first frame of the clip. If I move the mask at the first frame, it works fine. Any idea why? Here's the code. I appreciate your help.

Code: Select all
{
   Tools = ordered() {
      Merge = Merge {
         NameSet = true,
         Inputs = {
            Background = Input {
               SourceOp = "RotateInner",
               Source = "Output",
            },
            PerformDepthMerge = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 440, -16.5 } },
      },
      RotateInner = Transform {
         NameSet = true,
         Inputs = {
            Pivot = Input {
               Value = { 0.729110529238682, 0.500205616644276 },
               Expression = "Point(InnerMask.Center.X, InnerMask.Center.Y)",
            },
            Size = Input { Value = 1.51, },
            Angle = Input { Expression = "time / comp:GetPrefs().Comp.FrameFormat.Rate * 30", },
            ReferenceSize = Input { Value = 1, },
            Input = Input {
               SourceOp = "MediaIn",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 275, -16.5 } },
      },
      InnerMask = EllipseMask {
         NameSet = true,
         Inputs = {
            Filter = Input { Value = FuID { "Fast Gaussian" }, },
            MaskWidth = Input { Value = 512, },
            MaskHeight = Input { Value = 285, },
            PixelAspect = Input { Value = { 1, 1 }, },
            UseFrameFormatSettings = Input { Value = 1, },
            ClippingMode = Input { Value = FuID { "None" }, },
            Center = Input { Value = { 0.729110529238682, 0.500205616644276 }, },
            Width = Input { Value = 0.234622170873801, },
            Height = Input {
               Value = 0.234622170873801,
               Expression = "InnerMask.Width",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 55, -16.5 } },
      },
      MediaOut = MediaOut {
         CtrlWZoom = false,
         NameSet = true,
         Inputs = {
            Index = Input { Value = "0", },
            Input = Input {
               SourceOp = "Merge",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 605, -16.5 } },
      },
      MediaIn = MediaIn {
         ExtentSet = true,
         NameSet = true,
         CustomData = { MediaProps = {
               MEDIA_FORMAT_TYPE = "PNG",
               MEDIA_HEIGHT = 285,
               MEDIA_LAYER_DESC = {
               },
               MEDIA_MARK_IN = 0,
               MEDIA_MARK_OUT = 119,
               MEDIA_NAME = "test.png",
               MEDIA_NUM_FRAMES = 120,
               MEDIA_NUM_LAYERS = 0,
               MEDIA_PAR = 1,
               MEDIA_PATH = "test.png",
               MEDIA_SRC_FRAME_RATE = 24,
               MEDIA_START_FRAME = 0,
               MEDIA_WIDTH = 512
            }, },
         Inputs = {
            EffectMask = Input {
               SourceOp = "InnerMask",
               Source = "Mask",
            },
            GlobalOut = Input { Value = 119, },
            Layer = Input { Value = "0", },
            ClipTimeEnd = Input { Value = 119, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
         },
         ViewInfo = OperatorInfo { Pos = { 165, -16.5 } },
      }
   }
}
Offline

Sander de Regt

  • Posts: 3948
  • Joined: Thu Nov 13, 2014 10:09 pm

Re: Rotate a clip about the center of its mask on Fusion

PostSat Jan 09, 2021 10:59 am

I can't replicate your problem I'm afraid. Whatever I do with the mask, everything rotates just as I'd expect it to. Can you perhaps make a screengrab/video to show your issue?
Sander de Regt

ShadowMaker SdR
The Netherlands
Offline

purplemagic

  • Posts: 58
  • Joined: Tue Jan 05, 2021 9:23 pm
  • Real Name: Justin Lewis

Re: Rotate a clip about the center of its mask on Fusion

PostSun Jan 10, 2021 3:07 am

Sander de Regt wrote:I can't replicate your problem I'm afraid. Whatever I do with the mask, everything rotates just as I'd expect it to. Can you perhaps make a screengrab/video to show your issue?

On the Fusion page, move the playhead to frame 100 or later and try moving the mask using the onscreen control. The mask will soon disappear. Thanks again.
Offline

Sander de Regt

  • Posts: 3948
  • Joined: Thu Nov 13, 2014 10:09 pm

Re: Rotate a clip about the center of its mask on Fusion

PostSun Jan 10, 2021 8:39 am

I'm using Fusion standalone and it doesn't happen for me, so I can't reproduce your problem.
That's why I was asking for a video to demonstrate, because there doesn't seem to be an actual problem with your setup, which means something else is causing it.

Is your MediaIn long enough? What are you connecting to the merge? (there is nothing connected to it in the code that you posted) etc
Sander de Regt

ShadowMaker SdR
The Netherlands
Offline

purplemagic

  • Posts: 58
  • Joined: Tue Jan 05, 2021 9:23 pm
  • Real Name: Justin Lewis

Re: Rotate a clip about the center of its mask on Fusion

PostTue Jan 12, 2021 1:16 am

Sander de Regt wrote:I'm using Fusion standalone and it doesn't happen for me, so I can't reproduce your problem.
That's why I was asking for a video to demonstrate, because there doesn't seem to be an actual problem with your setup, which means something else is causing it.

Is your MediaIn long enough? What are you connecting to the merge? (there is nothing connected to it in the code that you posted) etc


If that's the case, I suspect it is a Davinci Resolve bug. In fact, my Davinci Resolve has been crashing at least once per session with no apparent reason. Thank you for your help.
Offline

Chris Theofanopoulos

  • Posts: 76
  • Joined: Thu Jul 25, 2019 11:06 am
  • Location: Greece
  • Real Name: Christos Theofanopoulos

Re: Rotate a clip about the center of its mask on Fusion

PostTue Jan 12, 2021 7:56 pm

purplemagic wrote:
Sander de Regt wrote:I can't replicate your problem I'm afraid. Whatever I do with the mask, everything rotates just as I'd expect it to. Can you perhaps make a screengrab/video to show your issue?

On the Fusion page, move the playhead to frame 100 or later and try moving the mask using the onscreen control. The mask will soon disappear. Thanks again.
Masks create keyframes when you move them around. If you have moved the pivot point from the center I think it is normal. You should probably animate the pivot point according to your mask animation

Sent from my FIG-LX1 using Tapatalk
Mac Pro 2019
Xeon W 3,5ghz
96Gb ram
Radeon Pro Vega II 32Gb

iMac (Retina 5K, 27-inch, 2019)
intel i9
64 GB 2400 MHz DDR4
Radeon Pro 580X 8 GB

Return to DaVinci Resolve

Who is online

Users browsing this forum: dirk-pel, qsipher, Robert John and 259 guests