Jump to content

Blast Point to include points from Attribute Array ?


Recommended Posts

You have an array attribute (presumably on the detail), and you want to blast these points ?

I don't know about a VEXpression directly, but what I often do is have a wrangle that sets an attribute or a group on the points to delete, and then use the blast with @toDelete=1 or whatever.
You can also just do a removepoint(0, @ptnum) inside the wrangle, but it's actually slower than a blast (use the Performance Monitor to get the real speed reading).

So the wrangle on detail would look like

int ptArray[] = detail(0, "pointsToDelete");
foreach(int pt; ptArray){
	setpointattribute(0, "toDelete", pt, 1);
}

And then the blast node (set to points) with @toDelete=1 as I mentioned before.

 

But yeah, this might not be as elegant as a VEXpression that would work directly in the Group parameter of the blast node.

Although I don't know how to do it with an array directly, if your attribute is a string, with a space separating each point number (something like toDelete = "0 5 6 8 12 13 24 35 86"), then you could use "details(0, "toDelete") and that's it.
All you really need is the point numbers one after the other with a space in-between.

If you're adamant on using an array attribute specifically, I'd look into trying to convert that array to a string. Maybe try to do that with a Python Expression. I never used those, so I don't know how.

Link to comment
Share on other sites

By providing an example scene it'd be easier for me (and anyone) to understand and help.

So you have an array attribute on each points, each containing every points to be deleted ? Or it is a string/int/float attribute (like toDelete = "yes", toDelete = 1, toDelete = 1.0) ?
But there is a possibility that every points would be deleted, so you want to at least keep one in that case, even if it's in the list you have ?

I really don't get the thing about blasting all points but one, but also including all points from the array ?.. Do you mean to also delete all points in the array ? But you already delete all points but one, so that doesn't make much sense to me...
Or do you mean to delete all points but the ones in the array ? And if the array is empty, then just keep one ?

It might be possible to do with just nodes (blast the points, and then a switch checks if there is 0 points ( if(npoints(0)==0, 1, 0) ). In that case, switch to second input which has a blast that keeps only one point), but you still need to blast the points first.
I would really do a wrangle for any of that, it'll be easy to do anything you want.

I still feel like I didn't understand exactly what you want, so do post a scene.

Link to comment
Share on other sites

I have a bunch of points, lets just say there are thousands.  If I blast just one point, with delete unselected; obviously I will just have one point in the view port.  I have a wrangler with a variable with a nearpoints() expression.  For the point which I'm not deleting with the blastnode in the view port, I also want all the nearest points for the current point which is not being deleted to be seen in the viewport, which is in an array ?

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