Jump to content

Uv Info In Vex Geometry Op


Recommended Posts

Hi Everybody...

Facing a problem.

For doing some Feather tests, I want to adjust the normals of a geometry,

using its UV coordinates. I can comb the normals, but I think UV is a better choice.

The idea is to create a Vex Geometry Op, which takes UV info for a point and its neighbours, Finds the neighbour point having Greater U or V value and make the Normal to Point to that Direction. That way, I can get all the normals pointing in one Direction or Flow (U or V).

But the problem is, UV info is only available in Shading Context, and not in Geometry Context. I know that only Vertices can have UV Info, but is there any way I can get it in VEX Geometry Op????

Plz Help.

Thanking in advance.

------------iamjaideep80

Link to comment
Share on other sites

What Andrew said.

But if you're looking for *parametric* UVs (as opposed to *texture* uv's, which is what adding a "uv" parameter will extract), then you're out of luck. In a surface shader (Mantra, PRMan,...), (s,t) get assigned the parametric uv's when not bound to the surface -- no such thing in the SOP context.

Just wanted to clarify that Andrew's solution assumes your geometry already has *texture* uv's defined (via one of the UVxxxx projection SOPs, for example).

Just for fun, try and take the output of Andrew's parameter vop, multiply it by the constant vector {1,1,0}, pipe the result straight to the "P" output, and voila! -- instant "UV viewport" :P

Cheers!

Link to comment
Share on other sites

Hi Everybody,

Thank U Everybody..

Parameter Vop for uv attribute works, but only if there are uv attributes on points, instead of vertices. And Point Sop's MAPU/V/W did the same thing. It transfered Vertex Info To Points.

And My Vex Op is working fine now.

I can align normals according to U or V direction. But still having some bugs. For Example, when I have multiple UV patches for a single geometry. In that case, the points on the patch border doesn't align properly. Trying to solve that problem.

Anyway, Thank u very much Andrew, Mario And DaJuice for ur instant reply.

---------iamjaideep80

Link to comment
Share on other sites

Don't forget import VOP too, if you want to get UV's or any attribute from a specific point use the import VOP.

And if you need to do quick neighbourhood searching and gathering of attributes use point cloud VOPs (although when I last tried this the VOPs were broken you had to do it with VEX code by hand - hopefully its fixed by now)

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