Page 1 of 1

Particle start time

PostPosted: Wed May 22, 2019 8:08 pm
by Dennis Summers
I'm sure there must be an easy solution that I seem to be overlooking. I want my particle system (in this case a pImageEmitter) to start generating particles at a different time than 0. Can anyone help me with this? thanx

Re: Particle start time

PostPosted: Wed May 22, 2019 8:21 pm
by Sander de Regt
Animate the 'number' in your pEmitter from 0 to whatever you want at the frame you want the emission to start.

Re: Particle start time

PostPosted: Thu May 23, 2019 12:15 am
by Dennis Summers
Thank-you for your quick response. I do see "number" in pEmitter. But I don't see number in pImageEmitter. Am I missing something here? And for what it's worth I tried animating x and y density but that seems to have no effect.

Re: Particle start time

PostPosted: Thu May 23, 2019 1:19 am
by Bryan Ray
Hmmm.... I've never tried it with pImageEmitter. I think you'll want to manage the image input in such a way as the image is only present on the frame(s) you want to emit particles. Something like a BrightnessContrast with 0 Gain and the Alpha box checked. Animate the Gain to 1 on the frame you wish to emit, then back to 0 when you want it to stop.

In the emitter, turn on Create Particles Every Frame and turn Alpha Threshold up to some non-zero value (the exact value depends on what the alpha situation in your source image is.

I haven't tried it, so I'm not sure how well that will work, but it might do what you're looking for. Or there might be a much simpler solution that didn't occur to me.

Re: Particle start time

PostPosted: Thu May 23, 2019 3:08 am
by Dennis Summers
Thank-you also for the response. If I understood your suggestion correctly it doesn't seem to work, along with the fact that I don't want particles created at every frame. I'm absolutely flummoxed that this may turn out to be tricky. I can't possibly be the first person to want to start an image based particle system at a non zero frame. I've also tried time speed with no success. I think that there might be a way to do this using pCustom, but I'd need someone who actually knows how to use that to give me the steps. Anyone?

Re: Particle start time

PostPosted: Thu May 23, 2019 4:58 am
by Bryan Ray
It works, but I did miss something. You also need to set Lock Color to Initial Frame in order to avoid having the particles vanish when you turn off emission. Here's an example:

Code: Select all
{
   Tools = ordered() {
      BrightnessContrast1 = BrightnessContrast {
         CtrlWZoom = false,
         Inputs = {
            Alpha = Input { Value = 1, },
            Gain = Input {
               SourceOp = "BrightnessContrast1Gain",
               Source = "Value",
            },
            Input = Input {
               SourceOp = "FastNoise1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 616, -9.60607 } },
      },
      BrightnessContrast1Gain = BezierSpline {
         SplineColor = { Red = 104, Green = 144, Blue = 233 },
         NameSet = true,
         KeyFrames = {
            [17] = { 0, RH = { 17.3333333333333, 0.333333333333333 }, Flags = { Linear = true } },
            [18] = { 1, LH = { 17.6666666666667, 0.666666666666667 }, RH = { 18.3333333333333, 0.666666666666667 }, Flags = { Linear = true } },
            [19] = { 0, LH = { 18.6666666666667, 0.333333333333333 }, Flags = { Linear = true } }
         }
      },
      pImageEmitter1 = pImageEmitter {
         ID = 25,
         Inputs = {
            XDensity = Input { Value = 0.1, },
            YDensity = Input { Value = 0.1, },
            AlphaThreshold = Input { Value = 0.001, },
            LockParticleColorToInitialFrame = Input { Value = 1, },
            CreateParticlesEveryFrame = Input { Value = 1, },
            Input = Input {
               SourceOp = "BrightnessContrast1",
               Source = "Output",
            },
            ["ParticleStyle.SizeOverLife"] = Input {
               SourceOp = "pImageEmitter1SizeOverLife",
               Source = "Value",
            },
            ["ParticleStyle.BlurOverLife"] = Input {
               SourceOp = "pImageEmitter1BlurOverLife2D",
               Source = "Value",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 732.667, -0.515148 } },
      },
      pImageEmitter1SizeOverLife = 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 = 0, Green = 0, Blue = 0 },
         NameSet = true,
      },
      pImageEmitter1BlurOverLife2D = 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 = 0, Green = 0, Blue = 0 },
         NameSet = true,
      },
      pTurbulence1 = pTurbulence {
         ID = 29,
         Inputs = {
            XStrength = Input { Value = 0, },
            YStrength = Input { Value = 0, },
            ZStrength = Input { Value = 0.5, },
            StrengthOverLifeLUT = Input {
               SourceOp = "pTurbulence1StrengthOverLifeLUT",
               Source = "Value",
            },
            Input = Input {
               SourceOp = "pImageEmitter1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 842.667, -0.515148 } },
      },
      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,
      },
      FastNoise1 = FastNoise {
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
         },
         ViewInfo = OperatorInfo { Pos = { 506, -9.60607 } },
      },
      pRender1 = pRender {
         Inputs = {
            _MotionBlurWarning = Input { Disabled = true, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            ["MaterialID.MaterialID"] = Input { Value = 1, },
            ["ObjectID.ObjectID"] = Input { Value = 1, },
            Input = Input {
               SourceOp = "pTurbulence1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 962, -5.96969 } },
      }
   }
}

Re: Particle start time

PostPosted: Thu May 23, 2019 5:02 am
by Bryan Ray
If you need the particles to change their color to match the input image, then that probably would need a pCustom solution. I'm sure Okke (https://ablackbirdcalledsue.com/) will be along at some point to demonstrate that. He's a virtuoso with Fusion particles.

Re: Particle start time

PostPosted: Thu May 23, 2019 4:22 pm
by Dennis Summers
Clever solution, I see how you brought up the gain for one frame and then back to 0 for the next. That part I didn't think of. However, and I'm sorry if I didn't make this clear at the beginning, I do indeed need the color information from the bitmap. Basically the whole point of this is to have a color image evaporate into particles and fly away. And in fact I need to do this to many many images over several minutes, with each set of particles intermingling as they start at different times. Obviously, I was hoping for a simple method to start the action (like "number" in pEmitter). But color is critical, so Okke if you're reading this please speak up, a nice setting in pCustom that I can change for each bitmap start time would save me ;)
thanx

Re: Particle start time

PostPosted: Thu May 23, 2019 6:33 pm
by Okke Verbart
Hey Dennis - I'm reading it :-)

Interesting challenge! I actually managed to do it without a pCustom (a shame really, b/c that's my favourite tool!!). I basically took from Bryan's idea, but then essentially set the density to non-zero only when the input picture changes (once per 30 frames).

Would this work?


Code: Select all
{
   Tools = ordered() {
      Text1 = TextPlus {
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Size = Input { Value = 1, },
            Font = Input { Value = "Open Sans", },
            StyledText = Input {
               Value = "2",
               Expression = "Text(floor(time/30))",
            },
            Style = Input { Value = "Bold", },
            ManualFontKerningPlacement = Input {
               Value = StyledText {
                  Array = {
                  },
                  Value = ""
               },
            },
            Red1 = Input {
               Value = 0.5,
               Expression = ":randomseed(floor(time/30)); return random(0.,10)/10;",
            },
            Green1 = Input {
               Value = 0.8,
               Expression = ":randomseed(floor((time+1000)/30)); return random(0.,10)/10;",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 166, 214 } },
      },
      pImageEmitter1 = pImageEmitter {
         ID = 2,
         Inputs = {
            XDensity = Input {
               Value = 0.1,
               Expression = "iif(time%30==0,0.1,0)",
            },
            YDensity = Input {
               Value = 0.1,
               Expression = "XDensity",
            },
            LockParticleColorToInitialFrame = Input { Value = 1, },
            CreateParticlesEveryFrame = Input { Value = 1, },
            Lifespan = Input { Value = 500, },
            Input = Input {
               SourceOp = "Text1",
               Source = "Output",
            },
            ["ParticleStyle.SizeOverLife"] = Input {
               SourceOp = "pImageEmitter1SizeoverLife",
               Source = "Value",
            },
            ["ParticleStyle.BlurOverLife"] = Input {
               SourceOp = "pImageEmitter1BluroverLife2D",
               Source = "Value",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 309, 214 } },
      },
      pImageEmitter1SizeoverLife = 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 = 0, Green = 0, Blue = 0 },
         NameSet = true,
      },
      pImageEmitter1BluroverLife2D = 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 = 0, Green = 0, Blue = 0 },
         NameSet = true,
      },
      pTurbulence1 = pTurbulence {
         ID = 6,
         Inputs = {
            StrengthOverLifeLUT = Input {
               SourceOp = "pTurbulence1StrengthoverLifeLUT",
               Source = "Value",
            },
            Input = Input {
               SourceOp = "pImageEmitter1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 419, 214 } },
      },
      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,
      },
      pRender1 = pRender {
         CtrlWZoom = false,
         Inputs = {
            _MotionBlurWarning = Input { Disabled = true, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            IntegrationMethod = Input { Value = FuID { "RK4" }, },
            ["MaterialID.MaterialID"] = Input { Value = 1, },
            ["ObjectID.ObjectID"] = Input { Value = 1, },
            Input = Input {
               SourceOp = "pTurbulence1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 690, 215 } },
      }
   },
   ActiveTool = "pRender1"
}

Re: Particle start time

PostPosted: Thu May 23, 2019 6:36 pm
by Okke Verbart
And maybe a bit more elegant (with particle life a bit shorter but with the particles fading in and out);

Code: Select all
{
   Tools = ordered() {
      Text1 = TextPlus {
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Size = Input { Value = 1, },
            Font = Input { Value = "Open Sans", },
            StyledText = Input {
               Value = "0",
               Expression = "Text(floor(time/30))",
            },
            Style = Input { Value = "Bold", },
            ManualFontKerningPlacement = Input {
               Value = StyledText {
                  Array = {
                  },
                  Value = ""
               },
            },
            Red1 = Input {
               Value = 0.8,
               Expression = ":randomseed(floor(time/30)); return random(0.,10)/10;",
            },
            Green1 = Input {
               Value = 0.5,
               Expression = ":randomseed(floor((time+1000)/30)); return random(0.,10)/10;",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 166, 214 } },
      },
      pImageEmitter1 = pImageEmitter {
         ID = 2,
         CtrlWZoom = false,
         Inputs = {
            XDensity = Input {
               Value = 0.1,
               Expression = "iif(time%30==0,0.1,0)",
            },
            YDensity = Input {
               Value = 0.1,
               Expression = "XDensity",
            },
            LockParticleColorToInitialFrame = Input { Value = 1, },
            CreateParticlesEveryFrame = Input { Value = 1, },
            Lifespan = Input { Value = 200, },
            Input = Input {
               SourceOp = "Text1",
               Source = "Output",
            },
            ["ParticleStyle.SizeOverLife"] = Input {
               SourceOp = "pImageEmitter1SizeoverLife",
               Source = "Value",
            },
            ["ParticleStyle.FadeControls"] = Input { Value = 1, },
            ["ParticleStyle.FadeIn"] = Input { Value = 0.046, },
            ["ParticleStyle.FadeOut"] = Input { Value = 0.805, },
            ["ParticleStyle.BlurOverLife"] = Input {
               SourceOp = "pImageEmitter1BluroverLife2D",
               Source = "Value",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 309, 214 } },
      },
      pImageEmitter1SizeoverLife = 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,
      },
      pImageEmitter1BluroverLife2D = 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,
      },
      pTurbulence1 = pTurbulence {
         ID = 6,
         Inputs = {
            StrengthOverLifeLUT = Input {
               SourceOp = "pTurbulence1StrengthoverLifeLUT",
               Source = "Value",
            },
            Input = Input {
               SourceOp = "pImageEmitter1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 419, 214 } },
      },
      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,
      },
      pRender1 = pRender {
         Inputs = {
            _MotionBlurWarning = Input { Disabled = true, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            IntegrationMethod = Input { Value = FuID { "RK4" }, },
            ["MaterialID.MaterialID"] = Input { Value = 1, },
            ["ObjectID.ObjectID"] = Input { Value = 1, },
            Input = Input {
               SourceOp = "pTurbulence1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 690, 215 } },
      }
   }
}

Re: Particle start time

PostPosted: Thu May 23, 2019 10:31 pm
by Dennis Summers
Thank-you Okke for your 2 responses. I hate to be unappreciative, but I think that I actually need is something even simpler, but more importantly, unless I'm doing something wrong with your file, I need there to be nothing at all before the first image appears. So let me be a little more clear. It seems that your settings have the # "0" at the first frame, and then the # "1" at frame 30, #2 at frame 60 etc. And I think I get what you did there, but the problem is that I don't want anything at all until say frame 30 ( I assume as a workaround in this case that I could probably animate the font size so that it's zero until I want to see it). And then I only want #1. I would use a second set of tools to start another image at say frame 42, etc with entirely arbitrary different frame starts. Does this make sense?

some minutes later...

So with the help of your settings I figured out what's going on. One can't animate x and y density -and get any effect at all- unless you have "create particles every frame" checked on. And then you have to animate from 0 to say .1 and back to 0 over 3 frames. So in a sense, thanx to you, I have solved my own problem. But since I have your attention... if you're able to write me a little script that does that for any arbitrary frame that I pick it sure would make my life easier :) I frankly don't know anything about scripting. I'm guessing that changing the %30 to something else30 would do the job, but I don't know what that something else should be.

Thanx so much to all of you who responded.

Re: Particle start time

PostPosted: Fri May 24, 2019 6:29 am
by Okke Verbart
HI Dennis - ah, I think I see what you mean. If it's simply not wanting to show anything in the first say 30 frames, you can change the expression in the Xdensity to:

Code: Select all
iif(time > 30,0.1,0)


However, the downside here is that after frame 30 (and with the box "create particles every frame" ticked), it will generate new particles every frame. To avoid that you can simply use:

Code: Select all
iif(time == 30,0.1,0)


In this case it will have a density of 0 for all frames apart from frame 30. This means, it will generate particles for the input ONLY at frame 30.

As you will use different tools for everything after that, the above is then sufficient?

Just for future reference, if you want to have particles generated at irregular intervals you can either key frame the density (ensuring you use step-in, step-out in the spline editor to have "hard" jumps from 0 to non-zero) or you could use a somewhat more elaborate expression (will get back to you on that).

Re: Particle start time

PostPosted: Fri May 24, 2019 9:26 pm
by Dennis Summers
Aah :D :D :D Yes that second expression is precisely what I need. So simple, yet to someone like me so distant. Now that I see it, I understand it. This will save me boatloads of time. I really ought to try to spend a little time learning about expressions in Fusion, but it's not something that comes naturally to me. thanx so much.

Re: Particle start time

PostPosted: Sat May 25, 2019 4:27 pm
by Bryan Ray
I don't think it comes naturally to anyone. It takes practice and experimentation, and sometimes a little reading and question-asking. As you do it more and more, you'll start to internalize the concepts, and you'll gradually build a repertoire of more advanced techniques.

Definitely keep asking questions and sharing your work, whether it's working great or not! I was always hesitant to put my scripts out where people could see them, but when I finally started working on one publicly at We Suck Less, I got some terrific guidance (thanks again Andrew, Greg, and Cedric!). My technique and capabilities improved dramatically. It's hard to believe how far I've come in the last year!

Re: Particle start time

PostPosted: Tue Sep 10, 2019 6:31 pm
by Nick Papps
Is there a way to have the particles already existing on frame 1? My particles appear after a few moments. Is there a way to move the start time back?

Re: Particle start time

PostPosted: Tue Sep 10, 2019 6:34 pm
by Sander de Regt
Use pre-roll. I think it's in the pRender somewhere.

Re: Particle start time

PostPosted: Wed Sep 20, 2023 12:55 pm
by creativigh@gmail.com
Go to Prender node and input the frame you want it to start from in "Pre-Generate Frames".