magneto Posted December 27, 2011 Share Posted December 27, 2011 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: Basically any value from 0 to 1 like: easein(0.2) * value Quote Link to comment Share on other sites More sharing options...
gaurav Posted December 27, 2011 Share Posted December 27, 2011 Located in channel editor, screen right bottom. Is this what you are asking ? Quote Link to comment Share on other sites More sharing options...
magneto Posted December 27, 2011 Author Share Posted December 27, 2011 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. Quote Link to comment Share on other sites More sharing options...
eetu Posted December 27, 2011 Share Posted December 27, 2011 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 1 Quote Link to comment Share on other sites More sharing options...
gaurav Posted December 27, 2011 Share Posted December 27, 2011 (edited) +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 December 27, 2011 by vectorblur Quote Link to comment Share on other sites More sharing options...
3dbeing Posted December 27, 2011 Share Posted December 27, 2011 (edited) 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 December 27, 2011 by 3dbeing Quote Link to comment Share on other sites More sharing options...
gaurav Posted December 27, 2011 Share Posted December 27, 2011 For fun x= fit($F,1,100,0,1) y = 1-sqrt(1-pow(x,2)) interpolation.hipnc Quote Link to comment Share on other sites More sharing options...
magneto Posted December 28, 2011 Author Share Posted December 28, 2011 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. Quote Link to comment Share on other sites More sharing options...
3dbeing Posted December 28, 2011 Share Posted December 28, 2011 (edited) You can create your own expression functions in the alias and variables window another option is writing it in python and using the hou.session module, or creating your own module. Edited December 28, 2011 by 3dbeing Quote Link to comment Share on other sites More sharing options...
magneto Posted December 28, 2011 Author Share Posted December 28, 2011 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. Quote Link to comment Share on other sites More sharing options...
3dbeing Posted December 28, 2011 Share Posted December 28, 2011 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... Quote Link to comment Share on other sites More sharing options...
magneto Posted December 28, 2011 Author Share Posted December 28, 2011 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. 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.