Jump to content
Guido

invert attribute

Recommended Posts

Hello, I'm struggling to invert attribute "@partdist" 
[attach]partdist.jpg[/attach]

I created this expression but seems dosen't work

f@partingMask = fit(@partdist, 0, 1, 1,0);

[attach]partingMask.jpg[/attach]

Maybe the value of partdist isn't 0 to 1 ?
i see some strange values in geometry Spreadsheet like 3.34558e-05
[attach]geometrySpread.jpg[/attach]

Thanks if anyone want help me to understand

partdist.jpg

geometrySpread.jpg

partingMask.jpg

Share this post


Link to post
Share on other sites

The expression you've listed should work fine.

If you're concerned about the ranges, you can always manually clamp your range between 0 and 1, and then just take the absolute value of (partdisk - 1) which will effectively do the same inversion and you can check your values against that to confirm:

f@partingMask = abs(clamp(@partdist, 0, 1)-1);

 

 

Share this post


Link to post
Share on other sites

Just to chime in, the "3.34558e-05" values you mention is simply an abbreviation that the attribute spreadsheet does, actually, this happens everywhere in Houdini. Basically just means that a number had too many 0 to be displayed easily so it was made into this mathematical abbreviation. I think if you were to write this number out it would be 0.00000334558.

So whenever you encounter e-xx (where x can be any number) it just means that there are that many zeros behind the punctuation mark before you get to the other values displayed. Same if you ever see e+xx, just means that there are that many zeros before getting to the other numbers displayed.

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

×