Jump to content
Sign in to follow this  
musickent

how to repeat section with offset

Recommended Posts

i want to repeat two segments of the channle curve but with an offest. let say, a obect moves in tx 0.5 in frame 10, moves in tx 0.8 in frame 20. after i create these 3 keyframe, i want the object continue this movement in tx. ( that is move 0.5 in frame 30, 0.8 in frame 40...so on)

here is what i want to achieve.

post-18-1051420836.jpg

Share this post


Link to post
Share on other sites

and the result shoud look like that(i paint it out only :) )

is it possible to do it ? i tried the repeat(0,20), but could not get the offset!!

plz help.

thanks in advance.

post-18-1051420974.jpg

Share this post


Link to post
Share on other sites

To shift the repeated parts vertically to match the previous cycle, you can use the following expression:

repeat(1,20)+(chf("./tx",19)-chf("./tx",1))*floor(($F-1)/19)

First I repeated only frames 1-20, since frame 0 is normally for special setups, like bind-pose. Then there is this complicated looking part after the repeat-statement. The two chf()-functions calculate the offset, by which the copies must be shifted to match the previous one. If you want some other channels repeated with offset, you will have to adjust the channel-name "tx". Also note, what the frame of the first chf-function is 19 (= 20-1), since the value at frame 20 will already be determined by the custom-expression. the floor(...)-statement will count the cycles. A general formulation of the expression would be:

repeat(SF,EF)+(chf("./CN",EF-1)-chf("./CN",SF))*floor(($F-SF)/(EF-SF))
SF:   start-frame
EF:   end-frame
CN:  channel-name

Sometimes Houdini messes up the display, if you move the end end-key of the repeated range. Then you will see some strange peaks, due to some round-off errors in the evaluation of the expression. If you close the channel-editor and reopen it, Houdini will place new sample-positions and everything is fine again.

Share this post


Link to post
Share on other sites

A small generalization to Frank's expression is to replace "./tx" to "./$CH" since $CH will evaluate to the current channel name.

In Houdini 6, the expression reduces to:

cycle(1,20)

Share this post


Link to post
Share on other sites

how 'bout the cycleCHOP, you can cycle and offset among other things...?, but after looking at the expression edward posted i must say, that's pretty efficient.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×