Jump to content

invert attribute


Guido

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

Link to comment
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);

 

 

Link to comment
Share on other sites

  • 4 weeks later...

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.

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