Hey there,
I know it has been a while, but I stumpled across the project again, where I needed this nested iff statements. I tried to make the nested iff statements work in a more, lets say, complex scenario. And I failed
It does not work and I don't know any other way to kindly ask for the community's help again.
So I carefully tried to refer to Bryans generalized nested iff statement:
Bryan Ray wrote:iif(time >= Halt, iif(time >= Resume, time - (Resume - Halt - 1), Halt), time)
And based on that I made the following:
iif(time>=floor(hold.NumberIn4/2),iff(time>=comp.RenderEnd-floor(hold.NumberIn4/2),time-comp.RenderEnd-floor(hold.NumberIn4/2)-1),floor(hold.NumberIn4/2),time)
As I mentioned it is a bit more complex, but not that bad after a few hints. Let me explain:
hold.NumberIn4 is a static positive number which is generated at the beginning of the animation by the parameters the user chooses. For simplicity we can say the Number is 10. It is held by a CustomTool called hold and sits in place NumberIn4.
That means: Halt = floor(hold.NumberIn4/2) in my statement.
As you can see, I tried to make the animation responsive to the comp length with
comp.RenderEnd.
Resume = comp.RenderEnd-floor(hold.NumberIn4/2) in my statement.
My plan was that the animation runs until Halt is reached (e.g. at frame 10) and picks up again (with number 11) 10 frames before the end of the comp is reached. But unfortunatelly the expression does not work. I have tried to find some workarounds our mistakes in the expression for weeks now in my sparetime. Maybe just the strucure is faulty or the iff statement doesn't work with connections to a CustomTool, I don't know. Please, could anyone have a smart eye on my statement? Would be so helpful. And I would be so thankful!
Thank You
Klaus