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


Forums

  • General
    • Lounge/General chat
    • Education
    • Jobs
  • Houdini
    • General Houdini Questions
    • Effects
    • Modeling
    • Animation & Rigging
    • Lighting & Rendering
    • Compositing
    • Games
  • 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 14 results

  1. 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
  2. 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)
  3. 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?
  4. 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
  5. 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!
  6. 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)
  7. 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.
  8. 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.
  9. 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,
  10. 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
  11. 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
  12. 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.
  13. 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!
  14. 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.
×