Jump to content

Stalkerx777

Members
  • Content count

    439
  • Donations

    0.00 CAD 
  • Joined

  • Last visited

  • Days Won

    15

Stalkerx777 last won the day on February 12

Stalkerx777 had the most liked content!

Community Reputation

159 Excellent

About Stalkerx777

  • Rank
    Illusionist
  • Birthday 03/02/1984

Contact Methods

  • Skype
    alexx_houdini

Personal Information

  • Name
    Alex Rusev
  • Location
    Vancouver, Canada

Recent Profile Visitors

10,044 profile views
  1. How to get a callback event on cook?

    You might want to use Object/Python Script or Sop/Python SOP nodes for this. Or create a new "Python based" operator via File -> New Asset > Python type and you'll be able to put your cooking code into the Code section of the operator
  2. how to update a menu items (not using menu script)

    This is what I did when I needed something like this. I added a callback to my menu A and used an intermediate data storage, so when I trigger menu A, it would update the storage and trigger the callback for menu B. Example of A -> B dependency Menu A parameter callback: def changed(): # Since Menu B depends on value of Menu A, we calculate the values for Menu B in this callback and push them to the "storage" values_for_menu_b = [1, 'a', 2, 'b', 3, 'c'] # setUserData wants a string (setCachedUserData can take any Python object, but only lives within the session) kwargs['node'].setUserData('storage', str(values_for_menu_b)) # Trigger menu_b, this will cause the menu script to evaluate kwargs['node'].parm('menu_b').pressButton() Menu B menu script: def menu_items(): # eval'ing the string into a list of tuples for the menu return eval(kwargs['node'].userData('storage')) Hope this helps
  3. Setting Default Scene File

    https://www.sidefx.com/docs/houdini/hom/locations.html Add this to $HOME/houdini18.5/scripts/123.py: hou.hipFile.load("your_scene.hip")
  4. Parameter Expression by Python

    0. Switch expression language to Python (you've done that already) 1. Set a keyframe on the string parameter. This is required! 2. Set your expression like this: hou.expandString("$HIPNAME").split('_')[0]
  5. Store Houdini environment variables between sessions

    hou.hscript("set -g VAR=val") Will save the variable in the hip file
  6. Python 3, using old Python 2 scripts

    This is simply not true. There's a huge difference between python 2 and 3. There's a reason why there's still massive amounts of Python 2 code around even after 12 years since Python 3 came out. Changes to import mechanics, strings and unicode, iterators, metaclasses just to name a few. Switching to Python 3 is not trivial. For simple scripts, converting manually is a reasonable option, for bigger projects I use this tool: futurize Check out this guide: https://docs.python.org/3/howto/pyporting.html
  7. how to run a bash command and show result to user?

    # myscript.py import os import time for f in os.listdir("."): time.sleep(0.1) print(f) From Houdini: import subprocess # Note the -u flag for unbuffered output cmd = "xterm -hold -e 'hython -u myscript.py'" proc = subprocess.Popen(cmd, shell=True)
  8. Export details to .json files

    Save your geometry with File SOP and set file extension to .geo (not .bgeo). Open it with a text editor and you'll see that it's just a JSON file.
  9. Depending on what you mean by "variables". They can be 1. Environment variables (os.environ), 2. Hip variables (stored in hip): hou.hscript("set -g VAR={}".format(value)) 3. Session variables: hou.session.VAR = "FOO" 4. You can store data on the node: hou.Node.setUserData("VAR", "FOO") and read it back with hou.Node.userData("VAR")
  10. Reading .env file from a centralized directory

    Maybe this will help https://www.toadstorm.com/blog/?p=722 P.S. It might be much easier to write a wrapper script for launching Houdini, instead of struggling with .env and packages
  11. Handle HDA parameter name changes during sync

    What you're looking for is a SyncNodeVersion event handler.
  12. "control" ui elements via python

    It depends, but in most cases you're out of luck. Check the shelf source. If the dialog was created with hou.ui.createDialog(..) then it means there's a source code somewhere and you can lookup the parameter name and set it with hou.Dialog.value(). But I doubt Ocatane devs chose this way it most likely implemented in HDK. Your best bet would be to check if Octane provides some sort of Python API or maybe ask them directly.
  13. Python SOP, in what order does Houdini evalute it?

    Python SOP should not modify any node parameters, this SOP is for manipulating geometry. For modifying parameters - use expressions To answer your question: Houdini networks are DAGs and the order is on Houdini's discretion, based on what has been already cooked and/or changed. In most cases, you should not be building network logic based on nodes order, it's very error prone.
  14. Reading .env file from a centralized directory

    In houdini.env: HOUDINI_PATH=$HFS/houdini:/path/to/my_tools where my_tools is a directory that has a structure which houdini recognises (i.e otls, scripts folders etc )
  15. externaldragdrop.py - only works on some machines? not all

    Haven't used external d&d but I would suggest submitting a bug report, especially if it works on some machines
×