rich_lord Posted April 24, 2016 Share Posted April 24, 2016 Hello. Is there a way to do an unclamped fit range in vex? Theres a VOP for this but no vex command.... Quote Link to comment Share on other sites More sharing options...
mestela Posted April 24, 2016 Share Posted April 24, 2016 (edited) If you r.click on your vopnet with the unclamped fit and choose 'vex/vop options->view vex code', you can see that the vex equivalent is efit(). If you try this in a wrangle, it comes back as undefined. Hmm. Reason for this is that its not part of the standard vex calls, but in an extra library. Looking near the top of the generated vex code from the vopnet, can see that it includes 3 files: #include <voptype.h> #include <voplib.h> #include <pyro_math.h> Pasting those into a wrangle will make the efit function work again. May as well take this journey to its logical conclusion though! I commented out each line in turn until the function stopped working, that let me know that efit() is defined in pyro_math.h. (So if you wanted you could reduce the above includes to only that line.) Getting into the houdini installation folder and searching for that file, I found it in $HFS/houdini/vex/include/ . Opening it in a text editor and searching for efit, can find exactly how its defined: float efit(float val, s0,s1, t0,t1) { return (val-s0)*(t1-t0)/(s1-s0) + t0; } (as well as equivalents for other data types) So if you wanted to define it yourself, that's how. The include is easier. -matt Edited April 24, 2016 by mestela 4 Quote Link to comment Share on other sites More sharing options...
rich_lord Posted April 25, 2016 Author Share Posted April 25, 2016 Amazing - its awesome to learn whats going on in more depth. Thanks for the detailed answer! 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.