Jump to content

graham

Moderator
  • Content count

    854
  • Donations

    50.00 CAD 
  • Joined

  • Last visited

  • Days Won

    29

graham last won the day on August 26

graham had the most liked content!

Community Reputation

158 Excellent

6 Followers

About graham

  • Rank
    Houdini Master
  • Birthday 01/09/1985

Contact Methods

  • Website URL
    http://www.houdinitoolbox.com

Personal Information

  • Name
    Graham Thompson
  • Location
    Vancouver, BC

Recent Profile Visitors

9,235 profile views
  1. The pwd/cwd basically is what Houdini will use when trying to evaluate things with relative references. Something like ch("../foo") only really has meaning when it's evaluated from a certain location that has a channel called 'foo' one level up. Changing the cwd merely changes where things that rely on relative references are based. Usually this doesn't really matter much since parameters and such are always evaluated with the cwd being their node, regardless of where the global cwd is set. In this case it's pretty common to just use hou.pwd() inside a callback script or menu script since it's the easiest way to get at the node which the parameter belongs to. You can also use the kwargs dict which contains the node as well as other things if you need more information than that. kwargs["node"].node("../paint").setSelected(True, True) In terms of what code code is doing it's getting the current node the callback is happeing for, finding a sibling node called "paint" which is the one that we want to be selected, then setting it to be selected and clearing the existing selection since we only want it to be selected. Alternatively you could also use hou.clearAllSelected() and then select the node, omitting the second arg all together. hou.clearAllSelected(); kwargs["node"].node("../paint").setSelected(True)
  2. hou.cd() is basically only for changing the sessions's working directory and doesn't do much in terms of anything interactive stuff. If you are wanting to just select that other node you just need to call hou.Node.setSelected In your example file I'd do something like the following to set that node selected (and the only selected node) hou.pwd().node("../paint").setSelected(True, True)
  3. Icons path

    Take a look at hou.qt.Icon https://www.sidefx.com/docs/houdini/hom/hou/qt/Icon.html
  4. The intrinsic transform represents a transform applied to the primitive itself, not anything to do with the geometry inside it. In your case you are modifying the geometry which you then pack, but you are not changing the resulting primitive itself. In your example you can see this given that the intrinsic:bounds is changing but the transform is not. If you were to pack the geometry first and then transform it (swapping the node ordering) you would see that the packedfulltransform is updated as you modify the primitive because you are applying the transform to that packed entity, not the raw geometry inside it.
  5. How to set Tags parameter using python

    So in this case you actually just want to set the parameter: hou.parm("/path/to/parm").set({"ogl_text": "1"}) This is because you're just trying to modify an actual parameter, not the definition. You would use the hou.ParmTemplate.setTags() method if you were trying to set/update the tags of a parameter definition but since the Parameter node isn't an actual parameter you just need to set the values. Your quick update is correct in that if you were doing it this way, you'd have to take your modified parameter template and assign it back to the definition or node for it to take hold.
  6. how to connect nodes inside geometry with python

    The most simple thing to do would be the following: hou.node('/obj/geo1/merge2').setInput(1, hou.node('/obj/geo1/transform4')) If you wanted things to be a bit less hard coded/flexible you could also use hou.node('/obj/geo1/merge2').inputConnections() to get a list of connections and then figure out which one is the connection to tube1 and then use that to figure out the input index (1).
  7. Determine if node gives an error

    You can use hou.Node.errors() or hou.Node.warnings() to get at any error/warning information
  8. Assign global variables with python

    You can set values with variables in them by escaping the $: node_rop.parm('sopoutput').set("\$JOB/render/\$HIPNAME.\$F.bgeo.sc")
  9. Drag&Drop Contents

    The nodes_color.py and type_extensions.py should NOT be in the same folder as the externaldragdrop.py. Houdini will use houdini/scripts to find scripts, not Python modules. Since externaldragdrop.py is a script it belongs in there. The other files (as per the instructions) on the should be in houdini/scripts/python, which Houdini will automagically add to sys.path if it exists and then externaldragdrop will be able to import those two modules.
  10. Sorry, there is a problem You are not allowed to edit your signature. Error code: 2C122/C
  11. Weird... I spent like 15 minutes on Sunday trying to figure out how to change mine and I could in no way find any settings that enabled me (or even showed me what my current one was) to change anything. All I could see was my signature on posts I had made. I also tried using the thing from posts which hid everyone's signatures and now I don't see any at all or any sort of way to bring them back :/
  12. Resurrecting this thread. Looks like the signature options disappeared again?
  13. Detecting incomplete node definitions in python

    Short of using some wrapped HDK code, I think the best bet to check for a dummy definition is to check that both the libraryFilePath() points to "Embedded" and that the definition has very little in the sections() list. For example, creating a HDA on disk from a SOP Subnet yields a definition with some expected sections: >>> asset = subnet.createDigitalAsset("dummyop", "/var/tmp/dummy.otl", "Dummy") >>> node_type = asset.type() >>> node_type.definition().sections() {'Contents.gz': <hou.HDASection Contents.gz in definition of Sop dummyop in /var/tmp/dummy.otl>, 'CreateScript': < hou.HDASection CreateScript in definition of Sop dummyop in /var/tmp/dummy.otl>, 'InternalFileOptions': <hou.HDASe ction InternalFileOptions in definition of Sop dummyop in /var/tmp/dummy.otl>, 'DialogScript': <hou.HDASection Dia logScript in definition of Sop dummyop in /var/tmp/dummy.otl>} >>> node_type.definition().libraryFilePath() '/var/tmp/dummy.otl' However, if you then destroy the definition (with an instance of the node in your scene) you'll see it now reports as "Embedded" and only has a DialogScript and Contents.gz section: >>> node_type.definition().destroy() >>> node_type.definition().sections() {'DialogScript': <hou.HDASection DialogScript in definition of Sop dummyop in Embedded>, 'Contents': <hou.HDASecti on Contents in definition of Sop dummyop in Embedded>} >>> node_type.definition().libraryFilePath() 'Embedded'
  14. 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())
×