Jump to content

Search the Community

Showing results for tags 'python'.



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
    • 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 218 results

  1. Quick question, How do I go about creating a colour parameter on a node? There doesn't seem to be a ParmTemplate for it and there's no documentation on this type of parameter for what I can find.
  2. Rotate cameras from vector list to degrees

    I have read lots of camera angles from a text file, and try to convert them from vectors to degrees: rot_list = rots.split() # ['0.768704', '-0.628123', '-0.120648'] rot_deg = hou.Vector3.angleTo(rot_list) node_camera.parmTuple('r').set(rot_deg) It throws an error: unbound method angleTo() must be called with Vector3 instance as first argument (got str instance instead)
  3. Hey guys, I was wondering if anybody is familiar with using the hou.node.setDeleteScript() method. In the docs, the language arg is set to Python: setDeleteScript(script_text, language=hou.scriptLanguage.Python) But when running the following code, I get an error n = hou.node('/obj/geo1') cmd = 'x = 5; print x' n.setDeleteScript(cmd) OperationFailed: The attempted operation failed. Python is not yet supported in deletion scripts. Just passing an empty string gives the same error. When trying to set the language flag to Hscript with n.setDeleteScript('setenv x = "hello"', language=hou.scriptLanguage.Hscript) It raises another error TypeError: setDeleteScript() got an unexpected keyword argument 'language' Is there something I'm missing? I would normally create an HDA and use the built in 'On Deleted' call and run my code there, but for this particular case I'm unable to use an HDA. I was able to find this function all the way back in the Houdini 12 docs. Is it still not usable? Thanks!
  4. Turn selected folder into an absolute path

    I am building a shelf tool that imports all *.PLY-files from a folder. It works, just how can I convert this into an absolute path? hipdir = os.environ["HIP"] folder = hou.ui.selectFile(title="Choose directory:", file_type=hou.fileType.Directory)
  5. Hey everyone, I just released my Pipeline called Prism, which I developed over the last few years. Prism is an artist-friendly Pipeline, mainly for animation and VFX projects, but it can help anyone who works within the CG industry. Prism does not only manage your scenefiles, exports and imports, but it also takes care of your playblasts, renderings and more. Prism works with many industry standard tools out of the box. This includes Houdini, Maya, 3ds Max, Blender and Nuke. And finally, Prism is free to use! Here is a short introduction video of Prism: https://vimeo.com/265003976 You can download it for free on the website: https://prism-pipeline.com/
  6. I'm using a userSetup.py script to do some setup in Maya during launch. However, some things are not happening as expected, and I can't seem to find the output of Maya's stdout during startup to debug. For example, if I put the line print "Testing stuff..." into userSetup.py, I cannot find where it gets printed. It does not show up in the Script Editor after Maya launches, it does not get written to the shell if I launch Maya via cmd prompt > maya.exe, and it does not get written out to the output file if I set MAYA_CMD_FILE_OUTPUT in my Maya.env Where can I find the stdout from Maya's startup process??
  7. HOUDINI_USER_PREF_DIR

    Afternoon all, I've come across this a problem a few times and never managed to get my head around it properly. Hopefully someone can give me a better understanding of how to do this. Ideally I'd like to have a collection/package of otls, scripts/modules, icons etc that equate to a toolset. I would like to be able to keep these separated from the houdini install and user prefs and just be able to 'plug them in' to houdini - ideally only changing a line or two in the houdini.env file. If I put all the bits and bobs in the correct locations in 'C:/users/garf/MyDocuments/houdini16.0' then it all works fine - it picks up the modules, connects the icons etc 'C:/Users/garf/Documents/houdini16.0/python2.7libs' 'C:/Users/garf/Documents/houdini16.0/config/Icons' 'C:/Users/garf/Documents/houdini16.0/shelves' However I want these to be in a separate package somewhere like this: 'C:/users/garf/Documents/MyExtraToolSet/houdini16.0/python2.7libs' 'C:/users/garf/Documents/MyExtraToolSet/houdini16.0/config/Icons' 'C:/users/garf/Documents/MyExtraToolSet/houdini16.0/shelves' in addition I've tried changing my HOUDINI_USER_PREF_DIR variable with the houdini.env file HOUDINI_USER_PREF_DIR=C:/users/garf/Documents/MyExtraToolSet/houdini__HVER__ but when I hconfig HOUDINI_USER_PREF_DIR in the shell, it still says 'C:/Users/garf/Documents/houdini16.0/' and nothing links up Any pointers appreciated. Cheers
  8. Set parameters by clicking buttons

    Hi, I would like to overwrite values of a parameter field by clicking on a button (see image). Thank you!
  9. EXR meta data issues

    Hi there, I'm trying to set custom data as meta data using the mantra render attribute: "vm_image_exr_attributes" according to the docs i should be able to parse the attribute a python dictionary object, however whenever I try to do this: test_dict = {"count" : 0, "path" : "/jobs/"} my_node.parm("vm_image_exr_attributes").set(test_dict) I get the following error: TypeError: in method 'Parm_set', argument 2 of type 'std::map<std::string,std::string,std::less<std::string >,std::allocator<std::pair<std::string const,std::string > > > const &' What I am trying to achieve is a dictionary comprised of file paths that I can then check in nuke. Can anyone shed any light on this? thanks
  10. Hi guys, I'm having some trouble using bone length for squash and stretch as its giving me crazy deformations that I cant fix. (see attached file) if anyone knows how I can solve this, it would be much appreciated. Also, the other problem is, how would I implement volume preservation with the squashing and stretching? In maya, we would use the joint scale but Houdini seems to give weird results if I scale bones. Any help is much appreciated. Thanks. rigging_bone_stretchy_problem_01.hip
  11. Hi guys, I'm having some trouble using bone length for squash and stretch as its giving me crazy deformations that I cant fix. (see attached file) if anyone knows how I can solve this, it would be much appreciated. Also, the other problem is, how would I implement volume preservation with the squashing and stretching? In maya, we would use the joint scale but Houdini seems to give weird results if I scale bones. Any help is much appreciated. Thanks. rigging_bone_stretchy_problem_01.hip
  12. Batch opening and saving *.obj files

    How do I batch open randomly named OBJ-files from a folder on my harddisk and how can I batch save those in a different folder while keeping their file names?
  13. How to filter node.children() output so it will return nodes only of the specified type (vopsurface, for example) Currently, I do it with a procedure: def extractVop(listOfChildrens): for node in listOfChildrens: if node.type().name() == 'vopsurface': return node But probably there is more elegant way like node.children().type('vopsurface')
  14. I'm trying to create a shelf tool that needs to select a single primitive in the scene. If I activate my shelf tool while I'm already in primitive selection mode, it works, but I'd like to force the selection method to use primitive selection. I've tried looking at the documentation for sceneViewer: http://www.sidefx.com/docs/houdini/hom/hou/SceneViewer.html I think the key might be the setPickGeometryType function, but the documentation doesn't have a good indication of what I should feed it. Has anyone worked with these view options before? Any help is much appreciated
  15. Python Question

    Hi big friends, i have a little question for you it about python function 'hou.node.children()' that's returning always like this (<hou.SopNode of type sphere at /obj/geo1/subnet1/sphere1>,..) it's seems like used absolute path for searching node look to me... wonder how get relative path node not used absolute path. like (<hou.SopNode of type sphere at ./subnet1/sphere1.>,..) (when if current node is '/obj/geo1') have a any idea?
  16. Hi there, I have a python script which traverses a subnetworks GEO nodes and adds a new node (which is a HDA) via createOutputNode. The added node itself is bypassed, so it should not cook (yet). The problem I'm having is that the creation of the HDA nodes takes 0.5 seconds each and the subnetwork (created from a CAD file in another step before) can have several thousand GEO nodes. This results in extreme loading times and very slugish UI performance even with 64 GB of memory. If I leave out the creation of the HDA at each GEO node of the subnetwork, the issues with performance and crashiness are gone. (Please note, that the HDA node is bypassed in the above case and will not cook). The reason why I'm adding the HDA into the GEO nodes of the subnetwork is that I need to export the subnetwork later on via a FBX ROP for example with all the NULL nodes (e.g. transform hierarchy) still intact. Adding the HDA at the "end" of the GEOs node pipeline allows me to do this. Basically the HDA processed incoming geo and adds UVs, polyreduces and bakes textures for the individual GEO nodes of the network. I already tried to rewrite/rewire the HDA to be able to iterate over primitive attributes such as "path" and have the whole content of the subnetwork processed from a single HDA instance. This works, but I'm loosing the link to the subnetwork and have to write out many individual FBX files etc. Now my question: Is it possible to speed up the creation of the HDA node somehow? I already tried setting the updatemode to manual, which did not change the creation time. Copying instead of creating maybe?
  17. Create a reference copy in python

    Hi, Does anyone know the python to create a reference copy of a node? Cheers Simon
  18. NetworkImage

    Hello everyone, I'm trying to make a screenShot script with python that load my image in the network view Well everything goes well until the end of the script: editor = hou.ui.paneTabOfType(hou.paneTabType.NetworkEditor) image = hou.NetworkImage() image.setPath('$HFS/houdini/pic/Mandril.pic') image.setRect(hou.BoundingRect(0, 0, 5, 5)) editor.setBackgroundImages([image]) I found this piece of code in the houdini documentation. The problem is when navigate from /obj/geo to /obj and go back to /obj/geo the image is gone. is anybody has an idea ? Thanks ! here is my full script: def screenShot(): """take a screen shot of the current viewport at the current frame""" help(screenShot) import hou import toolutils import os #selected node nodeSelect = hou.selectedNodes() path = hou.expandString("$HIP") frame = hou.expandString("$F") frame = int(frame) black=hou.Color((0,0,0)) #name check there is a node selected if len(nodeSelect)<1: print ("!!! error: select a node !!!") else: for node in nodeSelect: name = node.name() node.setColor(black) #Get the current Desktop desktop = hou.ui.curDesktop() # Get the scene viewer scene= toolutils.sceneViewer() flipbook_options = scene.flipbookSettings().stash() # set frame range flipbook_options.frameRange((frame,frame)) #set output path root ="{1}/{2}/{0}/".format(name,path,"screenShot") if os.path.exists(root): listPath = os.listdir(root) inc = len(listPath) inc = int(inc) outputPath = "{}{}.{:04d}.jpg".format(root,name,inc) else: os.makedirs(root) inc = 0 outputPath = "{}{}.{:04d}.jpg".format(root,name,inc) #set flipbook current path flipbook_options.output(outputPath) #run flipbook scene.flipbook(scene.curViewport(),flipbook_options) # reload image print (outputPath) editor = hou.ui.paneTabOfType(hou.paneTabType.NetworkEditor) image = hou.NetworkImage() image.setPath(outputPath) image.setRect(hou.BoundingRect(0, 0, 5, 5)) image.setRelativeToPath(node.path()) editor.setBackgroundImages([image])
  19. How to import obj with python?

    I'm trying to script a multiple obj importer, could someone tell me how to do a basic obj importer equivalent to the "File" SOP... Here's what I have so far.... node = hou.pwd() geo = node.geometry() import os import numpy as np folder = r"PATH TO FOLDER WITH OBJ's " models = [f for f in os.listdir(folder) if f.endswith('.obj')] rand = np.random.randint(0,len(models)) path =os.path.join(folder, models[rand]) print os.path.join(folder, models[rand]) obj = hou.node(path) obj.createNode("geo")
  20. Does anyone know of a way to enable this checkbox via python?
  21. How do I create a button for the undo command?

    Hello Everyone. How do I create a button for the undo command? Using a Python Script and hou.undos.performUndo() Note: On Python Source Editor the code work, but on Script Shelf not. error msg <Cannot undo within an undo group> How use hou.UndosGroup https://www.sidefx.com/docs/houdini/hom/hou/undos.html VideoCase https://drive.google.com/file/d/1-m38aiA50QPuSs75Pe9kiVOs7nMbg3XY/view
  22. Buying : https://gumroad.com/l/FqhftThis tool is inspired by a tutorial of Introduction to FX in Houdini.It was released by Saber Jlassi.This tool can automatically cache and read files,you don't have to set up any path,I've set up the caching and reading paths for you.You just need to save your hip to a directory.The other will be set automatically.Finally, I hope you like it!
  23. Houdini Python Cache and Read Tool

    Buying : https://gumroad.com/l/FqhftThis tool is inspired by a tutorial of Introduction to FX in Houdini.It was released by Saber Jlassi.This tool can automatically cache and read files,you don't have to set up any path,I've set up the caching and reading paths for you.You just need to save your hip to a directory.The other will be set automatically.Finally, I hope you like it!
  24. new parmTemplateGroup

    i am creating a new HDA with python and unfurtunally doesnt use the parms that are in the subnet, so how can i create a blank new parmTemplate so later on i can add the spare parameters to it? thanks guys.
  25. Hello, What's the class to create an "Operator Path" parameter in python? group.addParmTemplate(hou.FloatParmTemplate("myparam", "My Param", 1)) will create a float type parameter What would create an Operator Path parameter?
×