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
    • Marketplace
  • 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 31 results

  1. Hscript importing conundrum

    Hi, my custom script is very simple : start the vexprofile , cook the snippet that holds my vex , stop the vexprofiler and show me the results. If i copy paste every line into the texport myself the code works. Howerver if I import the .cmd file holding the same three lines it shows me a empty vexprofiler. Doesn't importing .cmd files equal to writing them your self? If not is there something else that has this functionality? Why isn't this working? vexprofile start opcook -F /obj/L_System_v2/L-system/attribvop1/snippet1 vexprofile
  2. Hi, I'm playing around with limiting transform handles on nulls to act as a rigging control surface. I found on these forums a cool hscript snippet that allows this: clamp(cubic(),min,max). Does anyone know the python equivalent? The python clamp doesn't seem to accept a cubic() as a parameter. Also, does anyone know of another method of allowing for manual transform handle input that feeds into an expression? (HScript or Python). I can't wrap my head around why cubic() works! Cheers Dan
  3. Hello, I hope somebody can help me out as I have run into a problem when linking ramps via script that I have been unable to solve for more than a week now. What I would like to achieve is exactly the same effect that using "Copy Parameter" / "Paste Relative References" does when doing this from the user interface. I tried both python and hscript. The problem is that once the ramps are linked, when I add new control points to the parent, the child gets the control points but doesn't get the positions (ramp#pos) and values (ramp#value). In python I simply tried to set one float ramp parm to the other like this: hou.parm("/obj/node_B/ramp_B").set(hou.parm("/obj/node_A/ramp_A")) This seemed like the most simple and straightforward way of doing this but it failed so I reported it to the SideFX guys and they confirmed that python is not feature-complete for linking ramps with the .set() command - first they logged it as Bug #97192 then it was reconsidered to be an RFE with the same ID. After this SideFX suggested to use hscript opmultiparm which I proceeded to do but the ramp linking failed this time too. I am fairly confident using python but not so much with hscript so I am hoping it's my inability to use hscript properly this time rather than another bug - this is what I did: opmultiparm /obj/node_B/ 'ramp_B#pos' '/obj/node_A/ramp_A#pos' 'ramp_B#value' '/obj/node_A/ramp_A#value' 'ramp_B#interp' '/obj/node_A/ramp_A#interp' What I noticed in the "Edit Parameters" interface is if I manually type in the path to link the ramps then it does work the same as "Copy Parameter" / "Paste Relative References" - see below. I wonder if this field is exposed to python or hscript somewhere and maybe I should try to set this? Other than the above I also used both opscript and .asCode() after setting up the ramps links manually to see if it gives me the proper code and even if I run the code I get back from these the ramp linking still fails. Has anybody ever found a reliable solution for linking ramps in script? Anybody got any ideas where to go from here?:) EDIT: I found the solution on the SideFX forum by user jsmack in this post: https://www.sidefx.com/forum/topic/59899
  4. Hey guys, How can I change the path in mantra Output file from: P:/projectname/shotname/fx/work/houdini/hip to: V:/projectname/shotname/fx/geo can`t figure out how to run strreplace twice. this doesn`t work: `strreplace($HIP, P:, V:)` `strreplace($HIP, work/houdini/hip, geo)` $HIP is P:/projectname/shotname/fx/work/houdini/hip also + is to add to the path, how can i subtract from the path? Cheers Janis
  5. Hello, I am able to select visible geometry manually, or even make a script to toggle the option to select geometry manually. But I'm wondering if there is a way to automatically select visible geometry only via a script? I have been unable to figure it out but it would be awesome if possible (may not be possible though?). Thanks! Ant
  6. I have a parameter in my node that I want to convert to use python, usually we can right click> expression >change language to python but for some reason is gray out =( and reading documentation I could do parm.setExpression("2+2". language=Something) but I thought using hou.lenguage.Python as argument but wants a value? do we have something like parm.setScriptLenguage? or an easy way to switch all the node to use python, or just that parameter?
  7. Hi all, Is there any equivalent to nprimsgroup in python? I use this hscript expression in a switch, inside a for each SOP, to delete any prims connected to the outside group of a voronoi fracture: if( nprimsgroup( 0,"outside" ) !=0, 1, 0 ) Wondered what the python equivalent would be, because the Python SOP I wrote in its place is much slower to evaluate.
  8. Hscript question... again..

    Hi guys. Quick question.. why is this not working as a position to create a point in an Add node? centroid(`opinputpath(".",0)`,D_X) same for Y and Z Cheers
  9. 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!
  10. 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.
  11. 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.
  12. 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?
  13. 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
  14. 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
  15. Is Geometry Selected???

    Is there any way to verify if some geometry components selected?
  16. 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.
  17. 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.
  18. 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
  19. 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)
  20. 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?
  21. 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
  22. 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!
  23. 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)
  24. 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.
  25. 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.
×