Jump to content
PhiiLL

difference between @Cd.r and $CR

Recommended Posts

Hey guys,

what is the difference between @Cd.r and $CR, and when do I use which?
There is nothing in the docs about it :/

Thanks :)

Share this post


Link to post
Share on other sites

Dollar variables are hscript expression variables, hscript is sloooowly being phased out.

At-symbols are vex attributes (@-ttributes, get it?), they're becoming the standard way to refer to geometry properties through most of houdini, its better to get used to that syntax.

Occasionally you'll find some older nodes that only work with the older dollar syntax, best to ask here if you stumble across those. :)

 

-matt

 

Share this post


Link to post
Share on other sites
1 hour ago, mestela said:

Dollar variables are hscript expression variables, hscript is sloooowly being phased out.

At-symbols are vex attributes (@-ttributes, get it?), they're becoming the standard way to refer to geometry properties through most of houdini, its better to get used to that syntax.

Occasionally you'll find some older nodes that only work with the older dollar syntax, best to ask here if you stumble across those. :)

 

-matt

 

Thank you for the quick answer :)

I was trying to scatter points based on color, but when I set @Cd.r as density within the scatter node, I get an error :/

sCATTER.JPG

Share this post


Link to post
Share on other sites

in your scatter, enable Density Attribute, click drop down list it should give you Cd

(don't pick both P and CD, just Cd)

Share this post


Link to post
Share on other sites

And that's another fun gotcha with houdini; if something is designed to read attributes directly (like the scatter sop is), you don't use the @ prefix.

That also means that it won't understand the thing.subthing syntax, so Cd.r won't work either.

Put down a point wrangle before the scatter, and create a new attribute which is just the red component, we'll call it red:

@red = @Cd.r;

Now in the scatter you can put 'red' into the density attribute field.

It'll make sense in time, honestly!

 

 

Share this post


Link to post
Share on other sites

haha mestela....(Matt is the Chief Chef...I'm the sous chef) here's one I prepared earlier...(obviously we don't communicate very well...I went for blue)

blueness.jpg

Edited by Noobini
  • Like 1

Share this post


Link to post
Share on other sites
21 hours ago, mestela said:

And that's another fun gotcha with houdini; if something is designed to read attributes directly (like the scatter sop is), you don't use the @ prefix.

That also means that it won't understand the thing.subthing syntax, so Cd.r won't work either.

Put down a point wrangle before the scatter, and create a new attribute which is just the red component, we'll call it red:

@red = @Cd.r;

Now in the scatter you can put 'red' into the density attribute field.

It'll make sense in time, honestly!

 

 

so in this case its easier to use $CR than putting writing a new attribute and then putting that into the scatter :P

 

scratch that.. I bow before you matt :P

Edited by Jesper Rahlff

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

×