Jump to content

ramp maximum value


Tranguz

Recommended Posts

Sorry, a novice question about ramps. I was trying to get the maximum value of a ramp (Spline Ramp) with an expression using Python. How do i cycle between ramp points?

ramp.eval() returns an object containing keys and values, so along this line:

ramp = node.parm("myramp").eval()
maximum = max(ramp.values())
for x in range(len(ramp.keys())):
    print ramp.keys()[x]
    print ramp.values()[x]

etc.

hth,

skk.

Link to comment
Share on other sites

Oh Thanks for your help SYmek. Now I got it!

So eval() method in hou.Parm class with a referenced ramp parameter doesn't give you a int, float, or str value but an instance of hou.Ramp from which I can easily obtain the maximum ramp value from the values() tuple!

Thanks a lot!

Edited by Tranguz
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...