Jump to content
Sign in to follow this  
magneto

Are there interpolation functions to be used in expressions in Houdini

Recommended Posts

I am looking for a way to get different interpolation so from 0 to 1, instead of values increasing linearly with time, I want to get interpolated values such as this one:

CURVE_CIRCULAR_IN.PNG

Basically any value from 0 to 1 like:

easein(0.2) * value

Share this post


Link to post
Share on other sites

Thanks, no I am asking about a possible function to use inside an expression, so I can get a interpolation like the above image.

I will provide values between 0 and 1 to this function, and use the result as a multiplier.

Share this post


Link to post
Share on other sites

Thanks, no I am asking about a possible function to use inside an expression, so I can get a interpolation like the above image.

I will provide values between 0 and 1 to this function, and use the result as a multiplier.

The good old gamma is easy, newvalue = oldvalue ^ (1/gamma)

So, just raise your value to some power until it feels right ;)

  • Like 1

Share this post


Link to post
Share on other sites

+1 eetu

You may try out :

pow(fit($F,$FSTART,$FEND,0,1),log(0.3)/log(0.6))

I am not sure if the channel segment functions like easein easeout, etc. are available outside but you could always create an attribute with the desired interpolation between a time step and access it wherever you want.

also there is smooth() function take a look at that too.

smooth(fit($F,1,100,0,1),0,1)

Edited by vectorblur

Share this post


Link to post
Share on other sites

check out this thread about channel variables

here is the correct link that is broken in the thread...

http://www.sidefx.com/docs/houdini11.1/expressions/_globals

Not sure if that helps...but interesting....

It seems you are wanting a look-up value, I often create a spare channel and lay down 2 keys 1 @ 0 and 1 @ 100, then get the curve to look just like I want. then use a chf() expression where frame is input value * 100

chf(curve_channel,value*100)

woops, double post...

Edited by 3dbeing

Share this post


Link to post
Share on other sites

Thanks guys, I will have to check your examples, but I found what I needed.

Basically however a value is increasing, I want to multiply it with a certain interpolation curve based on normalized time.

So I will try creating my own expression functions and use them like:

backEase:

f(t) = t³ – t * a * sin(t * π)

backEase($LIFE)

But of course having a set of functions that can be used like this would be super useful, but also clearer as you don't have to untangle these formulas each time you see them in numeric fields.

Share this post


Link to post
Share on other sites

Thanks 3dbeing, I read that one, that's why I am quite happy that Houdini allows custom expressions. I will use hscript for shortness sake though.

One thing I was wondering which doesn't seem possible is, can I have my custom expressions always loaded by Houdini? I think I would want them readily available in every session just like my custom OPs.

Share this post


Link to post
Share on other sites

One thing I was wondering which doesn't seem possible is, can I have my custom expressions always loaded by Houdini? I think I would want them readily available in every session just like my custom OPs.

look at the exread expression and put it in your 123 file, if it's .py then use the hou.hscript() as I don't think there is python equivalent...

I haven't used it so i'm not 100% sure how it works...

Share this post


Link to post
Share on other sites

look at the exread expression and put it in your 123 file, if it's .py then use the hou.hscript() as I don't think there is python equivalent...

I haven't used it so i'm not 100% sure how it works...

Man that's awesome. Will try it after I write some expression functions.

Thanks.

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  

×