amin.khormaei Posted September 26, 2020 Share Posted September 26, 2020 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 Quote Link to comment Share on other sites More sharing options...
anim Posted September 27, 2020 Share Posted September 27, 2020 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'); Quote Link to comment Share on other sites More sharing options...
amin.khormaei Posted September 27, 2020 Author Share Posted September 27, 2020 (edited) 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 September 27, 2020 by amin.khormaei Quote Link to comment Share on other sites More sharing options...
anim Posted September 27, 2020 Share Posted September 27, 2020 I'll check once I have access to Houdini 1 Quote Link to comment Share on other sites More sharing options...
anim Posted September 28, 2020 Share Posted September 28, 2020 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 1 Quote Link to comment Share on other sites More sharing options...
amin.khormaei Posted September 28, 2020 Author Share Posted September 28, 2020 thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.