Jump to content
Zetha

How to selects a point ID using VEX?

Recommended Posts

Hello,

How can you select a point, when you have lots of them?

Using VEX or nodes

 

Thanks!

Edited by Zetha

Share this post


Link to post
Share on other sites

Group SOP

Or in a wrangle you can type:  

if ( whatever )
	i@group_mygrp = 1;

There's the group expression Sop too.

 

Edited by A-OC
The group expression Sop

Share this post


Link to post
Share on other sites
3 hours ago, A-OC said:

@group_mygrp = whatever;

 

Because of how Houdini deals with ints, you can also do that :) (if your "whatever" fits on one line of code)

Share this post


Link to post
Share on other sites
9 hours ago, acey195 said:

Because of how Houdini deals with ints, you can also do that :) (if your "whatever" fits on one line of code)

Kewl !!

Share this post


Link to post
Share on other sites

Thanks,

I have been able to do with the SOP nodes, but I am not able when I try using only VEX.

 

When I type:

if (@ptnum = 56) {
    v@P.y = v@P.y + 2;
}

 

It moves the whole grid of points. How can I move only the point 56?

I cant figure how to select a single point of a grid with the code

 

Share this post


Link to post
Share on other sites

The most obvious problem here is that you're using = instead of == in your conditional statement.

That said, because point wrangles are always running in parallel (all points are processed "simultaneously"), isolating a single point like this is bad form. You should consider using "56" as the group mask for the wrangle instead, or create a point group upstream if you need more points than that.

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

×