Jump to content

graham

Members+
  • Content count

    840
  • Donations

    50.00 CAD 
  • Joined

  • Last visited

  • Days Won

    28

Everything posted by graham

  1. Event firing when a node is Deleted ( not HDA )

    The problem is that it expects the first arg to be an iterable of enums, not just a single: n.addEventCallback( [hou.nodeEventType.BeingDeleted] , hou.session.a())
  2. add Tag{} Parameter Interface with Python

    You can do this by modifying the hou.ParmTemplate for a parameter. Consider a Float parm named "parm" that already has a tag of foo:bar set from the interface: >>> parm = hou.parm('/obj/geo1/null1/parm') # Get the hou.ParmTemplate for your parameter >>> pt = parm.parmTemplate() >>> pt.tags() {'foo': 'bar'} >>> tags = pt.tags() >>> tags["new"] = "value" # Update the tags >>> pt.setTags(tags) >>> pt.tags() {'new': 'value', 'foo': 'bar'} # Replace the existing tuple/template with the modified one. >>> hou.node('/obj/geo1/null1').replaceSpareParmTuple(pt.name(), pt) <hou.ParmTuple parm in /obj/geo1/null1> >>> p.parmTemplate().tags() {'new': 'value', 'foo': 'bar'}
  3. [novice] help with Python Script

    You are defining the function in a node but are then trying to refer to it as if it was stored in hou.session. If you either remove the hou.session prefix and call it directly, or put the code in the Python Source Editor and call it like that then it would work
  4. Other ways to look through a camera

    It's possible to drag cameras and lights onto the viewport and it will cause the viewer to look through them. It's also possible to write a shelf tool type thing and assign a hotkey to it to cause the active viewer to look through a selected camera/light.
  5. HDA - change 'Editable Nodes' via Python

    Editable nodes are stored in their own string section called EditableNodes as a space separated list of relative paths so you can basically just construct your string and add/set the contents of that section to it. hou.HDADefinition.addSection("EditableNodes", "foo bar/hello")
  6. Weird Behavior - createOutputNode

    The issue is that the parent node is in fact /obj/example. In the case of Houdini the parent node is the node that contains an operator, not an input node. Since the parent is an Object it fails because there is no xform node at the object level. As you mentioned the multiple nodes in the SOP level are a result of the node cooking multiple times, most likely when MMB on it for errors, etc.
  7. Houdini Env Variables in File Browser

    The +/x buttons in the lower left hand side just add/remove entries from the jump.pref file (usually located in $HOME/houdiniX.Y/) so you can basically copy/move that file (or create your own) and put it somewhere everyone can see and they will pick up the bookmarks.
  8. In the case of something like that (and if say modifying more than one parameter, or the ones on digital assets) you'll want to use the hou.ParmTemplateGroup from the node like as follows: >>> hou.parm('/out/mantra1/vm_variable_plane1').description() 'VEX Variable' >>> ptg = hou.node('/out/mantra1').parmTemplateGroup() >>> ptg.find("vm_variable_plane#") <hou.StringParmTemplate name='vm_variable_plane#' label='VEX Variable' length=1 naming_sch >>> pt = ptg.find("vm_variable_plane#") >>> pt.setLabel("This is a test") >>> ptg.replace(pt.name(), pt) >>> hou.node('/out/mantra1').setParmTemplateGroup(ptg) >>> hou.parm('/out/mantra1/vm_variable_plane1').description() 'This is a test'
  9. Disable/Hide When is handled through a parameters ParmTemplate conditionals dict. Consider this example of a button that is disabled/hidden when a toggle ('parm') is not checked: >>> pt=hou.parm('/obj/geo1/null1/parm2').parmTemplate() >>> pt <hou.ButtonParmTemplate name='parm2' label='Label'> >>> pt.conditionals() {parmCondType.DisableWhen: '{ parm == 0 }', parmCondType.HideWhen: '{ parm == 0 }'} >>> pt.setConditional(hou.parmCondType.DisableWhen, "{ parm == 1 }") >>> pt.setConditional(hou.parmCondType.HideWhen, "{ parm == 1 }") >>> pt.conditionals() {parmCondType.DisableWhen: '{ parm == 1 }', parmCondType.HideWhen: '{ parm == 1 }'} >>> n.replaceSpareParmTuple(pt.name(), pt)
  10. HDAs: Lock Asset Parms

    The usual method to prevent modifications would be through the use of file permissions on your repository files: A normal tool that artist would be using should be coming to them from a read only file that is created/managed by your tool system. Since the file has no write permissions artists are not able to make changes to it (think SESI otls that exist inside $HFS, you can't modify these by default because they are read only). When you hit your "Modify" button your system would make a local copy of that otl to the users work directory and the file would have write permissions so they'd be able to add/update/remove the contents and parameters. You'd then "Publish" the tool back to your system, removing their local copy and creating a new, read only copy that artists would then pick up.
  11. Make Safe Node Name?

    I would basically just do something with a regex cleanup function that converts anything you can't enter manually into _ like Houdini does. def cleanName(name): return re.sub("[^0-9a-zA-Z\.]+", "_", name)
  12. InlineCPP

    I found that I had submitted 51276 for this issue 48 months ago! Originally based on
  13. Python::Finde all nodes of one type, all versions

    The best way is to find the corresponding node types you want to search for and check for all instances of those types. For example, if your node is a SOP: key = ("io", "caching") all_instances = [] for node_type in hou.sopNodeTypeCategory().nodeTypes().values(): components = node_type.nameComponents() if components[1:3] == key: all_instances.extend(node_type.instances())
  14. InlineCPP

    Are you on Windows? I recall this being a Windows issue with how it handled args when compiling. I can't remember if there was any solution. Do things work better if you put the prim_group arg in between the detail args?
  15. A friend asked SESI this just yesterday. They said it's missing from the docs (and they will add it). It's done with hou.HDADefinition.save() hou.HDADDefinition.save("blackbox.hda", some_node, compile_contents=True, black_box=True)
  16. I think the quote blocks are all blown out now
  17. Houdini Help example files?

    We've had random people experience this at work. I think they seemed to have success getting them to show up by removing their $HOME/houdini15.5 preferences folder. Your mileage may vary however.
  18. create .geometry() in hdaModule (Python)

    How are you calling your function? You can only modify a node's geometry from inside the Code section of a Python SOP.
  19. [SOLVED]Assign Expression To A Numeric Parm?

    You can use hou.Parm.setExpression() http://www.sidefx.com/docs/houdini15.5/hom/hou/Parm#setExpression to set an expression. Alternatively you can actually set parms to other parms and it will automatically create channel references for you: tx = hou.parm("/obj/geo1/tx") ty = hou.parm("/obj/geo1/ty") ty.set(tx)
  20. You can basically just set up a Python callback on your save button that does one of two things: - Calls hou.Parm.pressButton() on the execute parameter on your ROP node: hou.pwd().node("rop_output_driver").parm("execute").pressButton() - Calls hou.RopNode.render() on the ROP node itself: hou.pwd().node("rop_output_driver").render() Both are basically equivalent as the button is going to invoke the render method of the node
  21. Where are your custom shelf files located? If you put them in your $HOME/houdini15.0/toolbar directory they will be available for any version of 15.0.
  22. Forum upgrade

    I'm with anim on the Unread Context page. I much preferred just seeing the list of threads I haven't read yet as opposed to the actual posts within them. As for the mobile layout I always generally just scrolled down and clicked the link to the full layout and browsed that way on my phone but I can't seem to find anything that will let me do that now.
  23. Name Of Current Scene?

    The most Pythonic way would be to use hou.hipFile.path() (name() mostly returns a full file path so path() is more reliable) to get the full path of the file and then process the path using os.path related things to get whatever info you want from it. Technically you can also just do hou.expandString("$HIPNAME") to get the file name, sans extension.
  24. SESI goes by http://www.vfxplatform.com/ these days for versions of most everything. I can't see them updating to 3.x unless the platform heads that way. I also can't imagine a huge interest in the industry to go above 2.7.x any time soon give the sheer amount of work every studio and application would have to do to update their code. Hell, we're still running 2.6 here...
  25. Event When a Hip Saved

    Unfortunately there is not. I would recommend submitting an RFE to SESI.
×