Jump to content

Sum of attributre over ten frames?

Recommended Posts

Hey all, I am quite new to Houdini and am wrestling with an issue.

I have used table import to add a list of values to a set of primitive's attributes. The attributes of the primitives is then set to change to the next columns value in the list every ten frames. I then poly extrude by this value. Therefor each primitive extrudes by the value it has been individually given which changes every ten frames.

This however means that the animation is not smooth and jumps every ten frames. The best way I thought to smooth this was to find the sum of the current frame and following 9 frames and then dividing this value by ten. Therefore finding the average value over the ten frames and smoothing the transition between values.

Is it possible to write such an expression? If so how would it look?


Share this post

Link to post
Share on other sites

Hi Alex, VEX already supplies a function called spline() for smoothly interpolating values.

f[]@heights = detail(1, "heights", 0);
int l = len(@heights);

// ADD FIRST AND LAST ELEMENTS to be ignored by spline-function
insert(@heights, 0, 0.0);
append(@heights, 0.0);

int change = chi('change_rate');
float t = (@Frame - 1) / float(change) / l;
f@height = spline("cspline", t, @heights);

@P.y *= @height;
@Cd = set(@height,0,1);


Edited by konstantin magnus
  • Like 1

Share this post

Link to post
Share on other sites

Hey Konstantin,

Thanks a lot for your rapid response, really appreciate it and sorry for taken ages to respond myself.

Thought I'd give you an update. I tried to work with your advice, but because my ability with VEX is still quite week, I've ended up instead using a chop network to create a smooth extrusion for the values. I've attached my files beneath, including the CSV my file is reading the data from, a digital asset which helps me filter through the columns of the CSV.





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