mohamaedkamal Posted April 14, 2018 Share Posted April 14, 2018 hello everyone , I want to add multiple ramp points using python any one can help to achieve that Quote Link to comment Share on other sites More sharing options...
f1480187 Posted April 15, 2018 Share Posted April 15, 2018 (edited) # Initialize new ramp. node = hou.pwd() ramp_parm = node.parm('ramp') bases = [hou.rampBasis.Linear] * 5 keys = [0.0, 0.125, 0.25, 0.375, 0.5] values = [0.0, 0.25, 0.5, 0.75, 1.0] ramp = hou.Ramp(bases, keys, values) ramp_parm.set(ramp) # Add multiple points to existing ramp. node = hou.pwd() ramp_parm = node.parm('ramp') ramp = ramp_parm.eval() bases = list(ramp.basis()) + [hou.rampBasis.Constant] * 4 keys = list(ramp.keys()) + [.5, 0.625, 0.75, 0.875] values = list(ramp.values()) + [0.25, 0.5, 0.75, 1.0] ramp = hou.Ramp(bases, keys, values) ramp_parm.set(ramp) # Change first point value from 0.0 to 1.0. node = hou.pwd() point1_val = node.parm('ramp1value') # Point indexing starts from 1. point1_val.set(1.0) python_ramp.hipnc Edited April 15, 2018 by f1480187 6 1 Quote Link to comment Share on other sites More sharing options...
pelos Posted November 24, 2021 Share Posted November 24, 2021 thanks for the example, very easy to set up a ramp parameter with python 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.