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

  1. How to add a new path to environment variable? For example, trying to add a new path to the "PATH" (i need HOUDINI_PATH indeed): import os print os.environ['PATH'] os.environ['PATH'] = 'C:/TEMP;&' print os.environ['PATH'] >> C:\Program Files\Microsoft MPI\Bin\;C:\Program Files\Java\jdk-10.0.1\bin; ... >> C:/TEMP;& So, os.environ['PATH'] = 'C:/TEMP;&' overwrites existing "PATH" variable. This way os.environ['PATH'] += os.pathsep + 'C:/TEMP;' is working. I was thinking "&" should do the trick (append a string to the variable instead of replacing it), but it does not work. So I wonder if I misunderstood something with "&" and "+=" is the only solution.
  2. I'm learning command-line rendering through Python, but I can't get RopNode to work. When I use hou.RopNode.render() I get "unbound method render() must be called with RopNode instance as first argument (got nothing instead)". When I try to add "mantra1" in the parentheses (the file I want to render is the one open) I get the same error except "got str instance instead" in the parentheses. For all my Googling I haven't found any examples of how to successfully use this. What am I missing?
  3. hou.Geometry.point() not working..?

    Simple problem: I have a foreach loop running over points on a curve each with an attribute that is randomized for which variety of geometry it needs to use. The varieties are coming from 1 input, but where each variety has a different primitive attribute for which variety it is (I get the geometry in from Unity). I got the geometry getting piped in to a copy to points node, in the foreach, but before that I need to delete, per loop, what is not used. Or I need to pick it, I don't know. I just need the loop to select a variety based on the randomly generated attribute. So the way I did it was with a delete node, with an expression with the following python code: curVal = hou.pwd().curPrim().attribValue("namechoice") compareVal = hou.node("../foreach_plank_start").geometry().point(0).attribValue("nameselect") if curVal != compareVal: return 0 else: return 1 Comparing the primitive attribute (int) with the point attribute (int). But.. I get this error: Error: Unable to evaluate expression ( Traceback (most recent call last): File "<stdin>", line 3, in expression AttributeError: 'Geometry' object has no attribute 'point' (/obj/worknode/fence_maker/delete2/filter)). Explanations to why hou.Geometry.point() is not "valid", suggestions for other ways to code it or suggestions for other way to do the network are most welcome!
  4. Hi, Is there a chance for example to get a picked position of a connection item ( where the pointer is picked its line ) ? I would place a node where it's picked.. I think the paste tool does similar when you pick a position at the Network Editor before paste. THX! G
  5. Here are two simple clipping tools using python SOP verbs: Bricker and Radial. Unlike the divide SOP it´s cutting always right through the center. python_cutting.hip
  6. Force python sop NOT to cook

    Hello guys, I have some code running in a python sop witch is time dependent (using hou.intFrame() in there ) so the node cook every frame. However, Is there a way to force the python sop NOT to cook but only cook when is forced ( for example with a call back) ? Thanks in advance, Alessandro
  7. Python in Houdini : Right or Wrong ?

    Hello guys, I am wondering if it's a good or a bad idea to use Python scripts in my HDAs ? Thank you !
  8. Hi, Can Houdini python supports to get the nude under the actually shown node ring (or the object under mouse pointer )? G
  9. HOM from shell in macOS

    Hi there, Has anyone had any success with importing the hou module from python in a shell on macOS? I am currently running Mojave 10.14.1 with stock python 2.7.10 (fresh OS install) on my laptop, and have not been able to get it up and running. I found a couple of threads related to it from a few years ago suggesting it's not possible, but I sort of figured it would be mentioned in the docs that it's incompatible on macOS. So maybe I'm missing something? Python 2.7.10 (default, Aug 17 2018, 17:41:52) [GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.0.42)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import hou dyld: warning, LC_RPATH $ORIGIN/. in /Applications/Houdini/Houdini17.0.352/Frameworks/Houdini.framework/Versions/Current/Libraries/libopenvdb_sesi.dylib being ignored in restricted program because it is a relative path dyld: warning, LC_RPATH $ORIGIN/. in /Applications/Houdini/Houdini17.0.352/Frameworks/Houdini.framework/Versions/Current/Libraries/libopenvdb_sesi.dylib being ignored in restricted program because it is a relative path dyld: warning, LC_RPATH $ORIGIN/. in /Applications/Houdini/Houdini17.0.352/Frameworks/Houdini.framework/Versions/Current/Libraries/libopenvdb_sesi.dylib being ignored in restricted program because it is a relative path dyld: warning, LC_RPATH $ORIGIN/. in /Applications/Houdini/Houdini17.0.352/Frameworks/Houdini.framework/Versions/Current/Libraries/libopenvdb_sesi.dylib being ignored in restricted program because it is a relative path dyld: warning, LC_RPATH $ORIGIN/. in /Applications/Houdini/Houdini17.0.352/Frameworks/Houdini.framework/Versions/Current/Libraries/libopenvdb_sesi.dylib being ignored in restricted program because it is a relative path dyld: warning, LC_RPATH $ORIGIN in /Applications/Houdini/Houdini17.0.352/Frameworks/Houdini.framework/Versions/Current/Libraries/./libblosc.1.dylib being ignored in restricted program because it is a relative path dyld: warning, LC_RPATH $ORIGIN in /Applications/Houdini/Houdini17.0.352/Frameworks/Houdini.framework/Versions/Current/Libraries/libblosc.dylib being ignored in restricted program because it is a relative path Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Applications/Houdini/Current/Frameworks/Houdini.framework/Versions/Current/Resources/houdini/python2.7libs/hou.py", line 19, in <module> import _hou ImportError: dlopen(/Applications/Houdini/Current/Frameworks/Houdini.framework/Versions/Current/Resources/houdini/python2.7libs/_hou.so, 2): Library not loaded: /Users/prisms/builder-new/WeeklyDevToolsHEAD/dev_tools/local/lib/libz.1.dylib Referenced from: /Applications/Houdini/Houdini17.0.352/Frameworks/Houdini.framework/Versions/Current/Libraries/libAlembic_sidefx.1.7.9.dylib Reason: image not found According to the docs, you need to import DLFCN sys.setdlopenflags(old_dlopen_flags | DLFCN.RTLD_GLOBAL) But there is no DLFCN module for macOS. Python docs suggest generating DLFCN if it's not available, though /usr/include does not exist. I'm not really familiar with these dl related commands. I found this link and tried to just manually replace DLFCN.RTLD_GLOBAL to -1, which got rid of a lot of errors except Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Applications/Houdini/Current/Frameworks/Houdini.framework/Versions/Current/Resources/houdini/python2.7libs/hou.py", line 19, in <module> import _hou ImportError: image not already loaded I also tried the otool steps here which did not seem to change anything. Not really sure where to go from here. Thanks!!
  10. Mass create nodes from tab menu

    Is there a way to automatically create and unlock all nodes from a specific section of the node menu?
  11. Hi Can any Python gurus help me resolve a Python crashing issue? Have created a custom Python HDA which loads external data files. I get the following error when I switch to Scene View, and within a minute Houdini always crashes
  12. 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.
  13. I would like to have the same Redshift Light setup from Maya, in Houdini. First I created a simple Maya script that copy's the RSlight attributes like intensity etc and places it in a .txt Now in houdini, I want to create RSlights on the same position, with the same attributes. The text file will look something like this '''[rslight1(x,y,z, 100 # intensity)rslight2(x,y,z, 50 # intensity)]''' How would I approach this in Houdini? My thanks
  14. Houdini Terrain Pipeline Vol 2

    Hey All! The first part of this tutorial has been available for almost a year now, but because of the sad news that hit CMI, I was unable to upload the 2nd "half" there. So instead I just made it available on Youtube for everyone, to make up for that I suppose. I'm considering putting the first part on there as well, if enough people want that. In this tutorial covers the following, using Houdini * Generating water meshes * Updating the terrain based on the water * Generate walking paths on the terrain * Create some basic instances * Build a flexible system using external files to place these instances. Built on Houdini 16.5, but should work on 16 too, or all the way back to H14 if you skip the heightfield part. Recommended specs: at least 16GB of RAM, reduce the terrain size if you have less. Disclaimer: Work files are as is, and do not contain the cached geometry to save on space, this may explain node errors on the various "File Cache" nodes. It does however also contain the work done in the first half of the tutorial, albeit mostly undocumented: https://tinyurl.com/y89egjvq Hopefully its of some use! Twan
  15. Hi guys, I need a bit of help from someone python knowledgeable and willing, with a custom shelf tool that when clicked or called via a hotkey does the following: creates two fuse SOP nodes from the current selection, the 1st one set on "snap" and the other on "consolidate". Other settings also modified, but unimportant right now. I'd do it myself, but this is way too simple for my guru level of python and I don't have the time Cheers!
  16. Hi, Can houdini pythyon can solve this: I have an object (rop network in obj) when is deleted I want to run a py script. Thanks in advance ! Sz
  17. Plus button for dynamically adding parameters

    I am currently creating a little HDRI studio inside COP land. The user should be enabled to freely add "light sources" (aka spots and rectangles on the image canvas). How can I integrate a plus button in my parameter field? How can I duplicate parameters with it? Here is a mockup: Instead of adding more and more nodes, I would like to fill up arrays holding all spot positions, light intensities etc.
  18. Hi, In a Filecache node I would like to add an other Rendering button after the factory default button. Can it be somehow ? G
  19. Using custom Python modules

    Hi Is anyone aware of any good beginners tutorials on using custom Python modules with Houdini? Have been trying now for days to get ytini http://www.ytini.com/getstarted.html working in Ubuntu, but whatever I try always end up getting 'module not found' when I do an >import yt in the Python shell.
  20. Hi, Recently I had to develop a method for Alembic Sequence files export from Houdini and Load Alembic Sequence files in Maya, I couldn’t find any solution for this problem at that time, so I decided to develop some Python script to do these tricks. Below you can find my tutorial and source files for abc sequence files Houdini to Maya. Hope you find this useful in your workflow. If you have any questions or anything feel free to replay here. Thanks, Mahesh MS. HELP_abc_sequence_files_Houdini_to_Maya.pdf abc_seq.zip
  21. Hi, Recently I had to develop a method for Alembic Sequence files export from Houdini and Load Alembic Sequence files in Maya, I couldn’t find any solution for this problem at that time, so I decided to develop some Python script to do these tricks. Below you can find my tutorial and source files for abc sequence files Houdini to Maya. Hope you find this useful in your workflow. If you have any questions or anything feel free to replay here. Thanks, Mahesh MS. HELP_abc_sequence_files_Houdini_to_Maya.pdf abc_seq.zip
  22. Hey there ! The situation is that I have a Python code (in a HDA, but in the test a simple python sop will do the trick) in which I tried to modify a certain geometry's attribute. The thing is - I can't have that geometry connected to the python sop (since the final result would be to integrate it all in an HDA). So ! I know we get a "GeometryPermissionError: Geometry is read-only." error when trying to do so with the Python node not connected to the geometry. But ! It is possible to manually modify a node's geometry attributes by locking the node (setHardLocked in python), and manually inputting the values we want in the geometry spreadsheet. The question is - can we do the same in Python ? Can we lock the geometry, and then "auto-manually" change the attributes in Python on that specific locked node ? Thanks !
  23. Batch render objects

    I am working on a script to render all OBJ-files from a folder separatly in the same scene. How can I make a python script wait for a render to finish, so it can then load the next OBJ file? (I am not looking for a frame-based solution.)
  24. Descriptive Parameter to Node

    Hi, I found a very useful thing in docs but seems like not working for me unfortunately. Can anyone help ? I tried to add a descriptive parm to a node ( the same as a digital asset has ): node.setUserData("descriptiveparm", "parm") THX! G
  25. Hi, In Houdini Python (or hscript ) can we simply extract a given subnet content ? THX! G
×