musickent Posted April 27, 2003 Share Posted April 27, 2003 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. Quote Link to comment Share on other sites More sharing options...
musickent Posted April 27, 2003 Author Share Posted April 27, 2003 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. Quote Link to comment Share on other sites More sharing options...
FrankFirsching Posted April 27, 2003 Share Posted April 27, 2003 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. Quote Link to comment Share on other sites More sharing options...
musickent Posted April 28, 2003 Author Share Posted April 28, 2003 thank you so much!! Quote Link to comment Share on other sites More sharing options...
edward Posted April 28, 2003 Share Posted April 28, 2003 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) Quote Link to comment Share on other sites More sharing options...
betty Posted April 28, 2003 Share Posted April 28, 2003 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. Quote Link to comment Share on other sites More sharing options...
musickent Posted April 28, 2003 Author Share Posted April 28, 2003 wow...only "cycle(1,20)"!! what a big improvement for houdini 6 thanks guys Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.