Using python to add/delete ramp points

   5127   2   1
User Avatar
Member
48 posts
Joined: 2月 2013
Offline
Can it be done and how? I would like the ability to save and load ramp curves.
User Avatar
Member
1391 posts
Joined: 12月 2010
Offline
Suppose I have a “null” node with a ramp parameter by name “rampParm”.
I can make some changes on this ramp with below script :

# Take the node

node = hou.node('/obj/sphere_object1/null1')

# Create Ramp Data Object

rampData = hou.Ramp((0, 0), (0, 1), ((0.0, 0.0, 0.0), (1.0, 0.0, 0.2)))

# Apply This Data to The Ramp Parameter

node.setParms({'rampParm':data})

NOTE 1:
To add or remove or any changes on the ramp you should change rampData values

NOTE 2:
To see all of the details of the hou.Ramp ,check Houdini Help page :wink:

http://www.sidefx.com/docs/houdini10.0/hom/hou/Ramp [sidefx.com]
https://www.youtube.com/c/sadjadrabiee [www.youtube.com]
Rabiee.Sadjad@Gmail.Com
User Avatar
Member
48 posts
Joined: 2月 2013
Offline
thank you, i'll test this out.
  • Quick Links