Tranguz Posted July 16, 2011 Share Posted July 16, 2011 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? Quote Link to comment Share on other sites More sharing options...
symek Posted July 17, 2011 Share Posted July 17, 2011 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. Quote Link to comment Share on other sites More sharing options...
Tranguz Posted July 17, 2011 Author Share Posted July 17, 2011 (edited) 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 July 17, 2011 by Tranguz Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.