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

  1. can we add startup scripts just for certain houdini project ? tried adding scripts folder in project and added 456.py in it ?....but doesnt seems to work It works fine for $HOME (user/documents) but not for per project....
  2. Hi, Can it be possible to toggle the parameter search ( magnifier ) of a parameters pane in Python ? I would create a toggle to show invisible parameters . Thanks in advance ! Sz
  3. Programmatically layout/home nodes ?

    Hi, I am programmatically generating Houdini scene (HIP) files After creating and connecting nodes, I'd like to perform a layout and home so that when the user open up the scene, it is not one ball of nodes in the center. Is there a way to do that in Hython calls, what about C++ ? Cheers
  4. hey guys! I require help understanding how to get a list of objects/instances/geo based on the intersection of bbox of custom geo being placed in a scene. How can we get the information? Thanks
  5. Hi guys, Could you any of you please help how to setup frustum culling or geo/obj culling based on bbox intersection with a given cube/box/sphere? Please let me know if you guys can help me out? Appreciate your time! Cheers!
  6. 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 !
  7. 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 !
  8. Hi. Guys. I'm stuck python scripts. How to get "name" attribute value at prim via python? I would replace the Null name with it. Python scripts is new to me. I'm not sure error meaning. Please give me some advice. Thanks! Saori
  9. Hello! Thanks for come here. I want to know process of converting from 3D modeling to 2D with mantra render. (I mean i want see python code or parameter..) because I'd like to get the object's minimum and maximum value of x,y coordinates on Mantra renderer (you can see picture). how can i do?
  10. Python - Callbacks help

    Hey Guys, Still quite new to Python, hoping someone can help point me in the right direction on this that I've been grappling with for a while now. I have a simple filecache .hda that I'd like to change color if it can/can't find the cache on disk. I've been able to use hou.ui.addEventLoopCallback() to continuously track and check the file parameter to see if the cache exists, and the color changing now works as expected. Where I'm having trouble is removing the event loop when the .hda is deleted from the node graph. An error pops up because Houdini is still trying to access the deleted node. I've been trying to look for a way to use the OnDeleted event handler, or hou.nodeEventType.BeingDeleted, but no luck yet and I feel out of my depth with my limited python experience. The .hda is attached, and there's a preview of the code below. Any help would be appreciated! custom_filecache.hda ####PythonModule#### import os import hou def nodeColor(kwargs): node = kwargs["node"] def colorCallback(): filepath = node.evalParm("file") if(os.path.exists(filepath)): node.setColor(hou.Color((0.0, 0.8, 0.0))) node.setComment(filepath) node.setGenericFlag(hou.nodeFlag.DisplayComment,True) else: node.setColor(hou.Color((0.8, 0.0, 0.0))) node.setComment("File not found") node.setGenericFlag(hou.nodeFlag.DisplayComment,True) startCallback(colorCallback) #adding this code below crashes Houdini when hda is deleted #node.addEventCallback([hou.nodeEventType.BeingDeleted], endCallback(colorCallback)) def startCallback(callback): hou.ui.addEventLoopCallback(callback) def endCallback(callback): hou.ui.removeEventLoopCallback(callback) ####OnCreated#### kwargs["node"].hdaModule().nodeColor(kwargs)
  11. QWidget window resizing

    I created a widget in qtdesigner following this tutorial: https://github.com/kiryha/Houdini/wiki/python-for-artists . So far I've tried all layout constraints and align methods within qtdesigner but houdini doesn't recognize them. This results in a window that looks like intended but doesn't resize... Any one knows how to solve this?
  12. I'm developing some UI for pipeline tools. One of the tools is an HDAs and Setups manager, where I click on the desired HDA and it is imported into the current geo context. I spent some time reading the documentation and other created threads on how to get the current geo context path and all I've managed to do is a workaround where I have to select one or more nodes and only then can I import my HDA into the selected context. Any ideas on how to achieve this without having to select any nodes?
  13. Beginner to python here. I have a big scene with a lot of geometry and in order to render I need to do some camera culling. My setup has 49 geo nodes and I'm trying to add a wrangle to the end of each network inside each geo node. So far I have defined some stuff and tried to loop over it with no luck: wrangle = hou.node("/obj/foo/cullWrangle/") exportNodes = hou.selectedNodes() for node in exportNodes: len(exportNodes.children()) I thought it might be simple to loop over the selected geo nodes, access the child nodes, define the last sop in each geo node, and then something something add wrangle. Can anyone help me out?
  14. New Houdini Python Playlist

    Hi all, I recently started uploading a large Houdini python course/playlist on Youtube. In case you might be interested, there will be a section in there where i'll actively answer odforce python questions The series is called the 'deep dive series' And this playlist contains a free course that will be aprox. 31 to 32 hours long in total. The first few videos about programming with Python were just uploaded. This course consists of 5 steps 1 - (Part 1) The Big Picture 2 - (part 2a) The Fundamentals (13 videos) 3 - (part 3) Full Projects (Multiple Projects from beginning to the end) 4 - (part 2b) Beyond the Fundamentals (More advanced tutorials to be used on a need-to-know basis) 5 - (part 3) Contextualization (Masterclasses regarding all kinds of decisions you can make as a programmer, and interviews with fellow Houdini Python coders) You can watch it here - https://bit.ly/2Pu8gbI (the complete series will be free) Netinho da Costa Linkedin - linkedin.com/in/netinho-r-p-da-costa-b5326985
  15. I'm trying to create a Python UI state that returns the currents fields in a DOP network. I want to query the fields and then store there values so that I can print it in the viewport. I can find all the python documentation to get the fields themselves, but I can't seem to find out how to get the values stored in the voxels. I know it can be done in SOPs, but I really want to do it directly in DOPs. Is this possible? FYI, just using a simple Sparse Pyro Shelf tool for my testing. I want to query the density and temperature fields and calculate the maximum value stored in those fields. Thanks!
  16. Add AOVs to ROP

    I've done it before but can't find my old script. How do I script adding instances/AOVs/imageplanes on a ROP?
  17. Select node with Python

    Hi, I am trying to select a node with a button in a HDA, but when I do select it, the object level switches to geometry level, how can I prevent that? I would like to select a drawcurve with an enter included, so when I press the button I will have the cursor switch to the red sphere icon to start drawing. any ideas would be highly appreciated it. Thanks,
  18. Hi, Can it be possible to make difference in event callbacks with copy, alt drag and rename a node. The problem is when Houdini make a node copy ( duplicate, or copy paste ) makes a renaming too. So in scripting I could not figure out how to determine which event occurs. So I want to know when rename or copy paste or alt drag happened. THANKS IN ADVANCE ! G
  19. Sorry for the re-post, but we're still hiring, since we have more customers! We're a San Francisco-based startup focused on generating computer graphics for customers that build computer vision neural networks. At the moment, we have a Houdini + Cycles and Houdini + VRAY pipeline for specific asset niches. We are looking to expand the pipeline in terms of asset types as well. Remote is fine, so long as you are able to consistently work Pacific Time or Eastern Time hours. Python experience necessary since we use python within houdini to parse JSON. Please reach out to me, matt@synthesis.ai for more information.
  20. Hide The Ortho Grid in Python

    Hi Everyone, Can the the ortho grid be hidden in python ( I sure it can be ) ? ( Not the reference Plane ! ) Thanks in advance ! G
  21. Python error !

    node = hou.pwd() geo = node.geometry() # Add code to modify contents of geo. # Use drop down menu to select examples. for prim in geo.prims(): path = prim.attribValue("path") newpath = path[:20] Prim.setattribvale("path",newpath) getting error Error Python error: IndentationError: ('expected an indented block', ('', 8, 4, 'path = prim.attribValue("path")\n')) i dont know anything about python i started a tutorial and getting this error he was using some older version of houdini and i am 17.5 may be because of this or anything else, please help me out . Thanks
  22. Change Top view to Perspective

    Hi, It seems like an easy question but I could not figure out somehow. How can I Change Top view to Perspective ? G
  23. Can I get somehow the to a previously clicked Network Editor position in python without registering events before to put a node to ? G
  24. Hi there, I'm importing the hou module into a custom python script and I would like to have multiple scenes opened at the same time. This is how it is implemented: import sys from importlib import reload sys.path.append(HOUDINI_PATH) try: import hou except ImportError: print('houdini.py: There was a problem loading the hou module') box_hip = hou.hipFile box_scene = box_hip.load(path/to/box_scene.hipnc) print(box_hip.name()) # ==> box_scene.hipnc CORRECT reload(hou) sphere_hip = hou.hipFile sphere_scene = sphere_hip.load(path/to/sphere_scene.hipnc) print(sphere_hip.name()) # ==> sphere_scene.hipnc CORRECT # Let's print the name of box_hip again print(box_hip.name()) # ==> sphere_scene.hipnc WRONG As you can see, even though I've reloaded the hou module, it's still using the same hou instance for both hip files and therefore always returning the data of the latest loaded scene. Is there a way to have different instances of the hou module so I can load and work on multiple different hip files in the same script? I've also tried to assign hou to different variables with no luck. Any help would be highly appreciated, thanks in advance!
  25. I am trying to render 2 hda simultaneously and I decide to using python threading it works on the houduni's python shell but it don't work on hyton. What is the problem here? How can I solve this? PythonShell hyton Code import hou import time import threading def nodeRender(nodeName,path,fileName,nodeCnt): start_node_time = time.time() node = hou.node("/obj") sp_name = "{}{}".format(nodeName, nodeCnt) file_save_name = "{}{}.png".format(fileName, nodeCnt) node.createNode(nodeName, sp_name) nodepic = hou.node("/obj/{}".format(sp_name)) nodepic.parm("output").set("{}/{}".format(path, file_save_name)) nodepic.parm("render").pressButton() nodepic.destroy() ex_time = '{:.2f}'.format((time.time() - start_node_time)) print("--- %s seconds ---" % ex_time) def renderThread(): start_time = time.time() t1 = threading.Thread(target = nodeRender, args=["Masa", "C:/Users/emnrdl/Desktop/New Folder (13)", "MasaTest" , "1"]) t2 = threading.Thread(target = nodeRender, args=["Masa", "C:/Users/emnrdl/Desktop/New Folder (13)", "MasaTest" , "2"]) t1.start() t2.start() t1.join() t2.join() total_ex_time = '{:.2f}'.format((time.time() - start_time)) print("--- Total execution time: %s seconds ---" % total_ex_time)