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


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

  1. Hey guys (and gals)! I'm working on a small project to simulate max style auto backups for Houdini wrapped up in an HDA. For this HDA I have a few functions in the python module that need to be able to read the values of the parameters of the HDA, like a string field where the user can say where to place the auto backups, determine the auto save intervals etc. However I am having some issues reading the parm values. So far I've been trying the normal method of first getting a referance to the node itself and then running: node = hou.node('.') node.parm('parmname').eval() However this is proving to be very unreliable, whenever I save and match definition the hda this approach no longer seems to work and I immediately get errors indicating that the first line trying to get a reference to the node returns none/NoneType. I have even tried to define it with a full path to the node like such: node = hou.node('/obj/autosaver1') But it still seems to encounter the same issue. I have seen some mentions of other methods but I am not really sure I fully get how they work. Any advice on the best and most reliable approach to getting the values from the different parameters of an HDA from within the python module? Thanks for the read! Stay safe out there!
  2. Python - Select Folder?

    Hi! I'm writing a shelf tool that allows users on Linux to search a directory and its sub-directories for a certain file-type / keyword. To do this I've used a readMultiInput like below - start_popup = hou.ui.readMultiInput(start_message, ("Path to Search", "File to Look For"), initial_contents=(home_dir, ".exr"), title="File Finder", buttons=('OK', 'Cancel'), default_choice=0, close_choice=1) In this version of the script, users need to manually type in / paste the directory they want to search, but I'd like for there to be a pop-up dialog allowing users to select a folder, the same way hou.ui.selectFile() allows you to select a file. Is there a way to do this?
  3. hotkey combined with ctrl

    hi - while writing a python script i run into a problem: with kwargs['shiftclick'] I can recognize if a shelf tool was activated by clicking in combination with the ctrl key - so by clicking on it in the shelf tool but is there a way to recognize if the script was activated by ctrl and its HOTKEY? thank you for any information about that!
  4. Hi guys, I'm currently experimenting with packages for setting up Houdini's environment variables. Is there a way to update the HOUDINI_PACKAGE_DIR while Houdini is already open or do the packages only get scanned during startup? It looks like the packages don't get processed if I just change the HOUDINI_PACKAGE_DIR from inside Houdini via hou.putenv() or hou.hscript('setenv …'). What I'm practically trying to do: I'd like to switch project specific packages with the corresponding env variables being updated when the user opens a file that's located in another project. I also actually don't want to relaunch Houdini. I guess another more basic way would be to just set all the variables being inside the package manually in the 456.py?! Thanks for your help! Michael
  5. Hi everyone, I'm very new to hscript and python, I just started learning it very recently. I'm trying to add a Pre-Render Script in a rop geometry output in Python. I could do it with hscript with: opparm -C /obj/geo1/ray1 method project I'm trying to find a command that would do the same thing with opparm -C in Python. So far, i only found .pressButton(), which isn't exactly what I need. Please help and thank you very much in advance. Phiphat
  6. Hi folks, I am actually coding some basic operators like divergence, gradient in vex and python to demistify them and wanted to share the file with you. Feel free to update or correct the file since i might not be sure of some operators. it contains : - Divergence (voxel and points) - Gradient (voxel and points) - Curl (voxel) : the curl seems to not have the same order as vdb curl so still in wip - Laplacian (voxel) : The computed laplacian is somehow less precise than vdb laplacian - Covariance matrix and eigen vectors (points) : It works but the scale is normalize - Laplacian matrix of a mesh (python) - Bernstein polynomials basic_operators_001.hiplc
  7. Python 3

    Is there any way to use python 3 in Houdini. I tried to use different packages in Houdini, for example, the discord API. All my python scrips work fine on their own. But if I try to use them in Houdini, I get a lot of errors. I assume it happens because of oft pyhon2.7. But I'm not 100% sure cause I'm quite new to python in Houdini. Hope anybody can give me some advice
  8. Hi, Is it possible to set up the normals of these points procedurally using vex or python? I just set point attribute to every point with vex, but could I make it more procedural if I had more or less points, for example?
  9. Hi people, I had some code which I was running to find the rendered image in the "Render View" pane and save it to file. _desktop = hou.ui.curDesktop() _ipr = _desktop.paneTabOfType(hou.paneTabType.IPRViewer) _ipr.saveFrame(_file) This was running fine in Houdini 17. However, since updating to Houdini 18 (I'm using 18.0.440), the desktop object seems like it can't find the IPR pane, the paneTabOfType method is returning None. Anyone have any ideas what I can do to get this working? Thanks, Henry
  10. Hi all; I seem to be having a strange issue where I create a button on a null that is suppose to be a control system for a paint node; however, the button does not select the paint node. I have tried to use callback scripts by using a function like hou.cd("../path to the node") however I'm not getting any results and the button is not activating I'm not sure what is happening?. I appreciate all help anyone has to offer & I'm going to link the file that is isolating the issue underneath if anyone would like to take a look at it thanks. Kind Regards Rusty.M A simplified HIP file version of the same issue: cd_Button.hipnc
  11. Hi. I want to select all the parent nodes of the selected node. For example, if you select null3 and click the Python shelf, the parent node null2 is selected, and if you press the Python shelf again, the parent node above it is selected, and all the parent nodes are selected. Please refer to the image. Please check my script. Thank you. node = hou.selectedNodes()[0] b= node.inputs()[0] b.setSelected(True)
  12. Hi. Is there any python code to move the node with the arrow keys? Or have you seen it? I am wordering if i can move the node with the arrow keys. Please share any way you know. Thank you.
  13. Hi, Can a viewport (presp) transformation be stored and later restored back again. I was searching for the memory toolbars in python but I could not find. Thanks G
  14. Modeler 2020

    Product link: https://gum.co/KYCgR What's new: 1. The Modeler core has been completely rewritten. Performance, stability and UX are improved. 2. A hotkey system has been created. Hotkeys are now configured in a separate editor (Hotkeys shelf tool). The editor allows you to quickly configure keyboard and mouse shortcuts. Unlike other modeling programs, you can now associate any tool with any combination of keys or mouse actions. In a similar way, the mouse and keyboard are configured in Nevercenter Silo, but unlike Silo, there are no restrictions here. That is, you can assign absolutely any tool to the mouse. On the other hand, mouse tools such as interactive selection can also be assigned to keyboard shortcuts. Also, unlike the standard Houdini behavior in Modeler, you can use the additional two mouse keys X1 and X2 (Ctrl+X1, Shift+Ctrl+X2 etc). The Hotkeys editor has two default mouse layouts: 1. Standard - that works just like DM and the previous Modeler version - LMB to select items and MMB to drag them 2. Pro - which allows us to select geometry components with RMB and drag with LMB. MMB used to select invisible items too. 3. The interactive state system (add-on for Python States) has been rewritten from scratch. Many tools have become more interactive and have the ability to customize the node in the viewport. In addition, you can quickly create custom interactive python tools for your own HDAs. The mouse wheel now works more universally. In many nodes, the wheel allows you to change the Uniform Scale parameter. List of nodes that now use state tools: Soft Boolean, Insert Mesh, QPrimitive, Array, Hose, Bevel, Extrude, Bridge, Set Flow, Smooth Points, Thickness, View Deform. 4. Retopology tools (Topo category) have been redesigned. TopoDraw tool (Alt+A) allows you to quickly draw poly patches on the reference geometry. It has an ability to snap to existing geometry. Topo mode (Alt+T) now packs the reference model. This speeds up the entire process of retopology with millions of faces. The Push tool now works in the Topo mode, which allows you to get the desired result even faster. In addition, the Push tool has improved performance and stability. 5. The Insert Mesh SOP was redone from scratch. It has interactive tuning, better performance, and more accurate results thanks to improved normals. 6. The Deform menu was merged with the Align menu and renamed to Transform Menu (Z). 7. The Relax tool renamed to Smooth. The tool is completely redesigned and takes advantage of Python States. Using the Smooth tool, you can smooth points or polygons in a standard way. On the other hand, the edges are smoothed as separate curves. Combined with interactive enhancements, the tool allows you to quickly fix messy areas. 8. Tools that create modeling nodes were removed from the Modeler shelf. Only general tools are now on the shelf. Direct modeling tools are now called from the Modeler mode. Added shelf tools: Delete Node, Merge Nodes, Stash History, Pack History, Clean History и Delete Attribs 9. Added a new tool Repeat Node Parms that allows you to apply settings from previously created nodes of the current tree 10. ToolsPanel (spacebar) renamed to Launcher. Launcher tools have been re-sorted and have a new Mouse section for interactive tools like selection or dragging 11. For Bevel, Bridge, Extrude and Smooth tools separate nodes were created 12. Bevel, Extrude, Inset, Smooth, Thickness hotkeys can work as sticky keys. That is, the call of a hotkey, for example, of the Extrude tool, leads to an instant change of the extrusion value before releasing the key. 13. Added Inset tool that uses Extrude SOP. In contrast to the Extrude tool, the first time you start Inset, you can change the inset with LMB. 14. The Lattice tool removed. It is now replaced by improved View 4 and View 9 (View Deform) from the Transform menu (Z) 15. Tools for a quick preview of the subdivided geometry were created: Preview Subdivide (Alt+1) и Preview Subdivide Wire (Alt+2). Standard viewport subdivision and instance subdivision (Symmetrize Tool) ar assigned to Alt+3 и Alt+4 respectivelly. 16. Select By Normals mode (6) allows you to select components based on normals 17. Local transformation tools have been added to the Transform menu: Local Move, Local Rotate и Local Scale 18. An Extend (Y) tool. This add-on to the Extrude tool allows you to quickly extrude edges and polygons using handles. 19. The Bridge Connected tool returned from the DM package 20. Slice, Clip and Mirror tools have the ability to set the initial origin based on points selection center 21. On the next call, the Delete tool changes the node so that it deletes unselected geometry. 22. The KitBash tool now offers to automatically create a KitBash panel if it is not created 23. Shift+Double Click can now replace the geometry of the current Insert Mesh SOP with the geometry from the KitBash panel 24. Combine and Boolean now offer to select nodes at the object level if the tool was launched inside the SOP container 25. Set Flow creates more accurate geometry in unusual situations. 26. Added a Point Weld tool (Alt+W) for interactive point stitching 27. The Soft Boolean SOP can be configured interactively. It also has a slightly improved performance. 28. Collapse History (Left) renamed to Pack History 29. Many tools are assigned to new hotkeys. The ToggleCompass tool is now called with the Backspace key. 30. The Edit Mesh shelf tool now renamed to Modeler 31. Modeler now moved to the package Houdini system instead of using houdini.env
  15. Hi, I'm new here and new to Houdini so my question may be dumb. I'm building my digital assets using some python scripts and so far everything is going pretty well. However, I can't find a way to specify the "Maximum Outputs" number of my (LOP) digital asset, using the API. In fact, I'd like to see no output at all, similar to a rop_geometry SOP or a usd_rop LOP. The minimum and maximum number of inputs are easily customizable, but not the maximum number of outputs, which however is accessible in the "Basic" tab of the "Operator type properties" window. I also did some research on the HDASection and HDAOptions side, without success. Maybe I missed something. Any ideas? Thanks
  16. A python newbie here... I'm working on a small script to make a certain workflow of swapping operator paths for filters a bit less clunky in the context of rendering (with Renderman in this case). The idea: 1. Click a button (New Filter) to create a new filter node in the shop context - I got this working. 2. That will add a multiparm toggle+operator path. Set the operator path to the newly created filter. - Also done and working. 3. Use toggles to set (and swap) Display Filter operator path parm on the ROP node (ris1) - Far from working I suspect this will have to do with ParmTupleChanged events? and here things become very fuzzy... how do I match the toggle to the operator path to evaluate the correct parm (Filter 1/2/3...)? From a tupple? I guess I need to def a function for that. But how do I prevent more tan 1 toggle be on at a time... I'm totally stuck. I hope that makes sence and if anyone could point me in the right direction, that'd be awesome!
  17. PythonLoader

    Hey guys, Here's my first HDA : the PythonLoader. It's a python sop node which you can use to write, save, load and execute script within Houdini. It can be very useful to test script for future shelf tools, iterate through similar nodes, load multiple files... all kind of python operation we can make in Houdini. You can save those scripts to re-use them later, modify them or even share ! Tested and working on Houdini 18, let me know if you encounter any problem with another os or Houdini version ! It's free and you can get it here : https://gumroad.com/l/UnmRE Cheers,
  18. Hi, Can It be possible to modify a Digitial Asset Parameter's Menu Script by Python ? I use a similar code like this to modify the callbacks , but I could not figure out with menu script.. if not script == None: pt.setScriptCallback( script) pt.setScriptCallbackLanguage(hou.scriptLanguage.Python) elif not replace_in_script == None: replace_what = replace_in_script.split('|')[0] replace_to = replace_in_script.split('|')[1] pt.setScriptCallback( pt.scriptCallback().replace( replace_what, replace_to)) pt.setScriptCallbackLanguage(hou.scriptLanguage.Python) ptg.replace( parm, pt) if not node.type().definition(): node.setParmTemplateGroup(ptg) else: ptg = node.type().definition().setParmTemplateGroup(ptg) Any Help is Wellcome!! Cheers, G
  19. Hi, I'd like to execute a shelf button from python? Is this possible?
  20. Python drag and drop

    Hi. I would like to know the difference between using Python in the Python panel and the Houdini shelf tool. For example, I'm trying to use the drag and drop feature, but it doesn't work with the Houdini shelf tool. However, it is used in the Python panel. Is there a way to use drag and drop in the Houdini shelf tool? What I want is to drag and drop the node and enter the path in the blank. Thank you.
  21. Embed Texture in FBX

    Hey guys, I am trying to create a workflow with which it is possible to embed texture image files in a FBX. I know that I will probably have to write a python script to do so. Maybe one of you has already done anything like that and could help me out? Regards, Emil
  22. 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.
  23. Executing hda python script every frame

    Hi there, I'm in the process of setting up a little viewport comment hda. All it does is changing the vcomment parameter on a selected camera. This works great for static text and variables but I haven't found a clean solution for time-dependent stuff such as $F. Since the hda python module doesn't execute every frame, I'm using a script SOP inside the hda which calls the phm function that updates the text every frame. The problem is, that this results in the HDA function executing last. So when doing flipbooks for instance, the image will be rendered before the hda function executes, thus the text lags behind by one frame ($F will show "1001" on frame 1002). Part of the problem is (I think) that the string is being evaluated inside the HDA. So the actual vcomment parm on the camera will already be "1001" instead of "$F" (which would probably evaluate correctly every frame). So if I could prevent the string from evaluating on the HDA, that would probably solve the issue. I'll try the same thing with a Python SOP instead of on the HDA's python module, but in the meantime, maybe someone has a better solution for this problem.
  24. Read backtick ` as string (Python)

    Hey guys, I'm writing a bunch of tools and I faced a problem : I don't know how to evaluate a backtick as a string with Python. I want to write this as the path : `opinputpath("/path/to/my/object", 0)` But I don't know how to evaluate the backticks as strings, so if anyone has an answer.. Cheers,
  25. Hi. I tried that way but got an error. error - 'NoneType' object has no attribute 'hdaModule" I created a new edit in the shelf tool and entered in, but it doesn't run. Why is that? (I want to load dop io preset. I want to change the preset when I click the shelf tool.) Thank you.