Jump to: Board index » General » Fusion

Accessing the position coordinates of a particle.

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

Ignacio de La Cierva

  • Posts: 163
  • Joined: Tue Apr 26, 2016 12:20 pm

Accessing the position coordinates of a particle.

PostTue Jan 16, 2018 2:09 pm

I need an object to follow the x movement of a particle. Is it possible?

I've seen Fusion keeps particle ID's, so there might be a syntax to get that value.


Someting like pEmitter1.ParticleID1.Translate.X

but I can't find how to do that. I've found how to use pCustom to put a value in the particle x position (move it to where I want).

But what I need is the opposite: reading the x-position of a system-animated particle, instead of manually animate it.

Any help?
Offline

Okke Verbart

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

Re: Accessing the position coordinates of a particle.

PostTue Jan 16, 2018 4:56 pm

I've looked for that myself for some time but never found anything. Maybe it could be done with a Fuse that reads the output of the pEmitter or any of the subsequent (pre-pRender) particle nodes and makes it available based on a user-provided particle ID?
www.ablackbirdcalledsue.com
Offline

Ignacio de La Cierva

  • Posts: 163
  • Joined: Tue Apr 26, 2016 12:20 pm

Re: Accessing the position coordinates of a particle.

PostTue Jan 16, 2018 5:24 pm

Ok. If you could not find it, this newbie won't waste one minute more :D

I'l use a simple triangle wave function. I wont be able to animate the amplitude with constant speed as I wanted, it results in weird hi-freq shakes during the transition. Works with step (abrupt) changes, but then the object jumps to new position.

I have a easy workaround to this limitation:

Nobody requests me to show the whole process in one single countinuous shot. I'll change camera shot to a different angle (and different Fusion Comp and render) every time I need to change amplitude and period to make them fit the currently printed section. Easy.

Thanks again Okke.
Offline
User avatar

Bryan Ray

  • Posts: 2488
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Re: Accessing the position coordinates of a particle.

PostTue Jan 16, 2018 7:12 pm

This is a little strange, but…

Code: Select all
{
   Tools = ordered() {
      Background1 = Background {
         Inputs = {
            GlobalIn = Input { Value = 1, },
            GlobalOut = Input { Value = 152, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftRed = Input { Value = 1, },
            TopLeftGreen = Input { Value = 1, },
            TopLeftBlue = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 1045, 115.5 } },
      },
      Tracker1 = Tracker {
         Trackers = {
            {
               PatternTime = 1,
               PatternX = 0.490873015873016,
               PatternY = 0.483823529411765
            }
         },
         CtrlWZoom = false,
         Inputs = {
            Input = Input {
               SourceOp = "Merge2",
               Source = "Output",
            },
            Name1 = Input { Value = "Tracker 1", },
            PatternCenter1 = Input { Value = { 0.490873015485704, 0.483823528513312 }, },
            PatternWidth1 = Input { Value = 0.0447089947089947, },
            PatternHeight1 = Input { Value = 0.0782352941176472, },
            SearchWidth1 = Input { Value = 0.240476190476191, },
            SearchHeight1 = Input { Value = 0.402941176470588, },
            TrackedCenter1 = Input { Value = { 0.490873015485704, 0.483823528513312 }, },
         },
         ViewInfo = OperatorInfo { Pos = { 1210, 181.5 } },
      },
      Transform3D1 = Transform3D {
         Inputs = {
            ["Transform3DOp.Translate.X"] = Input { Expression = "Background2.TopLeftRed", },
            ["Transform3DOp.Translate.Y"] = Input { Expression = "Background2.TopLeftGreen", },
            ["Transform3DOp.Translate.Z"] = Input { Expression = "Background2.TopLeftBlue", },
            ["Transform3DOp.Rotation"] = Input { Value = 0, },
            ["Transform3DOp.ScaleNest"] = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 1705, 181.5 } },
      },
      Background2 = Background {
         Inputs = {
            GlobalIn = Input { Value = 1, },
            GlobalOut = Input { Value = 152, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftRed = Input {
               SourceOp = "Probe1",
               Source = "Result",
            },
            TopLeftGreen = Input {
               SourceOp = "Probe1",
               Source = "Green",
            },
            TopLeftBlue = Input {
               SourceOp = "Probe1",
               Source = "Blue",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1430, 181.5 } },
      },
      Probe1 = Probe {
         CtrlWZoom = false,
         Inputs = {
            ImageToProbe = Input {
               SourceOp = "Merge2",
               Source = "Output",
            },
            Position = Input {
               SourceOp = "Tracker1",
               Source = "Position1",
            },
         },
      },
      pCustom1 = pCustom {
         ID = 8,
         Inputs = {
            RedExpression = Input { Value = "px", },
            GreenExpression = Input { Value = "py", },
            BlueExpression = Input { Value = "pz", },
            Input = Input {
               SourceOp = "pTurbulence1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 660, 181.5 } },
      },
      Renderer3D1 = Renderer3D {
         CustomData = {
            ToolVersion = 2,
         },
         Inputs = {
            GlobalIn = Input { Value = 1, },
            GlobalOut = Input { Value = 152, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            SceneInput = Input {
               SourceOp = "pRender1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 935, 181.5 } },
      },
      Merge2 = Merge {
         Inputs = {
            UseOpenCL = Input { Value = 0, },
            Background = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Renderer3D1",
               Source = "Output",
            },
            PerformDepthMerge = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 1045, 181.5 } },
      },
      pTurbulence1 = pTurbulence {
         ID = 5,
         Inputs = {
            XStrength = Input { Value = 1, },
            YStrength = Input { Value = 1, },
            ZStrength = Input { Value = 1, },
            StrengthOverLifeLUT = Input {
               SourceOp = "pTurbulence1StrengthoverLifeLUT",
               Source = "Value",
            },
            Density = Input { Value = 3, },
            Input = Input {
               SourceOp = "pEmitter1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 495, 181.5 } },
      },
      pTurbulence1StrengthoverLifeLUT = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0.5, RH = { 0.3, 0.5 }, Flags = { Linear = true } },
               [1] = { 0.5, LH = { 0.7, 0.5 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 192, Green = 128, Blue = 64 },
         NameSet = true,
      },
      pEmitter1 = pEmitter {
         ID = 1,
         Inputs = {
            Number = Input {
               SourceOp = "pEmitter1Number",
               Source = "Value",
            },
            Lifespan = Input { Value = 1000, },
            Style = Input { Value = FuID { "ParticleStyleNGon" }, },
            ["ParticleStyle.SizeOverLife"] = Input {
               SourceOp = "pEmitter1SizeoverLife",
               Source = "Value",
            },
            ["ParticleStyle.BlurOverLife"] = Input {
               SourceOp = "pEmitter1BluroverLife2D",
               Source = "Value",
            },
            ["ParticleStyleNGon.NGonType"] = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 385, 181.5 } },
      },
      pEmitter1Number = BezierSpline {
         SplineColor = { Red = 233, Green = 206, Blue = 78 },
         NameSet = true,
         KeyFrames = {
            [1] = { 1, RH = { 1.33333333333333, 0.666666666666667 }, Flags = { Linear = true } },
            [2] = { 0, LH = { 1.66666666666667, 0.333333333333333 }, Flags = { Linear = true } }
         }
      },
      pEmitter1SizeoverLife = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0.5, RH = { 0.3, 0.5 }, Flags = { Linear = true } },
               [1] = { 0.5, LH = { 0.7, 0.5 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 192, Green = 128, Blue = 64 },
         NameSet = true,
      },
      pEmitter1BluroverLife2D = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0.5, RH = { 0.3, 0.5 }, Flags = { Linear = true } },
               [1] = { 0.5, LH = { 0.7, 0.5 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 192, Green = 128, Blue = 64 },
         NameSet = true,
      },
      pRender1 = pRender {
         Inputs = {
            _MotionBlurWarning = Input { Disabled = true, },
            GlobalIn = Input { Value = 1, },
            GlobalOut = Input { Value = 152, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            OutputMode = Input { Disabled = true, },
            IntegrationMethod = Input { Value = FuID { "RK4" }, },
            ["MaterialID.MaterialID"] = Input { Value = 1, },
            ["ObjectID.ObjectID"] = Input { Value = 1, },
            Input = Input {
               SourceOp = "pCustom1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 825, 181.5 } },
      },
      Note3 = Note {
         Inputs = {
            Comments = Input { Value = "Apply Tracking data to Probe Position and sample its color.", }
         },
         ViewInfo = StickyNoteInfo {
            Pos = { 1430, 214.5 },
            Flags = {
               Expanded = true
            },
            Size = { 163, 77.3 }
         },
      },
      Note4 = Note {
         Inputs = {
            Comments = Input { Value = "Link X,Y,Z Offset to Background's color.", }
         },
         ViewInfo = StickyNoteInfo {
            Pos = { 1650, 214.5 },
            Flags = {
               Expanded = true
            },
            Size = { 188, 82.3 }
         },
      },
      Note2 = Note {
         Inputs = {
            Comments = Input { Value = "Track the particle", }
         },
         ViewInfo = StickyNoteInfo {
            Pos = { 1210, 214.5 },
            Flags = {
               Expanded = true
            },
            Size = { 144, 60.3 }
         },
      },
      Note1 = Note {
         Inputs = {
            Comments = Input { Value = "Set particle color to position", }
         },
         ViewInfo = StickyNoteInfo {
            Pos = { 605, 214.5 },
            Flags = {
               Expanded = true
            },
            Size = { 150, 62.3 }
         },
      }
   }
}
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline

Ignacio de La Cierva

  • Posts: 163
  • Joined: Tue Apr 26, 2016 12:20 pm

Re: Accessing the position coordinates of a particle.

PostWed Jan 17, 2018 1:03 am

Amazing. The Mother of All Workarounds. :)

I might try to implement in my scene just for the pleasure of seeing it work.

At this moment, my option is the simplest: Take advantage of every camera angle change (different renders) to adjust amplitude/period of the triangle wave oscilation, and keep it constant until next shot.

(If I implement the track trick and it works, I'd probably include in the final video a weird and completely unnecesary close up shot of the transition areas, just because it was so complicated to do LOL)

Return to Fusion

Who is online

Users browsing this forum: No registered users and 60 guests