Jump to content

Best way to normalize a vector parameter at the asset level?


Recommended Posts

Hi,

I have some vector parameters in my asset at the asset level. I don't think it's possible to normalize their values at the asset level, i.e. everything that uses these parameters get pre-normalized vector values.

So my question is what's the best way to normalize these parameters so everything that uses these parameters inside the asset would get normalized vector values.

I could limit the parameters to -1 to 1, but I still want to give the user the ability to specify any kind of vector values, otherwise the values would get clamped. But even then 1,1,1 isn't unit vector either.

Right now what I am doing is using an Add SOP with 1 point and then have a vector parameter in a VOP where it references the vector parameter. Inside the VOP network, I normalize this value and set the point's position to this value. Then a null after this that reads this point's position and stores it as a parameter, which I reference anywhere I need the original parameter at the asset level.

Is there a simpler, better way than this?

Thanks :)

Edited by magneto
Link to comment
Share on other sites

Thanks hopbin, that's a good idea. I only found the normalize expression which takes a vector value. So you create a vector from all components of the parameter, normalize and get the appropriate component for each field?

Sadly yes. I wish would improve the UI to allow expressions to work on float3/vector values as a single expression, since those types are defined in both hscript and python.

Edited by hopbin9
  • Like 1
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...