Jump to content
amin.khormaei

action for the values outside the find attribute value array

Recommended Posts

as you can see the code below:

i[]@values = findattribval(0,"point","random_number",3);

for(int i = 0 ; i < len(@values) ; i++)
{
    if(@ptnum == @values[i])
    {
        @pscale = ch('specific_pscale');
    }
    else
    {
        if(@ptnum != @values[i])
        @pscale = ch('rest');
    }
}

the second if inside the else doesn't work properly.

 

Specific_pscale.hip

Share this post


Link to post
Share on other sites

Not by Houdini right now, but I think you may want something like this

int values[] = findattribval(0,"point","random_number",3);
@pscale = find(values, @ptnum) >= 0 ? chf('specific_pscale') : chf('rest');

 

Share this post


Link to post
Share on other sites

thank you but your code doesn't work, I want to scale the point with random_number attribute that equal with 3 by specific_pscale slider and the rest of the points with the rest slider.

I'm tested the find, find returns the index of certain value in the array

Edited by amin.khormaei

Share this post


Link to post
Share on other sites

I'll check once I have access to Houdini

  • Like 1

Share this post


Link to post
Share on other sites
15 hours ago, amin.khormaei said:

thank you but your code doesn't work, I want to scale the point with random_number attribute that equal with 3 by specific_pscale slider and the rest of the points with the rest slider.

seems to work exactly that way, what exactly is not working for you? attached file with the same code

Specific_pscale_fix.hip

  • Like 1

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

×