Jump to: Board index » General » Fusion

Can sJitter be limited to last grid shapes, not all shapes

Learn about 3D compositing, animation, broadcast design and VFX workflows.
  • Author
  • Message
Offline

dilbert99

  • Posts: 11
  • Joined: Sun May 31, 2020 10:17 am
  • Real Name: David Smith

Can sJitter be limited to last grid shapes, not all shapes

PostThu Sep 09, 2021 3:06 pm

I was trying to create a picture using fusion shapes.

Idea was to have a triangle for tree branches duplicated vertically with a rectangle underneath - imaging traditional kids christmas tree drawing

then this is duplicated horizonally at random spacing by adding a jitter after the tree

So triangle -> dup 3 times
merge with trunk
-> dup 5 times ->jitter -> render

but the jitter is affecting both dupes and then they are no longer trees - just a random bunch of shapes.

Code: Select all
{
   Tools = ordered() {
      Merge8 = Merge {
         Inputs = {
            Background = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "sRender6",
               Source = "Output",
            },
            PerformDepthMerge = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 715, 313.5 } },
      },
      MediaOut1 = MediaOut {
         CtrlWZoom = false,
         Inputs = {
            Index = Input { Value = "0", },
            Input = Input {
               SourceOp = "Merge8",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 935, 313.5 } },
      },
      Background1 = Background {
         Inputs = {
            GlobalOut = Input { Value = 119, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            UseFrameFormatSettings = Input { Value = 1, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftRed = Input { Value = 0.211764705882353, },
            TopLeftGreen = Input { Value = 0.211764705882353, },
            TopLeftBlue = Input { Value = 0.211764705882353, },
         },
         ViewInfo = OperatorInfo { Pos = { 385, 313.5 } },
      },
      sRender6 = sRender {
         Inputs = {
            GlobalOut = Input { Value = 119, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            UseFrameFormatSettings = Input { Value = 1, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Input = Input {
               SourceOp = "sJitter5",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 715, 247.5 } },
      },
      sJitter5 = sJitter {
         Inputs = {
            ["Shape.OffsetX.Min"] = Input { Value = -0.1, },
            ["Shape.OffsetX.Max"] = Input { Value = 0.1, },
            ["Shape.SizeY.Min"] = Input { Value = 0.719, },
            Input = Input {
               SourceOp = "treeDup",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 715, 181.5 } },
      },
      treeDup = sDuplicate {
         NameSet = true,
         Inputs = {
            Copies = Input { Value = 3, },
            XOffset = Input { Value = 0.14, },
            Input = Input {
               SourceOp = "sTransform6",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 715, 115.5 } },
      },
      sTransform6 = sTransform {
         Inputs = {
            XOffset = Input { Value = -0.191063174114022, },
            YOffset = Input { Value = -0.00727779302193047, },
            Input = Input {
               SourceOp = "sMerge8",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 495, 148.5 } },
      },
      sMerge8 = sMerge {
         Inputs = {
            Input1 = Input {
               SourceOp = "trunkRect",
               Source = "Output",
            },
            Input2 = Input {
               SourceOp = "branchDup",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 495, 115.5 } },
      },
      trunkRect = sRectangle {
         NameSet = true,
         Inputs = {
            ["Translate.X"] = Input { Value = 0.00154083204930663, },
            ["Translate.Y"] = Input { Value = -0.0620911539932821, },
            Width = Input { Value = 0.01, },
            Height = Input { Value = 0.1, },
            Red = Input { Value = 0.450980392156863, },
            Green = Input { Value = 0.32156862745098, },
            Blue = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 550, 16.5 } },
      },
      treeBranchTriangle = sNGon {
         NameSet = true,
         Inputs = {
            Sides = Input { Value = 3, },
            Width = Input { Value = 0.1, },
            Height = Input { Value = 0.1, },
            Angle = Input { Value = -30, },
            Red = Input { Value = 0, },
            Green = Input { Value = 0.333333333333333, },
            Blue = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 440, 16.5 } },
      },
      branchDup = sDuplicate {
         NameSet = true,
         Inputs = {
            Copies = Input { Value = 3, },
            YOffset = Input { Value = 0.04, },
            Input = Input {
               SourceOp = "treeBranchTriangle",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 440, 49.5 } },
      }
   }
}
Offline
User avatar

TheBloke

  • Posts: 1905
  • Joined: Sat Nov 02, 2019 11:49 pm
  • Location: UK
  • Real Name: Tom Jobbins

Re: Can sJitter be limited to last grid shapes, not all shap

PostSun Sep 12, 2021 4:19 pm

As you say, it always applies equally to every shape, so because the trees are made of individual shapes each component part gets jittered.

I think basically this possibility has not been considered in the Shape design. I did actually find a way, but due to current limitations, it's not really a good solution.

The sort-of not-really solution: use an sBoolean instead of the sMerge to combine the component shapes first, then sJitter. This works:
Image

To produce this:
Image

We've got random distribution. We've also lost all our colours. Now the colour of all the trees is controlled by the sBoolean Style tab. You can colour the whole trees however you want, but you can't have the trunk and leaves be different colours.

This is due to a really frustrating limitation in sBoolean: it always replaces the Style. There's actually a dropdown for Style, but the only option is Replace:
Image

All we'd need for this to work as you hoped was an "Ignore" or "Keep" option under Style. That would then achieve the result you want - grouping individual shapes into a single shape for the purpose of sJitter - without losing your colours.

Feature request I guess? Or another way to achieve the same would be a new option in sMerge: "Group shapes as one", specifying that the output of the sMerge is a single shape, not an array of shapes.

Perhaps ideally, both should be implemented. This would cover more bases, allowing sMerge to be used for simple shape combinations, and sBoolean for more complex ones where the Union/Intersect/Subtract/Xor options come into play.

Below, two other ideas to achieve the same result outside of the shape system. First remove the sJitter, then either:

1. Pass sRender6 to a Duplicate node, set Copies appropriately, then set Jitter -> Center X to taste
or
2. Pass sRender6 to a pEmitter, then from there to a pRender. Set pRender to 2D. Set pEmitter to Style -> Bitmap (you'll need to do that before you can pass sRender6 into it). Set Region to Line or Cube (with height 0). Keyframe Emitter -> Number, setting the value on frame 0 to the number of trees you want, then set it to 0 on the next frame. Adjust Lifespan up to however long you want the trees to last. Then play with Position Variance, Temporal Distribution, Random Seed.

Duplicate is nice and simple for a fixed position, but going into 2D particles will give you far more power if you want to have them move or change over time.

Here's the node code for the sBoolean 'solution':
Code: Select all
{
   Tools = ordered() {
      sRender6 = sRender {
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            UseFrameFormatSettings = Input { Value = 1, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Input = Input {
               SourceOp = "sJitter1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1144.67, -93 } },
      },
      sJitter1 = sJitter {
         CtrlWZoom = false,
         Inputs = {
            ["Shape.OffsetX.Min"] = Input { Value = 0.2044, },
            ["Shape.OffsetX.Max"] = Input { Value = 0.3, },
            Input = Input {
               SourceOp = "sTransform6",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1026, -93 } },
      },
      sTransform6 = sTransform {
         Inputs = {
            XOffset = Input { Value = -0.524, },
            YOffset = Input { Value = -0.007, },
            Input = Input {
               SourceOp = "treeDup",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 872, -93 } },
      },
      treeDup = sDuplicate {
         NameSet = true,
         Inputs = {
            Copies = Input { Value = 5, },
            XOffset = Input { Value = 0.13, },
            AxisMode = Input { Value = FuID { "Absolute" }, },
            XPivot = Input { Value = 0.101, },
            YPivot = Input { Value = 0.058, },
            Input = Input {
               SourceOp = "sBoolean1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 741.333, -93 } },
      },
      sBoolean1 = sBoolean {
         Inputs = {
            Operation = Input { Value = FuID { "Union" }, },
            Input1 = Input {
               SourceOp = "trunkRect",
               Source = "Output",
            },
            Input2 = Input {
               SourceOp = "branchDup",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 586.333, -93 } },
      },
      trunkRect = sRectangle {
         NameSet = true,
         Inputs = {
            ["Translate.X"] = Input { Value = 0.00154083204930663, },
            ["Translate.Y"] = Input { Value = -0.0620911539932821, },
            Width = Input { Value = 0.01, },
            Height = Input { Value = 0.1, },
            Red = Input { Value = 0.450980392156863, },
            Green = Input { Value = 0.32156862745098, },
            Blue = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 586.333, -127.212 } },
      },
      branchDup = sDuplicate {
         NameSet = true,
         Inputs = {
            Copies = Input { Value = 3, },
            YOffset = Input { Value = 0.04, },
            Input = Input {
               SourceOp = "treeBranchTriangle",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 443.667, -93 } },
      },
      treeBranchTriangle = sNGon {
         NameSet = true,
         Inputs = {
            Sides = Input { Value = 3, },
            Width = Input { Value = 0.1, },
            Height = Input { Value = 0.1, },
            Angle = Input { Value = -30, },
            Red = Input { Value = 0, },
            Green = Input { Value = 0.333333333333333, },
            Blue = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 443.667, -126 } },
      }
   }
}
Resolve Studio 17.4.3 and Fusion Studio 17.4.3 on macOS 11.6.1

Hackintosh:: X299, Intel i9-10980XE, 128GB DDR4, AMD 6900XT 16GB
Monitors: 1 x 3840x2160 & 3 x 1920x1200
Disk: 2TB NVMe + 4TB RAID0 NVMe; NAS: 36TB RAID6
BMD Speed Editor

Return to Fusion

Who is online

Users browsing this forum: No registered users and 43 guests