Jump to content

Stalkerx777

Members
  • Content count

    386
  • Donations

    0.00 CAD 
  • Joined

  • Last visited

  • Days Won

    13

Stalkerx777 last won the day on October 23

Stalkerx777 had the most liked content!

Community Reputation

124 Excellent

About Stalkerx777

Contact Methods

  • Skype
    alexx_houdini

Personal Information

  • Name
    Alex Rusev
  • Location
    Vancouver, Canada

Recent Profile Visitors

9,045 profile views
  1. 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'))])
  2. 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.
  3. 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
  4. 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.
  5. 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.
  6. I've compiled it for H17.5 for windows: https://github.com/alexxbb/pathdeformer/releases/tag/h17.5
  7. Iterate in subnet python

    import toolutils toolutils.findAllChildNodesOfType(hou.node('/obj/geo1'), "null", dorecurse=True)
  8. Load QT UI from HDA extra file

    I dunno guys, just tried it on a different computer and it also works. Both are Linux machines though. In general, you want to generate Python code from your ui files. See this: https://doc.qt.io/qtforpython/tutorials/basictutorial/uifiles.html Houdini ships with pyside2-uic though I couldn't find the wrapper script for it, you can call it directly like so: hython $HFS/python/lib/python2.7/site-packages-ui-forced/PySide2/scripts/uic.py dialog.ui -o dialog.py
  9. Load QT UI from HDA extra file

    Check out the attached file Cheers, Alex emedded_qt_ui.hdanc
  10. Houdini 4D

    This guy is a legend His other videos are great too.
  11. Can we execute python def by another node remotely?

    Nothing is impossible, but this is not a common way of working with Python in Houdini. For geometry manipulation use Python SOP, for sharing your Python code, put it a module, hou.session, or into HDA's Python module. See the docs To achieve exactly what you want: In your python_remote_control: code = hou.node('../target_python').evalParm('code') exec compile(code, "inline", "exec"), globals(), locals() setA() setB()
  12. HDA - Import Python Module from extra files

    Just copy paste your code into a PythonModule, why do you need complicate things with embedding a pyc file? Using pyc files has some benefits, but only in certain rare circumstances. If your intent is to hide the source code...well.. is it really worth it? pyc files can be easily disassembled. If you want to confuse users so they couldn't figure out your algorithm you could use a python code obfuscator like this one: https://liftoff.github.io/pyminifier/
  13. python panel pyside2 dropevent

    Yes, unfortunately, d&d in Python panels is very buggy. over the course of several years, I've seen all sorts of issues including this. First, make sure in your dragEnterEvent you store the mime data somewhere and then the next time you enter the widget, check if such data exists and reject the event if it does. See if it works for you, you might need to do the same trick with the dropEvent
  14. Do you mean the parameter panel? Didn't hou.Node.setSelected(True, True) work for you?
  15. Stretch UI

    Because in your .ui file you have the width and height attributes are fixed values.?
×