Jump to content

Scattersop - Nearest Points Attribute


sanostol

Recommended Posts

Hi again,

I need some help on the scatter sop. I checked 'Average of N nearest', points to consider = 4 and this is stored in the ptarea attribute. I checked it and the node produces a float ( ptarea[1]). Now I want to use this attribute, to get rid of some of these new points. But this is my problem. I tried a delete sop but it does not recognize my $PTAREA in the expression.

What's my misstake here?

I can delete every scattered point by typing its number, but I can not filter them with my variable.

Martin

Link to comment
Share on other sites

It's probably because although you are adding ptarea as an attribute it doesn't automatically create a Local variable $PTAREA. To fix it you can use a create attribute sop before the scatter and add an attribute called ptarea, just leave the values at zero, its just there to create the varmap detail attribute that maps ptarea to PTAREA.

Also make sure you have the delete sop set to points.

Link to comment
Share on other sites

Thanks. It works fine, but I'm not sure why <_<

(it also had not the effect I was after, but new questions are rising, what of course is good..)

I used a raysop and it created a dist attribute with it, and could use it down the tree without this procedure.

To sum up, please correct me if I"m wrong:

If the info tells me this:

1 point Attributes: dist[1]

I have one Attribute but no variable, but why does it work in this case, and I could use the variable $DIST later after my raysop??

But isn't a per point variable useless without mapping to the points, what's it for then?

If the info tells me this:

1 Point Attributes: ptarea[1]

1 Detail Attributes: varmap[1]

Custom Variable Mappings:

ptarea->PTAREA

I have a exposed variable $PTAREA

I know, too many questions...

Martin

Link to comment
Share on other sites

Thanks. It works fine, but  I'm not sure why  <_< 

(it also had not the effect I was after, but new questions are rising, what of course is good..)

24006[/snapback]

If you are trying to get a more uniform distribution of points try using fuse to remove ones that are too close together. I've used that before to good effect. Generate more than you need then collapse all the ones that are too near to others.

I used a raysop and it created a dist attribute with it, and could use it down the tree without this procedure.

24006[/snapback]

Not sure how that worked, I justed tried it here and it didn't, which is what I would expect. Can you post a hip file with this working?

:

1 point Attributes: dist[1]

I have one Attribute but no variable, but why does it work in this case, and I could use the variable $DIST later after my raysop??

But isn't a per point variable useless without mapping to the points, what's it for then?

If the info tells me this:

1 Point Attributes: ptarea[1]

1 Detail Attributes: varmap[1]

Custom Variable Mappings:

ptarea->PTAREA

I have a exposed variable $PTAREA

24006[/snapback]

Exactly right. The info you are missing is this. Once an attrib has been assigned it is related to the points or prims, just open a spreadsheet view and you will see all the data there. But by adding a Local variable you are createing a shortcut to access it. Before this method was in place you had to use various expressions to get at the data. For example the point expression lets you read point attributes like this:

point("../foo",$PT,"myvar",0)

This is a lot to type so having Local variables makes life easier.

However local variables are not read everywhere AFAIK so you still need to know about the expressions. There are two for each class, point, prim, vertex, detail one for numbers and one for strings.

A top tip is if you don't have a local variable defined and you can't go back in the tree to make one you can do it wherever you like with an attribcreate sop. Just set the class to detail and the type to string then in the string field itself type foo -> FOO where foo is the name of the variable. Finally set the attribute name to varmap.

Hope this all helps and makes sense.

I bet there is stuff on odWiki about this, and also check the Houdini help.

Link to comment
Share on other sites

I found some infos on the wiki, have to check it more frequently, I guess.

A more uniform distribution of the points is exactly what I want to achive, but the fuse operator removes all my scattered points, it doesn/t care about any distance settings, only the points that build the geometry are correctly fused.

I have to dig deeper..

Martin

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