$CR expression in a polyextrude node

   9694   3   1
User Avatar
Member
1 posts
Joined: Feb. 2016
Offline
Hey guys,

I'm new to houdini so please excuse me if the answer to my question is blatantly obvious.

I was watching a tutorial that puts the $CR expression in the translate of a polyextrude node. The issue I'm having is that it doesnt seem to work in the latest version of houdini (the tutorial is using an older version)

Any thoughts on how to get this to work in H15?

Cheers

-W-
User Avatar
Staff
4259 posts
Joined: Sept. 2007
Offline
Here's an example hip file. You have to go under the Local Control tab, turn on the Distance Scale, and give it an attribute to multiply the distance parameter against.

Rohan also has a nice video on this: https://vimeo.com/149640497 [vimeo.com]

Attachments:
polyextrude_by_attribute.hipnc (96.8 KB)
screenshot-area-2016-02-03-193021.png (24.5 KB)

I'm o.d.d.
User Avatar
Member
1 posts
Joined: July 2016
Offline
hi there!
ran into this same problem
super new to Houdini…
How would you write an expression to tie the color to the distance scale?
I tried typing in $CR into the “distance scale” box

thanks!
User Avatar
Staff
4259 posts
Joined: Sept. 2007
Offline
No prob, it can get confusing! $CR is a variable which points to the red component of the attribute Cd. Variables referring to attributes are slowly being replaced in Houdini, but you'll still see them in older tutorials for a while.

If you put Cd into the Distance Scale attribute, it'll take the magnitude of that vector. If you want just the red component to be used, put that in a float attribute; an easy way is to put a Primitive Wrangle down before the PolyExtrude, with this snippet:

@myfoo = @Cd.r;



It'd be nice if we could specify a component without having to stash it into a float attribute upstream (submitted RFE #76547).
I'm o.d.d.
  • Quick Links