Jump to content

UV point attribute to a ramp.


Symbolic

Recommended Posts

Hi,

This may sound strange. But I have to do the following.

* I have a curve with UV attribute. (0-1)

* I scatter n points on the curve (ex: 4 points)

* I know the UV attribute for each point:

P1 = 0.1

P2 = 0.4

P3 = 0.6

P4 = 0.9

* Somewhere else I have ramp parameter.

I need to make something like that:

"I have 4 points, create 4 points on the ramp as well and set their position to the corresponding U locations"

So I get a ramp with 4 points... set eaxctly at 0.1, 0.4, 0.6, 0.9

Please do not get mad if this sounds creazy! :)

(And I do not know what is going on, but my firefox is not performing splle check anymore! :) )

Link to comment
Share on other sites

So I get a ramp with 4 points... set eaxctly at 0.1, 0.4, 0.6, 0.9

just some bricks that might help ....

from the help:

__init__(self, basis, keys, values)
>>> lin = hou.rampBasis.Linear
>>> hou.Ramp( (lin, lin), (0, 1), (0, 1) )

basis is the interpolation, keys are the keys and values the values ...

for p in node.geometry().points():
 p.floatListAttribValue("uv")

this returns the UV values of your points.

the problem here might be that scattering along a curve doesn't necessarily create an ordered sequence of points.

Edited by rdg
Link to comment
Share on other sites

Thanks rdg!

I will give it a try... Although my python skills are still very poor. So If I want to have a button around my ramp... something like "Update ramp"...

Then I will build my script inside this button? Right? So the script can dive into the sub networks... find the points... get their 0-1 position and transfer this into the ramp?

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