Jump to content

Search the Community

Showing results for tags 'hscript'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • General
    • Lounge/General chat
    • Education
    • Jobs
  • Houdini
    • General Houdini Questions
    • Effects
    • Modeling
    • Animation & Rigging
    • Lighting & Rendering
    • Compositing
    • Games
    • Tools (HDA's etc.)
  • Coders Corner
    • HDK : Houdini Development Kit
    • Scripting
    • Shaders
  • Art and Challenges
    • Finished Work
    • Work in Progress
    • VFX Challenge
    • Effects Challenge Archive
  • Systems and Other Applications
    • Other 3d Packages
    • Operating Systems
    • Hardware
    • Pipeline
  • od|force
    • Feedback, Suggestions, Bugs

Found 23 results

  1. The Artist's Guide to Technical Direction in Houdini - Volume 0: Hscript Back in 2005 I got my start as an intern at Side Effects Software Inc. Over the past decade of using Houdini, I've worked around the world in the film (Starz Animation, Dr. D, Digital Domain) and games (The Coalition, BioWare, EA Motive) industries. In this time, I've had the pleasure of working with many artists who were new to Houdini and sharing some of the insight I've gained. While most people are pretty excited to get their hands on the flashier parts of the software such as FLIP and Pyro, I think that Houdini's greatest strength comes from it's sheer flexibility. And that flexibility is something that only opens up the deeper you delve into how things work. What I like most about Houdini is discovering new ways of doing things. One complaint I've heard time and again, is that after following a tutorial, new artists are often left with something that looks pretty but with little understanding of how anything actually works. I'm always hearing complaints about how steep the learning curve is with Houdini. I'm seeking to help fix that with 7 hours of new training material that focus specifically on HScript scripting in Houdini. This course I've designed for artists who are either lacking a technical background, or who may have experience in other packages but want to understand Houdini better. We'll avoid creating pretty things in this series. Instead, I want to keep a sharp focus on how things work. That means learning about procedural networks, variables and attributes, functions, and for-each loops. Most importantly, I address how to self-learn Houdini. My hope is that this course will build a solid foundation for you to get the most of any future training you pursue and help you to understand how to get the most out of your Houdini networks. If you'd like to become more adept at scripting in Houdini, please consider signing up for my course: https://mixtrn.com/course/the-artists-guide-to-technical-direction-in-houdini-hscript/ Have a Great Day!
  2. I am trying to use the 'unix' hscript command to set the 'JOB' variable to my linux shell from inside Houdini but so far no success I got an 'not valid identifier' error if I do this: unix export JOB=$JOB I know I could use python but I am trying to use script for this one. Any tips? Thanks in advance.
  3. Hello all, So ive been customing the Houdini env variables within the Houdini docs folder. All working correctly with my job and hip file paths set as I wish. I was wondering is it possible to reference a system environment variable within the Houdini env variables script? (So set a environment variable called HOME to a certain path in the systems env variables) (Then call HOME within the Houdini env variables to set JOB or whatever). Any guidance or help appreciated as always Thanks C.
  4. Get position\orientation of handle

    I can set handle position and orientation with omparm hscript command. But is it possible to get position\orientation of handle?
  5. I'm in the middle of making an otl for our artists and was wondering if there is a way to switch Houdini's viewport panes between Scene View and Composite View. I haven't found the proper help files for manipulating Houdini's layout through scripting. Thanks Mike
  6. I'm in the middle of making an otl for our artists and was wondering if there is a way to switch Houdini's viewport panes between Scene View and Composite View. I haven't found the proper help files for manipulating Houdini's layout through scripting. Thanks Mike
  7. Is Geometry Selected???

    Is there any way to verify if some geometry components selected?
  8. I'm trying to drive a BlendShapes' SOP blend parameter using a point attribute, @fade. The @fade is a point attribute and have it's value animated. But the blend parameter doesn't appear to read this animated values and keep showing 0 instead. The question: the blend parameter doesn't work with point attributes? I tried VEX and Hscript forms (@fade and $FADE). The second crashes.
  9. hi everyone.wish you have a nice day. i need some help about scripting.but my English skill is not well.sorry for that. i have a hip named "test_hipfile_v001.hip".in this hip file i have a geometry ROP node that i want cache something like pyro,particles.and i want the cache named like "cache_pyro_v001.bgeo",the important thing is the cache version equal file version. here is the function i want achieve: when my hipfile update version to v002,i want the cache version auto-update to v002. i know $HIPNAME can fetch the file name ,but i don't know how to fetch the version info from $HIPNAME and transfor to .oh,i forgot another thing is i want code only in the Geometry ROP Node,because i achieve this function in SOP use Attribute Wrangle SOP Node,and transform the version info to ROP Node,but i think this too messy. can you gays give me some advise?thanks.
  10. I'm just slowly getting into Hscript expressions, especially for outputting files. I got my hand on a scene file that has a very customised way of outputting files and I was wondering if anyone could help me break it down. I obviously know the ones like $HIP and $OS but I'm having trouble making sense of the rest of it. $HIP/cache/$OS/v`padzero(2, ch("ver"))`/path_`ch("../PATH/path")`/cluster_`ch("../CLUSTER/cluster")`/`$OS`_p`ch("../PATH/path")`_c`ch("../CLUSTER/cluster")`_v`padzero(2, ch("ver"))`.$F4.bgeo.sc
  11. Shelf tools & scripts collection

    Hey guys! I'm starting this thread to share few shelf scripts i use and came across, during my houdini journey. Please feel free to add in more! # ADD NODES/OBJECTS TO MANTRA (Customisable) Select node(s) and click on the script to add it to mantra's force object/matte object etc. You can customise where to add by changing the parameter name (line 22) import hou selection = hou.selectedNodes() names = [n.name() for n in selection] my_list = “” if len(selection) < 1 : my_list = "nothing selected, please select at least one object" else: a=1 for sel in selection: my_list = my_list + "\n" + "selected object " + str(a) + ":" + sel.name() a=a+1 hou.ui.displayMessage(my_list, buttons=('OK',)) length = len(selection) print "Number of nodes selected: " + str(length) paths = [n.path() for n in hou.node('/out').allSubChildren() if n.type() == hou.nodeType('Driver/ifd')] selected = hou.ui.selectFromTree(choices=paths) mantras = [hou.node(path) for path in selected] for m in mantras: m.parm('matte_objects').set(' '.join(n.name() for n in hou.selectedNodes())) #CHANGE PARAMETER NAME AS REQURIED print ("Selected mantra nodes : ") + m.name() new_name=' '.join(names) hou.ui.displayMessage("( "+ (new_name) + " ) – added to selected mantra(s) matte objects.", buttons=('*OK*',)) #SETUP DELAYED LOAD Select node(s) and execute. It'll create procedural shader and setup all the parameters. Works on all nodes with 'file' parameter. #function for node variable: return type, description and name def extract_getTypeName(node): nodetype = node.type() description = nodetype.description() type_name = nodetype.name() return type_name #show selection tuple names selection = hou.selectedNodes() print len(selection) my_list = “” if len(selection) < 1 : my_list = "nothing selected, please select at least one object" else: a=1 for sel in selection: my_list = "selected object : " + sel.name() a=a+1 hou.ui.displayMessage(my_list, buttons=('OK',)) #for each object in selection lenght = len(selection) print "DONE!" for i in range(lenght): #create python variable for selected node selected = hou.selectedNodes()[i] if selected: meshop=hou.node('/shop'); meshop=meshop.createNode('vm_geo_file'); meshop.setName('delayed_load_shop_1', 1) targetdshop=meshop.path(); meobj=hou.node('/obj') meobj=meobj.createNode("geo"); meobj.setParms({"shop_geometrypath":targetdshop}); meobj.setName('DELAYED_load_geo_1', 1) targetfile=selected.parm('file') or selected.parm('sopoutput') mefile=meobj.node('file1') meobj.parm("geo_velocityblur").set(1) meobj.parm("vm_forcegeometry").set(0) meshop.parm("file").set(targetfile)
  12. So I'm making a HDA wich has a color sop inside of it, of wich Im using the group field, thats why I need to acces this field at the upper level (the HDA interface). So to to do this, when building the HDA interface I dragged that field directly from the color sop to the HDA interface, (pic1/3)but when I try to use it from the HDA it throws this error (pic2), wich I guess is referencing this code inside the group's script (pic4). I've never messed around with this kind of stuff, how can I solve this?
  13. Hi all, I have a small question about the best behavior when one wants to keep the track of the source scenes for a specific task/asset. Let's say you want to cache a sim. Usually you will make several versions of it. I think it is important to have the source file for each sim/cache version that is saved at the caching time (maybe in the sim/cache folder). Houdini has a 'post-render script' capabilities but my knowledge of hscript or python is very limited. Any ideas how to do that? Thank you! Cheers, Cristian
  14. Hi there, First time post here. I'm relative new to Houdini and I really love already it but there are some things that (probably) are really simple but I just can't figure out. I must admit that I have very little experience in expressions and python (which I'm already working on) but for something I'm currently working on I'd hope to have some help before I get proficient enough in that. I have a volume source which emits in the Y axis and I wanna use the gas disturb fields but only on the voxels that are being emitted for the first second, after that I want other microsolvers that I have in the scene to take over. What kind of expression should I use for that? Should I first add some kind of life-attribute and then refer to that or is it much simpler? I looked at the local variables in the gas disturb microsolver but as far as I can tell they all refer to the simulation step time which is in the beginning of the whole simulation. Some help ore pointers are really appreciated. Thanks!
  15. So I have a switch node I want to direct based on what another switch node's channel is set to. AFAIK || is the "OR" nomenclature but going back to H13 I have not been able to get this to work. Basically if the first switch is set to 3, 5 or 6 set the second switch to 1.. if its not 3,5 or 6 flip it the other way. This is the expression that I have, but it seems to result in in any value being true (1). What am I doing wrong? it doesn't error if(ch("../switch_GLV/input")==3 || 5 || 6, 1,0)
  16. Hi, I have a question regarding pre-render scripts. How do I change a variable in a switch node in a dop network to change the value as a pre-render script. Any help would be appreciated. Thanks.
  17. Hi I want to import .abc cache containing a maya camera into houdini scene, but I can't seem to find the approriate hscript or hou functions. I mean I can do it manually by file --> import--> alembic scene. But How do I automate this in python script ? there is some animation from frame 1-100 in the .abc file. I tried to compile alembic on windows 8.1 because I want to try the SOP_AlembicIn included in the code, I got lots of error when trying to do so. For geometries I know I can create a geo node, and go inside create a alembic node to import .abc file.I think convert this to hscript is pretty straightforward. But for camera .abc file, this doesn't work, while file --> import--> alembic scene seems working, is there a way to code this camera import in python ? or is there another way ? or someone has compiled this for windows ? Thanks.
  18. I'm trying to learn houdini, and one thing which I'm getting really stuck at is the syntax and (apparent) inconsistency of expressions / snippets of code - or at least there's so many little idiosyncrasies that it's driving me nuts. I've looked around as much as I can in various documentations, but couldn't find a single piece of text which describes an overview of all of these things, instead the info is scattered all over the place, probably because some of these are legacy and dates back decades while others are quite new. As far as I understand: $ is for global variables (in HSCRIPT ? and python too? are there substitutes for VEX?) @ is for attributes in VEX (is it possible to access attributes in HSCRIPT?) ch is for referencing a channel (i.e. a parameter of something from the GUI?) (is this HSCRIPT? or PYTHON?) I'm still not sure what op or ` (backtick) are for or when to use them. What I'm after is a very short (hopefully not more than a few sentences per item) summary of what each of these things are, and in what context we are supposed to use them. Also, what is the context of what we enter into textfields? E.g. when I write sin($T) into the position of an object. Is this HSCRIPT? or Python? Or is that a Houdini Expression which is a whole other context separate to HSCRIPT? cheers,
  19. Hello, I'm using Hscript for some paths in Houdini and some of the global variables on windows are coming in as Backslashes \ and for some uses I need them as Forwardslashes / in Houdini and \ backslashes outside of Houdini. Is there a way to change the forward slash to a back slash? Unfortunately backslash is an escape character... http://www.sidefx.com/docs/houdini13.0/commands/_guide#idm47064707811440 Example C:\Windows needs to be C:/Windows As silly as this is in order to convert the other way this is the method i have, but doesn't work in the reverse `strreplace(strreplace("C:\Windows","/","\ ")," ","")` Thanks -Ben Edit: mistyped forward instead of back
  20. Hi, a scripting question: On SOP level, object-merging an obj level object(say a camera).. then in another node want to refer to the camera's aperture.. What is the way to do that? (Indirectly refer to a parameter in hscript) something like this: (but this doesnt work `ch("../object_merge3/objpath1")/aperture` thanks! Alex (below works with detail params in attribcreate, but is there a more streamlined way?) attribcreate1: aperturePath = `chs("../object_merge3/objpath1")`/aperture attribcreate2: aperture = $APERTUREPATH
  21. Python Take List

    I want, with given the parent take name to get a list of all take children in Python? The Hscript command is: http://www.sidefx.co...ommands/takels but unfortunately python version is not yet implemented. What I want to do is easier for me in python. I could use hou.script("takels") but the result is not clean. example: (' 1\n 2\n 3\n 4\n 5\n 6\n', '') [/CODE] Let me explain what I am after. I am building a tool where I want the user to be able to have a parent take and then a list of children with different values on the tool. Then on the DA he will have to select the parent take and hit render. Pseudocode: [CODE] parent = "mainTake" children = hou.script("takels -p mainTake") for each children: create a geoRop and set take parameter end forloop. link all geoRops to a mergeRop [/CODE] Any idea how to do that? The most tricky part for me is how to get children takes in an array.
  22. Hi there, has python more or less replaced hscript? I know some things are easier to do with one or the other, So I guess I'm just asking where people are mostly using what? In the docs, it states "HOM replaces the functionality of Houdini's previous scripting solutions, the expression language and HScript." is this true? I mostly find hscript in sample scenes I download from odforce. Sorry if this is a silly question, but I'm still green to all this Thanks!
  23. I want changing defaults when I click some shelf icons. python's parameter object has reverting default method, but hasn't set default method. hscript side, I don't know where to dig. please, help.