Jump to content


  • Content count

  • Donations

    0.00 CAD 
  • Joined

  • Last visited

  • Days Won


Stalkerx777 last won the day on October 23 2019

Stalkerx777 had the most liked content!

Community Reputation

131 Excellent

About Stalkerx777

Contact Methods

  • Skype

Personal Information

  • Name
    Alex Rusev
  • Location
    Vancouver, Canada

Recent Profile Visitors

9,204 profile views
  1. It seems to me you have a very poor understanding of Houdini/Python basics which is Ok for a beginner. Houdini Docs are pretty good these days, go ahead read it and create a few tools for practice. Then read this on how to tell Houdini where to find your scripts.
  2. Python module in Parameter

    Put your module in $HOME/houdiniX.X/scripts/python/my_module.py
  3. PyQT Window keeps reopening on initial opening of hip file

    The point of parenting. You most likely want your UI shown on-demand (i.e clicking a shell button, menu or in python panel). Parenting to the main and not expecting it to show up doesn't make much sense. Which means you have your code executed either in 123/456.py or in hou.session or in HDA's event handlers. Decide when you want this ui to be shown and call dialog.show() from there.
  4. How to access parameters on newly created HDA node?

    All even handlers have a special kwargs variable available to them, which is a dictionary. Try to print(kwargs) and you will see that it has a reference to your node. node = kwargs["node"]
  5. How to get All the bgeo.sc used in scene

    files = filter(lambda p: p.endswith('.sc'), [n.evalParm('file') for n in hou.nodeType('Sop/file').instances()])
  6. Load new instance of houdini from current scene

    1) Have your code in hou.session module of the hip being opened 2) Have your code in 123.py/456.py
  7. PySide2 override CSS

    Create your widget first, and then set the stylesheet on your widget and not the main window. obj = PysideTest(hou.qt.mainWindow()) css_filter_str = 'QLineEdit#QLineEditCustom\n{background: rgb(255, 255, 255); color: rgb(255, 0, 255); selection-background-color: red}' obj.setStyleSheet(css)
  8. Load new instance of houdini from current scene

    import subprocess subprocess.Popen(['houdini', '/path/to/scene.hip'])
  9. operator list in vex

    Your best bet would be to add an extra parameter (can be hidden) with Python expression which would expand that relative path for you and then in you can read this string back in vex. " ".join([n.path() for n in hou.pwd().glob(hou.pwd().evalParm('relative'))])
  10. Is it possible to import hou module outside houdini?

    It is possible(or at least was possible) to use the hou module in a standard system interpreter, there's even a help page somewhere in the docs. Using both Maya and Houdini interpreters within a single app (or package) could be tricky, but definitely possible and depends on your use case. Unless you required to use both APIs at the same time you can organize your code in such a way where Maya mypy instance communicates with a standalone Hython instance through a simple intermediate disk file or an RPC server.
  11. Python write vector attribute to text file

    import hou import numpy as np geo = hou.node('/obj/geo1/torus').geometry() # Read the attributes into numpy arrays pos_array = np.frombuffer(geo.primFloatAttribValuesAsString('pos'), dtype=np.float32) dir_array = np.frombuffer(geo.primFloatAttribValuesAsString('dir'), dtype=np.float32) # Split the array by 3 pos_array = np.array_split(pos_array, pos_array.size/3) dir_array = np.array_split(dir_array, dir_array.size/3) # Stack the arrays (similar to python zip()) stack = np.column_stack((pos_array, dir_array)) # Make a single continuios array of form pos.x pos.y pos.z dir.x dir.y dir.z final = stack.flatten() # Save to a file with float precision = 3 np.savetxt('c:/temp/foo.txt', final, fmt='%.3f', newline=' ') If you need speeeeeeeed
  12. Here are a few things to know: First, you should never use hdefereval.executeInMainThreadWithResult from the main thread, obviously, it'll always lock the session. Now, what's going on with user's Thread instances is a little bit odd from a viewpoint of a regular Python interpreter. When you join(), you tell other threads (main thread, in our case) to lock and wait. This seems to work fine with Houdini, until you start making calls to Houdini API from your thread, (hou.expandString() in your case) For this reason, there's a hdefereval.executeDeferred(callback) method exists, which doesn't block, but if you need to get something back from your callback, you'd have to take care of this yourself, there are many ways to do this, for example using Queues. This is common producer-consumer pattern. Hope this helps.
  13. Sorry, unfortunately, my Mac is so outdated it'll take a lot of work to bring it in shape, so can't promise if I ever be able to compile for Mac.
  14. I've compiled it for H17.5 for windows: https://github.com/alexxbb/pathdeformer/releases/tag/h17.5
  15. Iterate in subnet python

    import toolutils toolutils.findAllChildNodesOfType(hou.node('/obj/geo1'), "null", dorecurse=True)