Jump to: Board index » General » Fusion

pCustom manipulate particle y position with FastNoise Image

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

UpStreamFilms

  • Posts: 2
  • Joined: Wed Nov 23, 2022 3:15 pm
  • Real Name: Dominik Dahlen

pCustom manipulate particle y position with FastNoise Image

PostWed Nov 23, 2022 3:34 pm

Hello Blackmagic Community, I'm new to this Forum but you already helped me a lot in my Davinci Resolve learning progression.

But this time I'm really struggeling to get a satisfying result.

I'm currently working on some audio Visualizer in Fusion using the pImageEmitter and pCustom node.
Therfore I generate some particle grid with the pImageEmitter and than trying to use the pCustom node and some FastNoise Image input to manipulate the y position of the particles.

So basically I'm trying to use the red value of the fast noise image using the x and y values of the particle.

But for any reason It always uses the same y value for all particles on the z axis

The expression I'm using is:

pCustom1.PositionYExpression
--> getr1d(pxi1+0.5,pyi1+0.5)*n1 -n2



I attached both version as a comp file (hope the URL is working):
https://drive.google.com/file/d/1emEuH4 ... sp=sharing

Thankyou so much for you help

Regrads
Dominik
Offline

Okke Verbart

  • Posts: 290
  • Joined: Tue Jan 17, 2017 8:40 pm

Re: pCustom manipulate particle y position with FastNoise Im

PostThu Nov 24, 2022 8:58 am

Hi - I had a look at it and the issue you have is that you have the expression in the py position, whereas the "get" function itself also makes use of the py position (so, in a sense it becomes self-referential)


So, instead, what I would do is to:

- get rid of the rotation in the pImageEmitter (this gets you a grid on the x/y axis)
- add the exact same expression in the pz field, and in the py field just have py.
- then after the prender, just use a transform3D and add a x-rotation of -90.

See your updated example (#1) below (just copy & paste into the fusion page):

Code: Select all
{
   Tools = ordered() {
      Ellipse1 = EllipseMask {
         Inputs = {
            Filter = Input { Value = FuID { "Fast Gaussian" }, },
            MaskWidth = Input { Value = 3840, },
            MaskHeight = Input { Value = 2160, },
            PixelAspect = Input { Value = { 1, 1 }, },
            UseFrameFormatSettings = Input { Value = 1, },
            ClippingMode = Input { Value = FuID { "None" }, },
         },
         ViewInfo = OperatorInfo { Pos = { 572.459, 338.708 } },
      },
      Background2 = Background {
         Inputs = {
            EffectMask = Input {
               SourceOp = "Ellipse1",
               Source = "Mask",
            },
            GlobalOut = Input { Value = 481, },
            Width = Input { Value = 40, },
            Height = Input { Value = 40, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Type = Input { Value = FuID { "Gradient" }, },
            Start = Input { Value = { 0.233128834355828, 0.512269938650307 }, },
         },
         ViewInfo = OperatorInfo { Pos = { 579.221, 371.708 } },
      },
      Rectangle1 = RectangleMask {
         Inputs = {
            Filter = Input { Value = FuID { "Fast Gaussian" }, },
            SoftEdge = Input { Value = 0.1181, },
            MaskWidth = Input { Value = 3840, },
            MaskHeight = Input { Value = 2160, },
            PixelAspect = Input { Value = { 1, 1 }, },
            UseFrameFormatSettings = Input { Value = 1, },
            ClippingMode = Input { Value = FuID { "None" }, },
            Width = Input { Value = 0.8, },
            Height = Input { Value = 0.8, },
         },
         ViewInfo = OperatorInfo { Pos = { 469.221, 387.135 } },
      },
      pCustom1 = pCustom {
         ID = 121,
         Inputs = {
            ["CubeRgn.Width"] = Input { Value = 0.732, },
            ["CubeRgn.Depth"] = Input { Value = 0.543, },
            ["BitmapRgn.Channel"] = Input { Value = 1, },
            ["CubeRgn.Height"] = Input { Value = 0.606, },
            NumberIn1 = Input { Value = 0.5, },
            NumberIn2 = Input { Value = 0.206, },
            NumberIn3 = Input { Value = 300, },
            NumberIn5 = Input { Value = 0.232, },
            NumberIn6 = Input {
               SourceOp = "pCustom1NumberIn6",
               Source = "Value",
            },
            PositionZExpression = Input { Value = " getr1d(pxi1+0.5,pyi1+0.5)*n1 -n2", },
            SizeExpression = Input { Value = "a/n3", },
            Input = Input {
               SourceOp = "pImageEmitter2",
               Source = "Output",
            },
            Image1 = Input {
               SourceOp = "FastNoise1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 756.042, 420.464 } },
      },
      pCustom1NumberIn6 = BezierSpline {
         SplineColor = { Red = 233, Green = 19, Blue = 144 },
         CtrlWZoom = false,
         NameSet = true,
         KeyFrames = {
            [3] = { 5 }
         }
      },
      pImageEmitter2 = pImageEmitter {
         ID = 124,
         Inputs = {
            XDensity = Input { Value = 0.2, },
            YDensity = Input { Value = 0.2, },
            Lifespan = Input { Value = 482, },
            Input = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
            Style = Input { Value = FuID { "ParticleStyleBitmap" }, },
            ["ParticleStyleBitmap.DropToolsHere"] = Input {
               SourceOp = "Background2",
               Source = "Output",
            },
            ["ParticleStyle.SizeControls"] = Input { Value = 1, },
            ["ParticleStyle.Size"] = Input { Value = 0.00343, },
            ["ParticleStyle.SizeOverLife"] = Input {
               SourceOp = "pImageEmitter2SizeOverLife",
               Source = "Value",
            },
            ["ParticleStyle.BlurOverLife"] = Input {
               SourceOp = "pImageEmitter2BlurOverLife2D",
               Source = "Value",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 617.1, 421.07 } },
      },
      pImageEmitter2SizeOverLife = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0.5, RH = { 0.333333333333333, 0.5 }, Flags = { Linear = true } },
               [1] = { 0.5, LH = { 0.666666666666667, 0.5 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 192, Green = 128, Blue = 64 },
         CtrlWZoom = false,
      },
      pImageEmitter2BlurOverLife2D = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0.5, RH = { 0.333333333333333, 0.5 }, Flags = { Linear = true } },
               [1] = { 0.5, LH = { 0.666666666666667, 0.5 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 192, Green = 128, Blue = 64 },
         CtrlWZoom = false,
      },
      Background1 = Background {
         Inputs = {
            EffectMask = Input {
               SourceOp = "Rectangle1",
               Source = "Mask",
            },
            GlobalOut = Input { Value = 481, },
            Width = Input { Value = 800, },
            Height = Input { Value = 800, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftRed = Input { Value = 1, },
            TopLeftGreen = Input { Value = 1, },
            TopLeftBlue = Input { Value = 1, },
            Gradient = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 0.0196078431372549, 0.156862745098039, 0.933333333333333, 1 },
                     [1] = { 0.784313725490196, 0.00784313725490196, 1, 1 }
                  }
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { 464.75, 424.983 } },
      },
      pRender1 = pRender {
         Inputs = {
            _MotionBlurWarning = Input { Disabled = true, },
            GlobalOut = Input { Value = 481, },
            Width = Input { Value = 3840, },
            Height = Input { Value = 2160, },
            UseFrameFormatSettings = Input { Value = 1, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            OutputMode = Input { Disabled = true, },
            ["MaterialID.MaterialID"] = Input { Value = 4, },
            ["ObjectID.ObjectID"] = Input { Value = 1, },
            Rotation = Input { Value = 1, },
            Input = Input {
               SourceOp = "pCustom1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 879.212, 420.464 } },
      },
      Camera3D1 = Camera3D {
         Inputs = {
            ["Transform3DOp.Translate.Z"] = Input { Value = 1.20950317876758, },
            AoV = Input { Value = 19.2642683071402, },
            ["Stereo.Mode"] = Input { Value = FuID { "OffAxis" }, },
            FilmGate = Input { Value = FuID { "BMD_URSA_4K_16x9" }, },
            ApertureW = Input { Value = 0.831496062992126, },
            ApertureH = Input { Value = 0.467716535433071, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 4, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 5, },
         },
         ViewInfo = OperatorInfo { Pos = { 965.289, 374.362 } },
      },
      AmbientLight1 = LightAmbient {
         ViewInfo = OperatorInfo { Pos = { 995.459, 457.316 } },
      },
      Transform3D1 = Transform3D {
         Inputs = {
            SceneInput = Input {
               SourceOp = "pRender1",
               Source = "Output",
            },
            ["Transform3DOp.Rotate.X"] = Input { Value = -90, },
         },
         ViewInfo = OperatorInfo { Pos = { 989.212, 419.858 } },
      },
      Merge3D1 = Merge3D {
         Inputs = {
            SceneInput1 = Input {
               SourceOp = "Transform3D1",
               Source = "Output",
            },
            SceneInput2 = Input {
               SourceOp = "AmbientLight1",
               Source = "Output",
            },
            SceneInput3 = Input {
               SourceOp = "Camera3D1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1099.21, 421.07 } },
      },
      Renderer3D1 = Renderer3D {
         CustomData = {
            ToolVersion = 2
         },
         Inputs = {
            GlobalOut = Input { Value = 481, },
            Width = Input { Value = 3840, },
            Height = Input { Value = 2160, },
            UseFrameFormatSettings = Input { Value = 1, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            SceneInput = Input {
               SourceOp = "Merge3D1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1209.21, 421.07 } },
      },
      FastNoise1 = FastNoise {
         Inputs = {
            GlobalOut = Input { Value = 481, },
            Width = Input { Value = 800, },
            Height = Input { Value = 800, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Contrast = Input { Value = 0.81, },
            XScale = Input { Value = 2.36, },
            Angle = Input { Value = 39.1, },
            Seethe = Input { Value = 0.551, },
            SeetheRate = Input { Value = 0.142, },
            Color1Red = Input { Value = 1, },
            Color1Green = Input { Value = 1, },
            Color1Blue = Input { Value = 1, },
            Color2Red = Input { Value = 0, },
            Color2Green = Input { Value = 0, },
            Color2Blue = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 753.489, 486.131 } },
      }
   }
}
www.ablackbirdcalledsue.com
Offline

UpStreamFilms

  • Posts: 2
  • Joined: Wed Nov 23, 2022 3:15 pm
  • Real Name: Dominik Dahlen

Re: pCustom manipulate particle y position with FastNoise Im

PostFri Nov 25, 2022 7:27 am

Thank you so much, thats it.
At least I was close to the solution :-) . But without your help I would stuck there forever I guess :D

Return to Fusion

Who is online

Users browsing this forum: Bing [Bot] and 30 guests