Technique Section

  • alert message
    hou.ui.displayMessage('cool')

setting

  • get current frame
    hou.frame()
  • add variable to hou's global() dictionary
    hou.expressionGlobals()['myVal'] = 2018

Network Editor

  • get network editor
     net_edit = hou.ui.paneTabOfType(hou.paneTabOfType.NetworkEditor)
  • move node
    curNode.setPosition([0,0])
  • color node
    curNode.setColor(hou.Color(1,0,0))
  • Node access
    curNode = hou.node('/obj/geo1') # get node by name path like in Nuke(hou.SopNode)
    curNode.name() # node name
    curNode.path() # node path
    curNode.children() # node's inside nodes
    curNode.parm('tx').eval() # node's attribute's value (hou.Parm)
  • parm template operation
    print( hou.parm('/obj/assetNode/attr').parmTemplate().asCode() ) # get build script
     
    tabs = asseNode.parmTemplateGroup().entries() # get list of tabs of attr
    parmList = tabs[0].parmTemplates() # all the parm entries
  • Hscript in Houdini = Mel in Maya, you can warp them around similarly
  • you can use Hscript in python as well
    • hou.hscript()
    • hou.hscriptExpression()
    • hou.expandString() # get hscript variable in python
      • you can also get local variable with lvar()
  • in houdini Python shell, you can directly access hscript by type % at start
  • you can create a in-line one-time compile C++ code in a python script to speed up heavy-calculation part
  • socket based XML passing and commanding
  • new one called HRPyC, old one is houxmlrpc
  • default by python versions: $HFS/houdini/python0.0libs