Page 1 of 1

Combining 2 or more shapes

PostPosted: Wed Jun 19, 2019 7:11 am
by rsf123
I know how to draw individual shapes using the various ellipse/polygon/rectangle nodes, and linking it into a background node.

But my question is: Is there a way to combine several shapes into one entity so that movement animation to the entire group.

e.g. if I draw a circle and square, how do I merge the circle and square so they form one entity, so that I can apply timeline effects to that one entity?

Re: Combining 2 or more shapes

PostPosted: Thu Jun 20, 2019 9:45 am
by Frank Feijen
By adding a transform node?
Code: Select all
{
   Tools = ordered() {
      Rectangle1 = RectangleMask {
         Inputs = {
            MaskWidth = Input { Value = 1920, },
            MaskHeight = Input { Value = 1080, },
            PixelAspect = Input { Value = { 1, 1 }, },
            ClippingMode = Input { Value = FuID { "None" }, },
            Center = Input { Value = { 0.234015345268542, 0.490909090909091 }, },
            Width = Input { Value = 0.124040920716112, },
            Height = Input { Value = 0.231818181818182, },
         },
         ViewInfo = OperatorInfo { Pos = { 330, 247.5 } },
      },
      Ellipse1 = EllipseMask {
         Inputs = {
            MaskWidth = Input { Value = 1920, },
            MaskHeight = Input { Value = 1080, },
            PixelAspect = Input { Value = { 1, 1 }, },
            ClippingMode = Input { Value = FuID { "None" }, },
            Center = Input { Value = { 0.80690537084399, 0.529545454545455 }, },
            Width = Input { Value = 0.126978942069631, },
            Height = Input { Value = 0.126978942069631, },
            EffectMask = Input {
               SourceOp = "Rectangle1",
               Source = "Mask",
            }
         },
         ViewInfo = OperatorInfo { Pos = { 440, 247.5 } },
      },
      Transform1 = Transform {
         CtrlWZoom = false,
         Inputs = {
            Angle = Input {
               Value = 1070,
               Expression = "time*10",
            },
            Input = Input {
               SourceOp = "Ellipse1",
               Source = "Mask",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 550, 247.5 } },
      },
      Background1 = Background {
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftRed = Input { Value = 1, },
            EffectMask = Input {
               SourceOp = "Transform1",
               Source = "Output",
            }
         },
         ViewInfo = OperatorInfo { Pos = { 660, 247.5 } },
      }
   }
}

Re: Combining 2 or more shapes

PostPosted: Thu Jun 20, 2019 3:21 pm
by Bryan Ray
Frank answered indirectly. You can chain mask tools together using their Effect Mask inputs, and they'll Merge. When you connect them, the downstream masks will get a new input that allows you to choose the blend method. If you need a slightly more complex arrangement—for instance, you need to invert some of the masks together prior to combining with another set, you can use the Bitmap tool to tie two branches together.

The Bitmap's own controls affect the Background input, so if you're Subtracting, the Background masks will be subtracted _from_ the masks coming in on the Effect Mask. I like to use Bitmap also to get a single Level and Softness control for a group of masks so they don't have to be adjusted individually if they all represent a single object. It's also useful to be able to Invert a combined matte, since Inverting the masks individually will cause them to merge unpredictably.

Re: Combining 2 or more shapes

PostPosted: Thu Jun 20, 2019 3:26 pm
by Sander de Regt
I think the OP was also asking about ways to make them move as one, would a transform tool help for that? I've always found that part to be a bit flakey.

Re: Combining 2 or more shapes

PostPosted: Sat Jun 22, 2019 7:03 am
by rsf123
Sander de Regt wrote:I think the OP was also asking about ways to make them move as one, would a transform tool help for that? I've always found that part to be a bit flakey.


Yes. the only reason I asked about combining two objects is so that, when I apply movement, both objects move in tandem.

Also, I'm new to Fusion/Resolve and haven't got around to understanding codes.

Re: Combining 2 or more shapes

PostPosted: Mon Jun 24, 2019 7:55 am
by Frank Feijen
Did you try my example? Just copy-paste the code into Fusion with the node-view active. It's 2 masks concatenated with a transform. Works like a charm ;)

Re: Combining 2 or more shapes

PostPosted: Mon Jun 24, 2019 8:37 am
by rsf123
Frank Feijen wrote:Did you try my example? Just copy-paste the code into Fusion with the node-view active. It's 2 masks concatenated with a transform. Works like a charm ;)


Thanks, but I new to Davinci Resolve and VFX. I haven't seen any tutorials on youtube on how to paste in the code.

Re: Combining 2 or more shapes

PostPosted: Mon Jun 24, 2019 9:02 am
by Frank Feijen
in my first post (thus the second post in this list), select all the code from and including the first { and the last }, copy it (ctrl-c), go to your fusion tab in resolve, make sure that the node-area is active, and paste (ctrl-v). The nodes should magically appear!

Don't use the auto-select feature, it doesn't seem to work...

Re: Combining 2 or more shapes

PostPosted: Tue Jun 25, 2019 9:02 am
by rsf123
Frank Feijen wrote:in my first post (thus the second post in this list), select all the code from and including the first { and the last }, copy it (ctrl-c), go to your fusion tab in resolve, make sure that the node-area is active, and paste (ctrl-v). The nodes should magically appear!

Don't use the auto-select feature, it doesn't seem to work...



I did the copy and paste, and this is what appeared in the Fusion tab (see below), but it is not clear how the two diagrams move together as one?

Re: Combining 2 or more shapes

PostPosted: Tue Jun 25, 2019 9:09 am
by Sander de Regt
Select just the transform tool, and move the center cross-hair, the other shapes will move with it.