Jump to content

Use attribute to control parameter? Change thickness of sweep afterwards with attribute?


Recommended Posts

Hi!

 

I have a little experience with attributes and VEX now. :) I've used the color of some object to transfer color to an other object or to change pscale of other points.

But now i've come across a difficult problem, and i was wondering if there is some mysterious new thing in Houdini i don't yet yet that could help me with this.

I have animated 4 boxes and i have connected these boxes with a dashed line. The thickness of the lines is controlled by a circle which is the input of 6 sweeps. Since i want to separate the controls for the 2 middle lines (in the grey red boxes) and the 4 outside lines (in the grey network boxes), i've created two transform nodes.

While i was on the result below, i realised i wanted the thickness of the lines to be controlled by a gradient, like i've done before with color and pscale (attributetransfer), instead of with keyframing.

5c92510c45fd8_Screenshot2019-03-20at15_36_44.png.b66d2b9bf616036f90b93508e5c3ab31.png(this screenshot has copied timeshifts)

But this is a hard problem because the thickness is controlled so early in the network. 

So i wonder if there is a way i could do this? If there exists some way i could control the thickness of the line after the sweep with the gradient/color attribute i've created in the node called 'gradient'?

AttributeToParameter__.hipnc          (mentioned nodes colored red)

 

Would really appreciate your help. :) 

 

Edited by that Abstract guy
Link to comment
Share on other sites

(Sorry there was a bug in Odforce there: couldn't edit or type in that comment, had to sent) 

Anyways.. :) 

I mean something like this:

5c9639f52d73e_Screenshot2019-03-23at14_51_40.png.c1144922a8236d0607df95b1f6c60e67.png

So not only over that whole line, but really from an outside source.

But i didn't know about the width attribute yet.. How would you do that? 

 

 

 

5c96395cae494_Screenshot2019-03-23at14_48_38.thumb.png.7af98c66060ac3091716064bf5f3100d.png

Edited by that Abstract guy
Link to comment
Share on other sites

it depends how exactly you have your network wired but this is how I would do it:
 

float baseWidth = detail('../../path_to_external_node', 'existingWidthAttribute', 0);

float widthRamp = @ptnum/@numpt;

@width = baseWidth * widthRamp;

this will read a value from an external node (it doesn't necessarily have to be a detail attrib) and multiplies it with locally generated ramp. the resulting @width I'd use as a source for polywire SOP, or sweep SOP

Edited by davpe
  • Like 1
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...