bratro Posted June 13, 2018 Share Posted June 13, 2018 Hi there! I'm trying to add a certain shape to an object. (see image which hopefully explains it better ;-) the effect I'm trying to achieve is that the polywire should be bigger to the point and smaller/thinner in between. I did try it with a ramp but it obviously doesn't work. I'm still new to houdini and any help is very much appreciated! Thanks ;-) curve on object.hipnc Quote Link to comment Share on other sites More sharing options...
Atom Posted June 13, 2018 Share Posted June 13, 2018 Here is a possible setup. ap_curve on object.hipnc 1 Quote Link to comment Share on other sites More sharing options...
kiryha Posted June 13, 2018 Share Posted June 13, 2018 (edited) Trying to substitute Foor Loop with a primitive wrangle in @Atom setup. It works only for the first primitive. I thought wrangle is a loop, e.g. the code inside VEX expression window should be executed for each primitive (at the same time, in parallel) but probably I miss something. There should be printf() instead of sprintf() ap_curve on object.hipnc Edited June 13, 2018 by kiryha Quote Link to comment Share on other sites More sharing options...
Noobini Posted June 13, 2018 Share Posted June 13, 2018 just a handful of nodes with MOPs...(5 nodes...that's one hand) PolywireWidth.hipnc 1 1 Quote Link to comment Share on other sites More sharing options...
ThomasPara Posted June 14, 2018 Share Posted June 14, 2018 You have to setup your foreach to also ouput index. "currentPoint" will give you the pointnumber globaly. What your interested in is the index of the number in your current primitive. foreach(int index;int currentPoint;primpts){ float ramp = fit(index,0,len(primpts)-1,0,1); } 1 Quote Link to comment Share on other sites More sharing options...
kiryha Posted June 14, 2018 Share Posted June 14, 2018 (edited) Yes, that's works! Thanks, Thomas! i[]@primPts = primpoints(0, @primnum); foreach (int i; int currentPoint; @primPts){ float ramp_index = fit(i, 0, len(@primPts)-1, 0,1); f@widthPrim = chramp("shape", ramp_index)/20; setpointattrib(0, "width", currentPoint, @widthPrim, "set"); } scalePolywire_loop.hipnc Edited June 14, 2018 by kiryha 1 Quote Link to comment Share on other sites More sharing options...
ThomasPara Posted June 14, 2018 Share Posted June 14, 2018 Np, remember that "primPts" is an array, and since it starts at 0 you need to fit your range to the length of the array subtracted by one. 1 Quote Link to comment Share on other sites More sharing options...
kiryha Posted June 14, 2018 Share Posted June 14, 2018 Correct, my bad. I still examining how you rebuild my setup to move objects along the curve, as I understood, the high-level idea is to use primitive wrangle instead of Foor Loop. That gives me a hint that it could be applied in this case as well, cos wrangle muuuuuuch more fast than Foor Loop. Quote Link to comment Share on other sites More sharing options...
ThomasPara Posted June 14, 2018 Share Posted June 14, 2018 Vex is usualy faster, and i try as far as i can to avoid Foor-loops. When i get time, i can take a look at that file again. Quote Link to comment Share on other sites More sharing options...
kiryha Posted June 14, 2018 Share Posted June 14, 2018 Thanks, Thomas! The file is working fine, I just wish to clearly understand how it's working in-depth and replicate it by myself. I examine the point animation along curve part (skipping orientations) and have some questions and probably I will have even more questions later, so yes, when you will have time you can check that topic. Quote Link to comment Share on other sites More sharing options...
bratro Posted June 14, 2018 Author Share Posted June 14, 2018 On 13.6.2018 at 2:42 PM, Atom said: Here is a possible setup. ap_curve on object.hipnc wow cool! this is already an amazing setup! thanks so much Quote Link to comment Share on other sites More sharing options...
bratro Posted June 14, 2018 Author Share Posted June 14, 2018 17 hours ago, Noobini said: just a handful of nodes with MOPs...(5 nodes...that's one hand) PolywireWidth.hipnc thanks! that looks very interesting, although it's not working when I open the file ;-( Quote Link to comment Share on other sites More sharing options...
toadstorm Posted June 14, 2018 Share Posted June 14, 2018 MOPs is a custom toolkit, it doesn't ship with Houdini. You can download it here: http://www.motionoperators.com 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.