Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Stalkerx777

Members+
  • Content count

    322
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by Stalkerx777

  1. http://www.sidefx.com/docs/houdini/ref/panes/parmsheet
  2. No matter where you run python code from, you're using Houdini's embedded Python interpreter.
  3. If you want your JS UI run outside of Houdini, the way to go is a client/server REST approach. You have to write server side code to run in Houdini. Similar, you can write standalone server app running outside of Houdini and communicate with Houdini via hrpyc. One more interesting approach I used in the past is using QtWebKit based widget to render HTML inside Houdini and using Qt Signals/Slots to fire events from JS callbacks. Works good, but only if you have access to JS source code, or write your own with this integration purpose in mind.
  4. Just pass you geometry as an argument to your function. In HDA: def modify_geo(geo): geo.addAttribute(...) return geo In Python SOP: module = hou.nodeType("Sop/MyHDA").hdaModule() geo = module.modify_geo(geo)
  5. Exactly. This is, in general, a good practice to define all your shared Python code in a top level HDA, and use it anywhere you need, like that: module = hou.nodeType("Sop/MyHDA").hdaModule() module.my_func()
  6. Python SOPs shouldn't contain code which intended to be called outside, Houdini cooks SOPs when it's needed. Define your functions in HDA's PythonModule and call them from there, even from within Python SOPs inside, if you wish so.
  7. It's been awhile since I did instancing in Houdini last time, but it was working back then. Maybe there something else you have to toggle on.
  8. Why not using s@instancefile attribute?
  9. Haven't looked at it awhile, maybe it became possible to code your own handles nowadays, but I highly doubt about that.
  10. Hi guys! Just want to share with you some of my experiments. huilib - is a simple python wrapper around houdini .ui language. It was written "just for fun", so no warranty if it works for you. But i think it's pretty usable for simple ui, in situation, when PyQt is not an option Maybe someday we'll see something similar from sesi Feel free to use it. https://bitbucket.org/alexxbb/huilib/overview
  11. There is no copy/paste event, which is lame, I RFE that a while ago, but you can workaround this with OnNameChanged event. Print the kwargs args and see the difference between duplicating a node and just renaming, it's a little bit tricky though. I don't have a code with me now.
  12. Make sure the path is writeable Do not concatenate path strings manually, use os.path.join Maybe Houdini has a hard time writing to NAS drive. A quick workaround: save to a temp file, and then copy the file with Python (shutil module)
  13. 1. I've tried many times, but couldn't make it work. Need to ask SESI support how to use ACTION_ICONBUTTON gadget. 2. Yes: # Find the dialog by name ui = huilib.findDialog('test') if ui: # If found you can show(), hide(), and close() it ui.close() will close and delete the dialog ui = TestDialog(name='test', title='Test UI') ui.show()
  14. That is a long-standing "bug", if you didn't put import hou in hou.session module, it will work until first error (any python exception), once you get an error, hou module gets lost for some reason. So, just always do import hou.
  15. If you open Display Properties you can find there Visible objects field (Optimize Tab). The script above just puts the selected object names into this field with a help of Hscript function. If you want to hide primitives you have to play with visibility sop, there is no way to do that other than in sop context.
  16. Isolate Selection I wrote this many many years ago, still works Can put it on a hotkey or new radial menu. It's a toggle. When nothing is selected - it shows everything. import os def isolate(): sel = hou.selectedNodes() if not sel: sel_string = "*" else: sel_string = " ".join([n.name() for n in sel]) try: if hou.os.environ['CUR_ISOLATE'] == sel_string: sel_string = "*" except: pass hou.hscript('viewdisplay -G "%s" `run("viewls -n")`' % sel_string) os.environ['CUR_ISOLATE'] = sel_string
  17. Glad i could help
  18. I've tried some approaches, and this one seems to work reasonably fine: https://bitbucket.org/snippets/alexxbb/rnExn
  19. You have many options here, none of them are ideal though since not everything in Houdini is Qt yet: 1. To all your nodes in a scene add hou.Node.addEventCallback ( AppearanceChanged event type may work, or may not, I don't know). Pass your function or QWidget there, and hope this will work. A better approach would be to post a custom QEvent from there with QApplication::postEvent() and catch this event in your QWidget. Not that trivial, but definitely possible to do (at least in normal Qt app) 2. QApplication::installEventFilter. Put your filter there and see if you can catch something from Houdini. 3. hou.ui.addEventLoopCallback() poll your hou.selectedNodes() and see if selection changed. 4. Should be other ways...
  20. http://www.sidefx.com/docs/houdini16.0/hom/hou/Node setCurrent is there. hou.Parm.pressButton() if you want just fire up parameter callback. hou.Parm.parmTemplate().scriptCallback() to get callback string. hou.Node.type().hdaModule() to get python module object for that type.
  21. Seems like you have a layout problem somewhere. ScrollArea relies on its widget sizeHint(), read here: http://doc.qt.io/qt-4.8/qscrollarea.html#details
  22. I believe you need to add $HFS/houdini/python2.7libs to system's PATH variable if you're on Windows.
  23. It should be possible to do using Qt event system if you familiar with it. What you need to do is to install eventFilter to Houdini's QApplication instance, and catch QMouseEvent there. Quick untested code from the top of my head: app = QApplication.instance() class Filter(QObject): def eventFilter(self, event, **kwargs): if isinstance(QMouseEvent, event): if event.button() == Qt.RightButton: # DO stuff return super(Filter, self).eventFilter(event, **kwargs) app.installEventFilter(Filter())
  24. Python interpreter runs in the main Houdini thread, so anything you do in python will freeze Houidini UI. Depending on what are you trying to achieve, try Mouse CHOP Also, see hdefereval module which ships with Houdini.