Jump to content

difference between @Cd.r and $CR


PhiiLL

Recommended Posts

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

 

Link to comment
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

Link to comment
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!

 

 

  • Like 2
Link to comment
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
Link to comment
Share on other sites

  • 3 years later...
On 08.01.2018 at 5:25 AM, 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!

 

 

Thank you, Matt! Finally, I've got this thing.

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