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

  1. Houdini Python Tools

    You can see it here : https://gumroad.com/l/oIDpL
  2. Hi everyone, this is my first time writing tools with python, so maybe I got something completely wrong here. I want to built a HDA to setup the houdini scene by selecting project, sequence and shot number. For that I created a HDA with a ordered menu and a drop down listing all available projects. The menu is created by a python function in the python module and then called in the menu script area. I then have another ordered menu to select from all the available sequences based on the selected project. A callback script on the project drop down is triggering the create menu function for the sequence drop down. I then need to know the currently selected project in the project drop down. I tried getting this information with the node eval parm, but this is only kind of working. It returns the right token, but as an integer and multiple times for each menu item causing a long loop. I also tried using the menu parm template, but I cannot access the data correctly. What would be the best way to geht the menu label as a string for the currently selected item in the drop down menu? Thanks Here is some of the code I used: #ProjectMenuDropDown def projectMenu(): import os projectPath = 'H:/' projectList = os.listdir(projectPath) projectMenu=[] for i, item in enumerate(projectList): projectMenu.append(i) projectMenu.append(item) return projectMenu #Call function in menu script hou.pwd().hdaModule().projectMenu() #Callback function to trigger sequence menu in python module hou.phm().sequenceMenu(kwargs) #SequenceMenuDropDown #SequenceMenu def sequenceMenu(kwargs): import os node = kwargs['node'] projSelect = node.parm('project').eval()
  3. Hi novice Python user trying to get ytini (Houdini for Astronomy http://ytini.com) up and running on my Mac. Followed instructions, using miniconda and then installed the yt package. Confirmed that it is correctly installed. But from within Houdini's Python shell when I try and do an import yt I get a package not found error. I assume my pathing is wrong. The install directions here http://ytini.com/getstarted.html suggest modifying your .bash_profile which I've done after first making necessary changes. But the directions assume there is a yt-conda directory /Users/<userfoo>/yt-conda/bin and also a yt-conda/sbin directory /Users/<userfoo>/yt-conda/sbin but I have neither. Only the following /Users/<userfoo>/miniconda3/bin What changes should I make to my pathing to make Houdini recognize the yt package install? Thanks!
  4. Hi , I am building currently building an HDA with an important interface (lots of tabs and multiParm list inside multiParm list .. ) so I wanted to use python in "Menu Script" to list a string array stored in the detail attribute to populate on of my ordered menu, after I finally got it to work on a null to experiment then I tried to replace my previous ordered menu with manually typed string with the new one using python script and houdini crashes each time I try. What's weird is that I am able to read the channel and access the value with no problem outside the HDA. Does anyone knows why this is happening, am I missing something here ? Edit : It seems that when I try to return the string inside the HDA, it gives me -1, but even if I just print that value, houdini still crashes and why it return that value only inside the HDA ? Also when I enable "Use Menu Item Token as Value" I am able to return the corresponding ID of my selection without crash, but I want the string value of course. The python script I use : node = hou.pwd() geo = node.geometry() menu = [] data_list = geo.stringListAttribValue("data_list") for data in data_list: menu.append(data) menu.append(data) return menu
  5. Flipbook Tool?

    Hello hive mind! I'm looking for a better solution to saving out my flipbooks as .mp4s. Right now I have ffmpeg installed so I can go directly from mplay and save an .mp4, but I cannot figure out how to change the preset for the menu so that the default file name matches my naming convention. Which is really annoying. I'm looking for any of these solutions! 1) Does anyone know how to update this ffmpeg window with a custom string in the "Output File" field? 2) Does anyone know where mplay stores the tmp images, so I could grab them straight from there and go to ffmpeg from a shell? 3) Does anyone have a better solution for flipbooking? Thanks!
  6. Hi all, I'm creating a python panel tool with a web front end. I've successfully put a Qt WebEngineView in a Python panel, but when the panel is hidden and displayed again (ie switching tabs in Houdini UI) the main loop of WebEngineView seems to pause. Any animations stop and all mouse/keyboard interaction stops. If I resize the panel it will recover most of the time. I assume I have to call something on WebEngineView when then the python panel onActivateInterface() is called but I can't see anything obvious in the Qt docs http://doc.qt.io/qt-5/qml-qtwebengine-webengineview.html#WebAction-prop PS: I'm on Win 10. Anyone solved this before? TNKS! G
  7. Hello Hive Mind, Long time reader, first time poster.... I was wondering if anyone knows a pythonic way of creating a reference copy of a node? More or less the equivalent of hscript opcp -c. It's a little more complicated than a copy and iterate over parms, since certain parm types need different copy/reference methods. Thanks in advance!
  8. Hi How do I save out all geometry information to a python numpy .npy file. I'm dabbling with a neural network that takes in a bunch of objs and spits out its so called interpretation..... But as yet I am working with just the points and not the vertices and prim information. How could I save all this information to an array so I could then reload the array back into houdini for houdini to display prims/vertices etc...... Thanks for your help
  9. Hi everyone, We're currently looking for a talented Pipeline TD and Pipeline Assistant to join us at our 80-seat facility in Bournemouth, UK. This is a fantastic opportunity to join a burgeoning pipeline team and make your mark on an exciting young VFX operation. We work across feature film, high-end TV and commercials simultaneously and have recently worked on Jurassic World 2, One Strange Rock, Electric Dreams and 47 Meters Down, to name a few. You'll find the individual job specs at outpostvx.co.uk/careers. CVs to talent@outpostvfx.co.uk please. UK-eligible applicants only. Thanks for reading!
  10. 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.
  11. 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)
  12. 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!
  13. 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)
  14. 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/
  15. 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??
  16. 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
  17. 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!
  18. 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
  19. 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
  20. 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
  21. 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?
  22. 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')
  23. 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
  24. 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?
  25. 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?
×