top of page

Houdini image sequence loop, offset and hold

Well I thought such task is as easy as dialing a parameter in the texture or file merge node but no this is Houdini and nothing should be easy and straightforward you should suffer lol.


So the task has to do with fill string it self, we need to do some simple coding.

I will divide them into three chapters, and will suppose that:

- Our file has the following path: $HIP/maps/my_map.$F4.exr

- We are working with four digits numbering.

- Last frame is 250.

The part that we are going to change is $F4 so keep the dots before and after:


1- Looping:

- if your numbering starts from 0: my_map.0000 > my_map.0250 then replace the $F4 with `padzero(4,$F%251)` this 4 in the brakets are the digits number, so the full path will be: $HIP/maps/my_map.`padzero(4,$F%251)`.exr

and here is a common mistake I found over the forums that they put $F%250 but this will loop from 0 to 249 since when you reach frame 250 250%250 = 0 so you should add 1.


- if your numbering starts from 1: my_map.0001 > my_map.0250 then replace the $F4 with `padzero(4,($F-1)%250+1)` so the full path will be:

$HIP/maps/my_map.`padzero(4,($F-1)%250+1)`.exr

Here the story a bit different, since we dont want the result ever to equal 0 we had to add 1 but adding it will shift the numbering so on frame 1 it will load texture 0002 and it will loop perfectly but if this is a problem for you and you wanna match the frame number then you subtract 1 from the frame.


2- Offsetting:

This one is easy just replace $F4 with `padzero(4,$F - offset amount)` so the full path will be for example:

$HIP/maps/my_map.`padzero(4,$F +10)`.exr


3- Holding:

We have three scenarios here:


- Hold last frame and we will use the (min) function for that:

$HIP/maps/my_map.`padzero(4, min($F , 250))`.exr


- Hold first frame and we will use the (max) function for that:

$HIP/maps/my_map.`padzero(4, max($F , 1))`.exr


- Hold first and last frame and we will use the (clamp) function for that:

$HIP/maps/my_map.`padzero(4, clamp($F,1,250))`.exr




And finally to spice things up you can offset while holding and looping, did you faint yet 😵.

To do this just add or subtract directly from the $F 😉



11,285 views1 comment

Recent Posts

See All

1 Comment


Manish Anand
Manish Anand
Sep 05

do you have any means to time offset the texture. Like slow it down by half?

Like
bottom of page