Python snippets

Bind light’s “Enable” checkbox to the display flag

obj = hou.node(".")
return obj.isDisplayFlagSet()

Reference SOP input from chopnet Geometry

chopnode = hou.node("..")
chopname = chopnode.name()                  # chopnet_smooth
chopnet,task = chopname.split('_')          # chopnet smooth
channelnodepath = "../../channel_" + task   # ../../channel_smooth
channelnode = hou.node(channelnodepath)
inputpath = channelnode.inputs()[0].path()
return inputpath

 

hou.playbar.setPlaybackRange(self, start, end)

node = hou.pwd()
path = node.path()
objContextNodeName = path.split(‘/)[-2]

Leave a Reply

Your email address will not be published. Required fields are marked *