Jump to content

Search the Community

Showing results for tags 'script'.



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 38 results

  1. I have an HDA with a parameter that allows users to return a selection from the viewport (same type of parameter used on blast nodes etc.). I have a callback script that I want to run whenever the artist makes a selection, however, the script only seems to execute when the string portion of the parameter is edited. For example if I manually type the name of an object into the parameter the callback script executes as expected, but if I use the arrow button to select the objects in the viewport and hit enter to confirm my selection the callback script is not executed. This obviously isn't very useful or intuitive for artists. Does anyone have any workarounds or suggestions on how to get this functioning the way one would expect it to?
  2. How could i add a sop to every geometry node inside a subnet with a complex hierarchy (multiple subnet inside subnet inside subnet etc...talking about non repeating pattern ) Merging everything inside a single geometry to cook my modification is not an option here as i really need to keep my hierarchy paths intact for multiple software workflow and rendering purpose. Scripting looks like the way to go but i m not comfortable enough with it. Any idea how to tackle this specific problem ? Hscript ? Python ? In others words : /// For each geometry node inside a subnet. Add a specific Sop inside geometry nodes. Connect this new sop to the last existing sop . Set the display flag to this new node. Joy. // Thanks for your help.
  3. Hi there, I have been making a HDA that contains a python script in the 'python module' section. The goal is to wire multiple mantra nodes into this single HDA and then correctly generate multiple setups inside the HDA that configure the rendering setup to be handled by our farm running Afanacy. The tool is working pretty nicely on its own, but once I put multiple nodes in the OUT network and generate a second one it also affects the other nodes. I thought this was because I had global variables in my python script, so I got rid of them and made a 'dataObject' class that is generated on the single nodes and passed down to all functions. however, this did not solve the issue. I figure it has something to do with scope but can't figure out what it is. I'll put the code down here below. Feel free to give any tips, I don't have much experience with Houdini python in particular. import hou import os import re from os import path alphabet = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] class dataObject: renderasset = hou.Node base_ifd_generator = hou.Node base_distributed_renderer = hou.Node base_afanacy_merger = hou.Node master_merger = hou.Node mantra_duplicates = [] # List of all mantra nodes that will be compied from inputs. Ordered by input index ifd_generators = [] # List of all Afanacy nodes that are configured as IFD generators distributed_renderers = [] # List of all afanacy nodes that are configured as renderers afanacy_mergers = [] # List of all afanacy nodes that are only used for merging the different stages. def reset(data): for mantra in data.mantra_duplicates: mantra.destroy() for ifd in data.ifd_generators: ifd.destroy() for renderer in data.distributed_renderers: renderer.destroy() for merger in data.afanacy_mergers: merger.destroy() del data.mantra_duplicates[:] del data.ifd_generators[:] del data.distributed_renderers[:] del data.afanacy_mergers[:] def getOptions(data): autoversioning = data.renderasset.parm('autoversion').eval() print("automatic versioning set to; " + str(autoversioning)) def generate(thisnode): data = dataObject() data.renderasset = hou.node(thisnode.path()) print(data.renderasset.name()) data.base_ifd_generator = hou.node(thisnode.path()).glob("ifd_generator_SETUP") data.base_distributed_renderer = hou.node(thisnode.path()).glob("distributed_renderer_SETUP") data.base_afanacy_merger = hou.node(thisnode.path()).glob("afanasy_merge_SETUP") data.master_merger = hou.node(thisnode.path()).glob("*MASTER_MERGE*") reset(data) getOptions(data) configureRenderers(data) print("Internal network for node '" + data.renderasset.name() + "' has been generated.") def submit(): getOptions() size = len(data.mantra_duplicates) if size < 1: print("WARNING: render asset should first generate an internal network before submitting.") else: checkVersions() data.master_merger[0].parm('submit').pressButton() def configureRenderers(data): data.master_merger[0].setParms({ "job_name" : data.renderasset.parm('jobname').eval() }) inputs = data.renderasset.inputs() print("name: " + str(data.renderasset.name())) for idx,value in enumerate(inputs): configureRenderSetup(data,idx, value) connectRenderSetup(data,idx) setIfdSettings(data,idx) setRendererSettings(data,idx) setMergerSettings(data,idx) layoutNetwork(data,idx) connectMasterRenderer(data) data.renderasset.layoutChildren() def computeVersion(outputPath, patternName): if path.exists(outputPath): ifd_directories = os.listdir(outputPath) pattern = re.compile(patternName) version = 0 for dir in ifd_directories: if pattern.search(dir): version += 1 return alphabet[version] def checkVersions(data): for idx, mantra in enumerate(data.mantra_duplicates): render_version = computeVersion(data.renderasset.parm('renderroot').eval(), data.renderasset.inputs()[idx].name()) ifd_version = render_version ifd_destination = data.renderasset.parm('ifdroot').eval() + "/" + "ifd_" + data.renderasset.inputs()[idx].name() + "_" + ifd_version + "/" + data.renderasset.inputs()[idx].name() + "_ifd.$F4.ifd" img_destination = data.renderasset.parm('renderroot').eval() + data.renderasset.inputs()[idx].name() + "_" + render_version + "/" + data.renderasset.inputs()[idx].name() + ".$F4.exr" mantra.setParms( { "soho_diskfile" : ifd_destination, "vm_picture" : img_destination }) def configureRenderSetup(data,inputIndex, node): data.mantra_duplicates.append(node.copyTo(data.renderasset)) data.mantra_duplicates[inputIndex].setName("MantraInput_" + str(inputIndex)) render_version = "_" + str(computeVersion(data.renderasset.parm('renderroot').eval(), data.renderasset.inputs()[inputIndex].name())) ifd_version = render_version ifd_destination = data.renderasset.parm('ifdroot').eval() + "/" + "ifd_" + data.renderasset.inputs()[inputIndex].name() + "/" + data.renderasset.inputs()[inputIndex].name() + "_ifd.$F4.ifd" img_destination = data.renderasset.parm('renderroot').eval() + data.renderasset.inputs()[inputIndex].name() + "/" + data.renderasset.inputs()[inputIndex].name() + ".$F4.exr" if bool(data.renderasset.parm('autoversion').eval()): print("autoversioning") ifd_destination = data.renderasset.parm('ifdroot').eval() + "/" + "ifd_" + data.renderasset.inputs()[inputIndex].name() + ifd_version + "/" + data.renderasset.inputs()[inputIndex].name() + "_ifd.$F4.ifd" img_destination = data.renderasset.parm('renderroot').eval() + data.renderasset.inputs()[inputIndex].name() + render_version + "/" + data.renderasset.inputs()[inputIndex].name() + ".$F4.exr" data.mantra_duplicates[inputIndex].setParms( { "soho_outputmode":1, "soho_diskfile" : ifd_destination, "vm_inlinestorage" : 1, "vm_writecheckpoint" : 0, "vm_picture" : img_destination }) data.ifd_generators.append(data.base_ifd_generator[0].copyTo(data.renderasset)) data.distributed_renderers.append(data.base_distributed_renderer[0].copyTo(data.renderasset)) data.afanacy_mergers.append(data.base_afanacy_merger[0].copyTo(data.renderasset)) def connectRenderSetup(data, inputIndex): data.ifd_generators[inputIndex].setInput(0,data.mantra_duplicates[inputIndex]) data.afanacy_mergers[inputIndex].setInput(0,data.ifd_generators[inputIndex]) data.afanacy_mergers[inputIndex].setInput(1,data.distributed_renderers[inputIndex]) def setIfdSettings(data, inputIndex): data.ifd_generators[inputIndex].setParms( { "f1" : data.mantra_duplicates[inputIndex].parm('f1'), "f2" : data.mantra_duplicates[inputIndex].parm('f2'), "enable_extended_parameters" : 1, "hosts_mask" : data.renderasset.parm('ifdhosts').eval(), "priority" : data.renderasset.parm('priority').eval() }) def setRendererSettings(data, inputIndex): data.distributed_renderers[inputIndex].setParms( { "f1" : data.mantra_duplicates[inputIndex].parm('f1'), "f2" : data.mantra_duplicates[inputIndex].parm('f2'), "cmd_files" : data.mantra_duplicates[inputIndex].parm('soho_diskfile'), "enable_extended_parameters" : 1, "hosts_mask" : data.renderasset.parm('renderhostmask').eval(), "priority" : data.renderasset.parm('priority').eval() }) def setMergerSettings(data, inputIndex): data.afanacy_mergers[inputIndex].setParms( { "f1" : data.mantra_duplicates[inputIndex].parm('f1'), "f2" : data.mantra_duplicates[inputIndex].parm('f2'), "enable_extended_parameters" : 1, "hosts_mask" : data.renderasset.parm('renderhostmask').eval(), "priority" : data.renderasset.parm('priority').eval(), "job_name" : data.renderasset.inputs()[inputIndex].name() + "_afanacy_renderer" }) def layoutNetwork(data, inputIndex): data.mantra_duplicates[inputIndex].moveToGoodPosition() data.renderasset.layoutChildren() def connectMasterRenderer(data): for i,v in enumerate(data.afanacy_mergers): print("i: " + str(i)) print("v: " + str(v.name())) print("mm: " + str(data.master_merger[0].name())) data.master_merger[0].setInput(i,v)
  4. i would like to have a button to trigger a cook from my HDA. How can i go about that? Do i need a python script?
  5. Dear all, Good Evening, So, i was digging into the VEX functions "string" section. And i didn't found any clue to chop a string into an array. string myString = "1234Abc"; The goal will be to get this below : string arrayFromString[] = {"1","2","3","4","A","b","c"}; As well in python it is "native" : myString = "1234Abc" myString[0] would be "1" etc etc.... But to use it in a wrangle i need VEX ....If anybody has a clue . It will be 100% Welcome, as it could be a very simple way to chop and bytecrush long floating numbers. Might it be a NOOB question and i apologize already for that. Thank you a lot, And all the best to everybody with Houdini !!! alr + + +
  6. How to run python script node?

    Hi guys, a noob question here but I cannot continue without this and can't figure it out either. How to run a python node? A guy in tutorial said ctrl+enter but that doesn't work for me and nothing happens in python shell.
  7. i am trying to reproduce a ramp sliding effect from vop to wrangle. I used the vop version for very long without issue,i add a parameter before the ramp to move its position(usually used to slide the ramp across UVs) For some reason it seems i am not reproducing the wrangle the right way. you can see the vop in the pic and my attempt at reproducing it in wrangle. i posted the file. script: float ptnum = (float)@ptnum; float numpt = (float)@numpt; float anim = chf("page_animation"); //slider from -1 to 1 float div = ptnum/numpt; float bend_anim = div+anim; float ramp_bend = chramp("ramp_bend",bend_anim); @bend = fit(ramp_bend,0,1,chf("bend_left"),chf("bend_right"));//slider from -90 to 90 book_odforce.hip
  8. Hi Guys, I have a number of nodes within OBJ level. Could anyone help me out with aligning selected nodes and aranged within Network Box? Python script. Thank you !
  9. Geometry spreadsheet script

    Hi Guys I want to export spreadsheet value to txt file I know how to export to txt file using Python but I don't know what name(?) of parameter spreadsheet. Help me!!
  10. Hi everyone, Maybe the title isn't accurate. Basically, I'm editing the parameter interface of a tool I created, it consists of a main building and a terrace, I want to say to Houdini that I want to keep the maximum value of the slider that controls the number of floors of the terrace always below the value of floors of the main building. Also, if the user tries to give to the terrace a value bigger than the main buildng floors, it has to go back to the value buildingFloors-1 . How can I achieve that? Example: buildingFloors = 7 terraceFloors = 4 if I try to set terraceFloors = 9 it must set itself to terraceFloors = 6
  11. Hi folks, i have a Python Processor with 5 work items and i would like to create a dependencies based on a attribute WorkItemID that increase for each work item. How can i create dependency to cook those work items exactly in the order that i want and not in parallel ? Thanks in advance
  12. At my lovely studio we have a bit of an unfinished Houdini render pipeline. We're able to use the farm to bake out geometry, but only serially. Also, writing out the IFDs is serial. We only have a handful of engine licenses. This is painless for sims, but this is a problem with SOP geo renders that can be baked out in parallel. Mantra renders, however, work in full parallel glory. How can I put an "opparm -c /path/to/ROPoutputdriver execute" script call (or any such code) somewhere where it will execute IN the IFD as it's rendering, but not during IFD generation? I tried putting that code in the Mantra's (set to render nothing) Pre-frame/Post-frame script parameter, but those execute AT IFD generation (which is serial), which doesn't help. Would a Python SOP work? If so how would I trigger it on frame render?
  13. Hi everyone! I'm starting to get into Python 2.7 for Houdini Indie (17.5) before jumping into Houdini 18 with Python 3, and I've been working in a flipbook tool until now everything is being okay but now I've found that I can't recover the camera settings/flipbook settings after generating the MPlay to maintain the user settings after applying the script. I've been trying to use the 'hou.GeometryViewportCamera.stash()' to create a copy of the settings but I'm not sure how to use it and where should I recover these settings. Also when I try to use it I get this error: 'TypeError: unbound method setDefaultCamera() must be called with GeometryViewport instance as first argument (got nothing instead)' I've created a simplified version of the script that I'll be attaching down below: If someone has any advice or idea of how would be the good approaching intro this, I'll bee really thankful. Thanks in advance to everyone.
  14. Hello everyone, I am currently setting up an asset pipeline for a project in houdini. My main question I have is how I handle the versioning of Digital Assets. I prepared an overview where you can see basically the 2 ways I came up with: The One option is the" self contained" one. When ever you want a new version of your asset you: 1.duplicate the subnet where you work in. 2.Then you have "subnet_v002" that gets turned in to a digital asset "asset_v002.hda" with the definition "asset::2.0" Every new version gets its own asset library and in every library there is only ONE definition of an asset as you can see in the picture. This workflow is good if on your drive you only want one .hda file associated with one asset version. The other option is the packed one. Same as the other when ever you want a new version of your asset you: 1.duplicate the subnet where you worked in. 2.But then you don't create a seperate library you only have one library with multiple definitions. One definition for one version. That means if the library asset.hda already exists with the definition asset::1.0 you will append the latest definition asset:2.0 to the library. In this case you have all the definitions packed in to one library. For me this option is a little confusing in that sense that you dont have a file seperation of the different versions and one asset library can become potentially huge in file size. One big point of assets is being able to update the assets in a houdini scene easily without destroying relations to other nodes. No when it comes to that for option "packed" as every version is in the same library you can simply write a script that updates all nodes with the same library to latest definition is that correct? But if i like the file seperation on disk for each new version, HOW would I in option "self contained" update my "asset_v002.hda" with asset::2.0 to "asset_v003.hda" with asset::3.0 as a definitio? All of this should happen kind of automated so I am searching a python way to do this. I would be really interested if anyone has update solution for the option "self contained" and what you generally think which option is the better one to handle digital assets. Thanks a lot Paul
  15. Python export flipbook as mp4

    Hey, I've written a shelf tool to create flipbooks with custom parameters, and I want to know if it's possible to export it as mp4 once it's finished ? I tried with the flipbook_options.output() but it's exporting a video for each frame (so an image sequence), and I don't want to export an image sequence, but directly a video, if it's possible ! Cheers,
  16. Hi all, I recently found this Toolset on Github allowing realtime input & record of input from a leapmotion controller. https://github.com/arqtiq/HouLEAP Unfortunately I'm having a little trouble getting it to run properly. In the readme it explains to 'simply copy the content of the **/houdini16.x** folder to your houdini home/hsite folder.' So my question is, where would be the correct place to place the python scripts that the tool provides? (I'm not entirely sure what the 'hsite' folder is referring to?) Houdini see's the OTL's however i return the attached error in, what i assume, is the python scripting. Or perhaps I need to define LEAP in the .env file? Any tips much appreciated EDIT: The error is reported from the example .hip contained in the Github repository linked in my post. Also This was run in H 17.5.258.
  17. 60% Off VexGuide Tool

    Today Only: 60% Off VexGuide Tool Discount link : https://gum.co/GFKLc/56wn7jx
  18. Houdini Live Link

    HOUDINI LIVE LINK AVAILABLE NOW IN GUMROAD many people have asked me to share live link script now in gumrorad Only priced at $ 7 houdini live conect with windows explorer you can quickly load ton's of model like obj ,bgeo to houdini directly by only one click https://vimeo.com/322629176
  19. 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
  20. Hi Houdniks, could anybody help me out make the grid lines in the network editor be default on Houdini launch? Couldn't find anything about it so far... Thanks in advance
  21. 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?
  22. Hey Guys I wanted to share with you a small script I've done to have a better support or external editors to edit your expressions and code. It works with a system or file watcher, that means it doesn't freeze Houdini and you don't need to close your editor to see you updates It's available by a simple right-click on a parameter => expression => External Expression Editor ( you can set a hotkey ). It works with VEX and Python expressions but also regular HScript expressions ( but with no completion ). It works very well with Visual Studio Code as it has a nice VEX and Python plugins, but it could work with sublime text, notepad ++ etc. ( I haven't tested all the IDE out there so if you find a bug with one of them, feel free to send an email to contact@cgtoolbox.com ). A small video about it: https://vimeo.com/242470411 You can download it for free here: http://cgtoolbox.com/houdini-expression-editor/ PySide, PySide2 and PyQt are supported, it is compatible with Houdini 15 to 16.5.
  23. Hey guys I have an HDA with 2 python SOPs inside. I need a button on the HDA that would trigger a function in one of the python SOPs. I looked at how callback scripts work but it was too confusing. Appreciate it if someone could help me out. Thanks! Cheers defc0n1
  24. Real-time recorder python script

    Hi guys, I am working on a python script that bakes the hand movement of geometry with mouse in the viewport over the time and creates keys on each frame. In other word, I want to move my object with mouse in the view port and get the Transform/Rotation/Scale keyed on each frame. Currently I am using hou.selectedNode() and the hou.parm() to access the specific parameters that I want to bake. Then I use a for loop to generate keyframe on each frame. Immediately after pushing the bake button it bakes the parameters value on the first frame for entire time line. I have tried using while loop with time.sleep() to wait for a bit after setting key on each frame, but it freeze the view port and I cant move my geometry. Is there anyway to make my code somehow that constantly check the new values of object parameters on each frame and allow me to work on the view port while it does its job in the background? Is this related to multi threading? Here is my for loop for f in timeline: setKey = hou.Keyframe() setKey.setFrame(f) setKey.setValue( keyValue[f] ) ParmList.setKeyframe(setKey) hou.setFrame(f) Thanks,
  25. Compile VEX code to VOP network

    Hello guys, I have a question about how to compile my VEX code to a VOP network by VCC complier? I know there is a mode "-m" before, but it isn't work now, How can I do this in Houdini 15.5? yuqing
×