Jump to content

Curve u parameter to attribute


peliosis

Recommended Posts

Is there a simple way to get curve u parameter to an attribute.

Easy as an expression like pathparam(string SOP, integer point number)?

This is just so basic I think I'm blind being unable to find it.

The value is present in a curve and is used in a few expressions but how to use it in a SOP?

Link to comment
Share on other sites

i'm not sure if I understood You right, but what about adding a resampleSOP, set it to maximum Segments instead of Maximum Segment Length, to get a even distribution over the curve. set it to 8 segments or more, what fits to You and add a attributeCreateSOP with following expression : $PT/($NPT-1)

Link to comment
Share on other sites

If you just want a u value for the existing point, you could add a UVTexture SOP in "Arc Length Spline" mode.

That should give you a sane uv[1] coordinate. If you want your own attribute for it, AttribCreate SOP with $MAPU in the Write Value field.

eetu.

  • Like 1
Link to comment
Share on other sites

Thanks you guys!

Eetu, it works great, thanks because I completely forgot it.

I tried UVtexture a while before and haven't even spotted the spline method so I dropped it :).

Sanostol It could be done with $PT/$NPT but the problem is in nr of splines in one object.

If there is one ok, but with more there arouse the problem with counting points in a single primitive and mapping pt numbers so that they begin from 0 in each prim.

I haven't found an easy way to do this. Could be some looping SOP but they are slow as hell. Vex or python would cope but it's definitely not as 1 click as texture SOP :D

Link to comment
Share on other sites

i completly forgot the textureSOP, best way to do it

Thanks you guys!

Eetu, it works great, thanks because I completely forgot it.

I tried UVtexture a while before and haven't even spotted the spline method so I dropped it :).

Sanostol It could be done with $PT/$NPT but the problem is in nr of splines in one object.

If there is one ok, but with more there arouse the problem with counting points in a single primitive and mapping pt numbers so that they begin from 0 in each prim.

I haven't found an easy way to do this. Could be some looping SOP but they are slow as hell. Vex or python would cope but it's definitely not as 1 click as texture SOP :D

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