How to trigger and re-trigger image sequences?

Moderator: SecondMan

caspardavidfriedrich
Posts: 43
Joined: Thu Dec 01, 2016 3:19 am
Location: Bracknell, UK

How to trigger and re-trigger image sequences?

#1

Post by caspardavidfriedrich » Sat Aug 04, 2018 3:54 am

Hi Y'all,
I'm trying to comp a pseudo computer game. Let's say I have a 10-frame cartoon explosion animation which I want to trigger at many different keyframes throughout "the game" - without having a bunch of Loader nodes with different Global In settings.
My first thought was to add a simple TimeSpeed node and animate the Delay time using Step In keyframes.
That sort of works in the RAM preview but the render aborts.
Then I thought of trying SecondMan's mighty TimeMachine modifier... or shall I say: the mighty SecondMan's TimeMachine modifier.
Basically I've taken a TimeSpeed node and modified the Delay time with TimeMachine. It has a Trigger mode which sounds perfect, but I just can't get it to work.
I've also tried it using a TimeStretcher node and modifying it with TimeMachine... it's also a no-go for me.
What am I doing wrong? Any bright suggestions?
Many thanks,
Caspar.

User avatar
SecondMan
Site Admin
Posts: 2707
Joined: Thu Jul 31, 2014 5:31 pm
Location: Vancouver, Canada
Been thanked: 104 times
Contact:

Re: How to trigger and re-trigger image sequences?

#2

Post by SecondMan » Sat Aug 04, 2018 7:04 am

Hi Caspar,


For controlling a trigger with manual keyframes I would indeed use a Time Machine modifier, but use the Switch mode.

What Switch does is you can define a list of different starting points in a sequence (in your case your cartoon explosion) and then when you set a keyframe to the number in that list, it will start playing that sequence from that starting point forward.

So first of all make sure that your explosion sequence extends beyond the 10 frames into black/zero.

Add a TimeStretcher with a Time Machine modifier. Set to Switch.

Make two Switch Start Frames: anything over 10, and 0. The first one will start playing from a point after your explosion (so output black) and the second starts at 0 (and plays your 10 frame explosion.

Then set keyframes of 2 wherever you would like an explosion:

Code: [Select all] [Expand/Collapse] [Download] (WSLsnippet-2018-08-04--07.04.15.setting)
  1. {
  2.     Tools = ordered() {
  3.         Ellipse1 = EllipseMask {
  4.             ViewInfo = OperatorInfo { Pos = { 550, 82.5 } },
  5.             Inputs = {
  6.                 ClippingMode = Input { Value = FuID { "None" } },
  7.                 MaskHeight = Input { Value = 1080 },
  8.                 MaskWidth = Input { Value = 1920 },
  9.                 Width = Input { Value = 0.250464022175227 },
  10.                 Height = Input { Value = 0.250464022175227 },
  11.                 PixelAspect = Input { Value = { 1, 1 } }
  12.             }
  13.         },
  14.         Background1 = Background {
  15.             ViewInfo = OperatorInfo { Pos = { 550, 115.5 } },
  16.             Inputs = {
  17.                 TopLeftRed = Input {
  18.                     Source = "Value",
  19.                     SourceOp = "Background1TopLeftRed"
  20.                 },
  21.                 TopLeftBlue = Input {
  22.                     Source = "Value",
  23.                     SourceOp = "Background1TopLeftBlue"
  24.                 },
  25.                 ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" } },
  26.                 EffectMask = Input {
  27.                     Source = "Mask",
  28.                     SourceOp = "Ellipse1"
  29.                 },
  30.                 TopLeftGreen = Input {
  31.                     Source = "Value",
  32.                     SourceOp = "Background1TopLeftGreen"
  33.                 },
  34.                 TopLeftAlpha = Input {
  35.                     Source = "Value",
  36.                     SourceOp = "Background1TopLeftAlpha"
  37.                 },
  38.                 Height = Input { Value = 1080 },
  39.                 Width = Input { Value = 1920 }
  40.             }
  41.         },
  42.         Background1TopLeftRed = BezierSpline {
  43.             SplineColor = { Red = 255, Green = 0, Blue = 0 },
  44.             NameSet = true,
  45.             KeyFrames = {
  46.                 [0] = { 0.647, RH = { 3.33333333333333, 0.431333333333333 }, Flags = { Linear = true } },
  47.                 [10] = { 0, Flags = { Linear = true }, LH = { 6.66666666666667, 0.215666666666667 } }
  48.             }
  49.         },
  50.         Background1TopLeftGreen = BezierSpline {
  51.             SplineColor = { Red = 0, Green = 255, Blue = 0 },
  52.             NameSet = true,
  53.             KeyFrames = {
  54.                 [0] = { 0.169190423751954, RH = { 3.33333333333333, 0.112793615834636 }, Flags = { Linear = true } },
  55.                 [10] = { 0, Flags = { Linear = true }, LH = { 6.66666666666667, 0.0563968079173182 } }
  56.             }
  57.         },
  58.         Background1TopLeftBlue = BezierSpline {
  59.             SplineColor = { Red = 0, Green = 0, Blue = 255 },
  60.             NameSet = true,
  61.             KeyFrames = {
  62.                 [0] = { 0, Flags = { Linear = true } }
  63.             }
  64.         },
  65.         Background1TopLeftAlpha = BezierSpline {
  66.             SplineColor = { Red = 180, Green = 180, Blue = 180 },
  67.             NameSet = true,
  68.             KeyFrames = {
  69.                 [0] = { 1, RH = { 3.33333333333333, 0.666666666666667 }, Flags = { Linear = true } },
  70.                 [10] = { 0, Flags = { Linear = true }, LH = { 6.66666666666667, 0.333333333333333 } }
  71.             }
  72.         },
  73.         TimeStretcher1 = TimeStretcher {
  74.             NameSet = true,
  75.             CtrlWZoom = false,
  76.             ViewInfo = OperatorInfo { Pos = { 715, 115.5 } },
  77.             Inputs = {
  78.                 SourceTime = Input {
  79.                     Source = "Output",
  80.                     SourceOp = "TimeMachine1"
  81.                 },
  82.                 Input = Input {
  83.                     Source = "Output",
  84.                     SourceOp = "Background1"
  85.                 }
  86.             }
  87.         },
  88.         TimeMachine1 = Fuse.TimeMachine {
  89.             NameSet = true,
  90.             CtrlWZoom = false,
  91.             Version = 200,
  92.             Inputs = {
  93.                 Switch = Input {
  94.                     Source = "Value",
  95.                     SourceOp = "TimeMachine1_1_1Switch"
  96.                 },
  97.                 Skip = Input { Value = 1 },
  98.                 Mode = Input { Value = FuID { "Switch" } },
  99.                 SwitchStartFrames = Input { Value = "50\n0\n" },
  100.                 XFrameNumbers = Input { Disabled = true }
  101.             }
  102.         },
  103.         TimeMachine1_1_1Switch = BezierSpline {
  104.             SplineColor = { Red = 242, Green = 111, Blue = 29 },
  105.             NameSet = true,
  106.             KeyFrames = {
  107.                 [0] = { 1, RH = { 10.3333333333333, 1.33333333333333 }, Flags = { Linear = true } },
  108.                 [31] = { 2, RH = { 45, 2 }, Flags = { Linear = true }, LH = { 20.6666666666667, 1.66666666666667 } },
  109.                 [73] = { 2, RH = { 78.3333333333333, 2 }, Flags = { Linear = true }, LH = { 59, 2 } },
  110.                 [89] = { 2, RH = { 101.54, 2 }, Flags = { Linear = true }, LH = { 83.6666666666667, 2 } },
  111.                 [127] = { 2, Flags = { Linear = true }, LH = { 114.46, 2 } }
  112.             }
  113.         }
  114.     }
  115. }

(I actually saw a few small functionality issues while building this that I will likely adjust in a next version of Time Machine - so thanks for the question ;))

caspardavidfriedrich
Posts: 43
Joined: Thu Dec 01, 2016 3:19 am
Location: Bracknell, UK

Re: How to trigger and re-trigger image sequences?

#3

Post by caspardavidfriedrich » Sat Aug 04, 2018 9:57 am

Hi Pieter,
Wow, I'm speechless, this solution is so super useful - more than I had in mind!
In the context of the pseudo game I'm comping, it basically allows me to have all my sequences of sprites in one big sequence and cut between them when required.
The more I use TimeMachine the more I realise its beauty - although I sometimes yearn for an instruction manual for it ;0)
But as long as you have the time to respond so quickly and informatively - great!
Thanks so much for your time and help,
Konrad

PS: I've tried this out and it works brilliantly, but I noticed something which might catch others trying it out. If you are applying this to an image sequence, It is very important that you "anchor" the sequence on top of a BackGround node. Otherwise you will get an error message and rendering will fail. I guess it's good practice to do in any case. Please see the two attached screen grabs.
Screen-Shot-2018-08-04-at-18.35.59.jpg
Screen-Shot-2018-08-04-at-18.36.28.jpg
You do not have the required permissions to view the files attached to this post.

User avatar
SecondMan
Site Admin
Posts: 2707
Joined: Thu Jul 31, 2014 5:31 pm
Location: Vancouver, Canada
Been thanked: 104 times
Contact:

Re: How to trigger and re-trigger image sequences?

#4

Post by SecondMan » Sun Aug 05, 2018 12:01 am

Glad it worked!

caspardavidfriedrich wrote:
Sat Aug 04, 2018 9:57 am
If you are applying this to an image sequence, It is very important that you "anchor" the sequence on top of a BackGround node. Otherwise you will get an error message and rendering will fail.

Yes, that's probably because your image sequence doesn't extend to the frames that Time Machine is requesting:

SecondMan wrote:
Sat Aug 04, 2018 7:04 am
So first of all make sure that your explosion sequence extends beyond the 10 frames into black/zero.

You can fix that by merging it on a background like you've done, as the background's global range extends much further no doubt. Alternatively, you can extend the Loader's range directly by holding the last frame:


Image

caspardavidfriedrich wrote:
Sat Aug 04, 2018 9:57 am
The more I use TimeMachine the more I realise its beauty - although I sometimes yearn for an instruction manual for it ;0)

Thanks very much - yes, a fair point, and that's coming. Some day. If only I had Time Machine for my life, too... ;)

In the meantime, I think you're going to like this.

caspardavidfriedrich
Posts: 43
Joined: Thu Dec 01, 2016 3:19 am
Location: Bracknell, UK

Re: How to trigger and re-trigger image sequences?

#5

Post by caspardavidfriedrich » Sun Aug 05, 2018 7:52 am

SecondMan wrote:
Sun Aug 05, 2018 12:01 am
In the meantime, I think you're going to like this.
Woah! Very exciting stuff. I've just installed it and am giving it a spin. :)