Jump to content

Are there interpolation functions to be used in expressions in Houdini


magneto

Recommended Posts

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
Link to comment
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
Link to comment
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
Link to comment
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.

Link to comment
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.

Link to comment
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...

Link to comment
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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...