Jump to content

adding color to points, using Attributewrangle , Att vop sop


mirHadi

Recommended Posts

hello

 

I can use point sop to add color to y bounding box of an an object using $BBY.

but there are complains about point sop functionality and how It is better to use Attribute wrangler or vop sop to do what point sop can do.

 

but I'm not aware of all of it. for example I don't how to add color ( ramp or not) to $BBY of an object using Att W, or Att vop sop.

because A W doesn't accept local variables and every variable should be defined first.

 

in general how can replicated the point sop functionality in Att W and Att vop sop.( like color, edge direction.... )

 

thank you for your time.

Edited by haaranoos
Link to comment
Share on other sites

In an attribWrangle set to point mode:

vector _pos = relbbox(@P);  // _pos is a local variable to this attributeWrangler
@Cd = _pos;  // @Cd is an attribute on your geometry. 

@Cd is a vector attribute so you would normally have to declare it as so by prefixing the @ with the type:

v@Cd

but since Cd is a known attribute, the type casting is automatically done for you by H

 

The list of know attributes and the character to prefix your attributes with depending on your needs here: (scroll down to Accessing Geometry Attributes) http://www.sidefx.com/docs/houdini14.0/vex/snippets

  • Like 1
Link to comment
Share on other sites

The Attribute Wrangle SOP is a good replacement of the Point SOP as you can quickly write any attribute relationship simply and it will evaluate much faster with larger datasets.

 

To expand on iamyog's response and exactly answer your question, you can set BBY to say the green color by doing:

 

@Cd = set(0, relbbox(@P).y, 0);

or a longer form like

vector pos = relbbox(@P);
@Cd.y = pos.y;
Edited by old school
  • Like 1
Link to comment
Share on other sites

old school  , thank you. 

always helpful.

 

yes that was exactly what I wanted to ask. :)

 

so you recommend doing this in A W or A vop sop rather than Point sop yes?

 

In fact I red a post that most of the Houdini users are shifting completely to use Attribute wrangler or Attribute vop sop instead of Point sop. I suppose there are technical terms for that and seems logical.

 

but there is no clear reference to replicated all of the point sop functionality into  A W  or A vop sop.

is there any reference to do like particle forces and point edge direction .. etc in A W or A vop sop or I (as a beginner) need to do a lot of reading and try and error to get there?

Link to comment
Share on other sites

haaranoos,

 

to put it in simple words, yes Wrangles are faster and slowly replacing the functions of many nodes. Main reason being that vex is a multi-threaded language so on high points/poly/ect count it evaluates faster than anything else.

 

For a quick intro on transitioning I'd suggest you watching this video Ruben made recently

 

 

Good Luck!

Link to comment
Share on other sites

I watched the video and something's strange to me...

 

around 15:00 ,  He adds a new solver sop to replicated the other sop , he uses the Prev_Frame output to the second input of Attribute wrangler. , and plugs the input 1 output to the first input of Att wrangler ,  which doesn't exist!!.

I'm a little confused and I don't understand what he says no matter how many times I listen to him...

 

why is this connected this way ?

please help me out.

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