Jump to content
Sign in to follow this  
bratro

Polywire shape adjustments

Recommended Posts

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.png

curve on object.hipnc

Share this post


Link to post
Share on other sites

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()

polywireRamp.thumb.jpg.81c7467638b5a478bd3ae589e06616a0.jpg

ap_curve on object.hipnc

Edited by kiryha

Share this post


Link to post
Share on other sites

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);
	}

 

 

 

  • Like 1

Share this post


Link to post
Share on other sites

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"); 
    }

scalPolywireLoop.thumb.PNG.9e981f659c9999b07bb7cecf0f9ad608.PNG

scalePolywire_loop.hipnc

Edited by kiryha

Share this post


Link to post
Share on other sites

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.

  • Like 1

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
17 hours ago, Noobini said:

just a handful of nodes with MOPs...(5 nodes...that's one hand)

PolywireWidth.jpg

PolywireWidth.hipnc

thanks! that looks very interesting, although it's not working when I open the file ;-( 

Bildschirmfoto 2018-06-14 um 18.58.35.png

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  

×