Search the Community
Showing results for tags 'python'.
-
In C#, it's possible to write code where you can use "return;" to stop exit the code processing in a method. Even if there are more lines after it. Is there an equivalent we can use inside the Python SOP (hopefully without wrapping our code in a "def")? The idea is to maybe be able to write simple lines of code in a Python SOP that could check for some stuff line by line, but can stop anytime if a line says so.
-
Hey all, I'm trying to use setActiveInterface(interface) from hou.PythonPanel class. According to the documentation, the required argument (interface) is a 'hou.PythonPanelInterface' object, but I couldn't find any method that allows you to access that interface object. does anyone know how I can access my python panel interface object? thanks!
-
Hello Magicians, I am having some fun learning a USD file format and I want to share my findings. After 20++ years in CG, I finally managed to create a poly plane! I reinvented the wheel trying to create a plane, sphere, and other basic shapes, but it was a good exercise that helped me to understand some aspects of 3D graphics on the lowest level. I put everything together as a tutorial, Creating Procedural Geometry with Python and record it to USD file.
-
Want to have multiple explosions in your shot? Let's populate them! Why go through the trouble of simulating each Fx when we can just populate a scene with a few! The Populate Toolset is a comprehensive HDA (Houdini Digital Asset) Toolkit designed for intricate control to populate a scene with various caches. The OTL uses a bundle system, so we can switch between a low-resolution proxy cache and a high-resolution render cache anytime. This makes it easy for artists to preview shots, layout simulations and art direct timing as per their needs. How does this Setup Help? Easy Layout: Create quick and easy layouts and previews for your shots without using high config machines and dealing with the laggy viewport. Quick Controls: Get quick controls to art direct your simulation like adjusting scales, rotation and timing. Randomizer: An easy randomizer to get started with. Override Tool: When you need small adjustments just use the override tool to fix it! Gizmos: Gets user friendly preview gizmos that help artists preview scales and placements of cache. Used on Beautiful Hunan: Flight of The Pheonix & Halo (Mini TV Series) Get the HDA and Files on Gumroad: https://chakshuvfx.gumroad.com/l/art-direct-instances
-
Hey Everyone has anyone used hou.hotkeys ? I've made a tool and would like to have a shortcut assigned to it when its loaded. I can create a shelf and add tools to it through python with the hou.shelves library. But assigning a shortcut to the tool is . I tried to understand how the shortcut was assigned to the tool by doing it manually. For example Ctrl + Alt + Shift + T to the tool called My Custom Tool Then I was curious to find what the hotkey symbol the tool was using hou.hotkeys.hotkeySymbol. The examples of the documentation show a strict dot notation but running this command will return something along these lines with a colon ? >>> hou.hotkeys.hotkeySymbol("Houdini/My Custom Tool") h.tools:my_custom_tool Regardless, with that info, trying to assign this through python seemed to work. The edit tool window will register and show the assignment, as well as the HotKey Manager. However pressing the shortcut doesn't work and doesn't trigger the tool code hou.hotkeys.addCommand("h.tool:my_custom_tool","My Custom Tool", "This is a custom tool") hou.hotkeys.addAssignment("h.tool:my_custom_tool","Alt+Ctrl+Shift+T") Weird behaviour is deleting the shortcut in the Hotkey manager and reassigning it doesn't work either. I need to manually run hou.hotkeys.removeHotkeySymbol("h.tool:my_custom_tool") for it to work again when setting it through the Hotkey Editor manually. It seems the hou.hotkeys.addCommand is missing something ? its not linking to the command to the tool correctly to the shortcut even though visually in the Hotkey editor and the edit tool window hotkeys tab shows properly. Did anyone face this issue ? Is this how we assign hotkeys to a tool through python ?
-
Hello! I am attempting to use a multiparm block list to dynamically create groups from a selection. The selection is coming from the top of the HDA using an action button with a string parameter. Currently I am able to make my selection but when iterating over it in a for loop for some reason I’m not able to bind the channel reference to my parameter. Basically what I am doing is taking that string and trying to bind the “Group” variable of a vex node so that I can run some vex code to give a name attribute to just those selected primitives. I know I can bind the group to a parameter because I am doing it in other places in the tool but for the multiparm the channel never turns green even though I pass it a string to my HDA’s parameter Has anyone attempted this? Will I need python? If so what should I look into?
-
Hi! I'm on windows and Houdini 19.5.435 and installed the open3d python package. When Trying to import it in houdini (doesn't matte if python node or shell) with import open3d as o3d Houdini crashes after a few seconds. I installed the package with Houdini's own python 3.9. quick update: the same happens with Houdini 19.5.569 Any thoughts? Did someone here use open3d inside Houdini before? On Window or Linux? UPDATE: works on Fedora 38 after overcoming a few obstacles. Time to partially move to linux I guess...
-
Hi, I have to get the last character of the node's name into group parameter of blast node. In this case, the name of blast node is blast1, so I need the last character 1, and put it in into group parameter. nodeName = hou.node(".") last_char = nodeName[-1] return(last_char) And I get error Error: Unable to evaluate expression ( Traceback (most recent call last): File "<stdin>", line 3, in expression TypeError: 'SopNode' object is not subscriptable (/obj/geo1/blast1/group)).
- 2 replies
-
- scripting
- expression functions
-
(and 2 more)
Tagged with:
-
https://alexeyvanzhula.gumroad.com/l/modeler2023/black_friday
-
Hello fellow Houdini users. We need a sys admin to help us create pixels for science! Help support the Visualization Studio in producing planetarium shows that communicate the California Academy of Sciences' mission: to regenerate the natural world through science, learning, and collaboration! https://www.calacademy.org/exhibits/morrison-planetarium If you have technical experience maintaining artist's workstations, DCC tools, render farm support, etc, please consider applying here: https://lnkd.in/gJA8zXQk Sincerely, Jeroen Lapré Senior Technical Director Visualization Studio California Academy of Sciences Mobile: 415 299 9540
-
- 1
-
- employment
- linux
-
(and 8 more)
Tagged with:
-
Hey all, python / HDA related question: I'm making an HDA where I'm creating a bunch of trace nodes linking to a bunch of rotoshapes in a COP network, which is all good and everything is linking correctly...however I want to initialize the COP tab on the trace node via a python when the node is created instead of the default File node option. Also, I've just been grabbing nodes and dragging them into the python windows to get things working, but down the line how would you make the paths underlined in yellow relative to the HDA? I've tried the ../ I've used before, but it's throwing me errors whenever I try to reference relatively. Thanks in advance!
-
My First Try in Houdini HDK Customized the houdini file handler helper to accept custom paths. Python script integrated into Cpp to solve asset/shot logic. Still need to improvise a lot for production release . #houdini #hdk #c++ #python Cheers!!
-
Hi, I am studying how to make OnCreated.py by exporting codes with asCode. So far, I understood a procedure: 1 Create a new folder and create some parameters inside of the folder in edit parameter interface on a node. 2 Use findFolder() to take a new folder tab, and write out a python code with as Code. 3 Create actual a xxx_OnCreated.py that either imports or copy&paste the #2 written code. Questions are : 1 Can we export multi folder tabs at once as one master code? 2 Can we export expressions existing in a default parameter AND new folder tabs together, instead of separately? (I know I can manually add this code into OnCreated.py later.. ) I think a problem is that, if we export all folders and parameters including default param&folders, onCreated.py will get error due to the default one including. That makes this procedures difficult. # export new folder and its parameters. Let's say exportTab.py node = hou.node("/out/geometry1") ptg = node.parmTemplateGroup() folder = ptg.findFolder("NewFolder1") with open('f:/exportTab.py','w') as f: f.write( folder.asCode(function_name='createTab') ) ## Questions are ## I want to export NewFolder1 and NewFolder2 and NewFolder3 together and do f.write ## I want to export an expression together, for instance, "/obj/geo1/out_render" in Geometry1 > SOP Path param here, and do f.write. ## I could manually paste later like a node.parm('soppath').set('/obj/geo1/out_render') but ideally export together here.. #Then Let's say this is , Geoemetry_OnCreated.py, and try to attach the exported folder tab and parameters import exportTab node = kwargs['node'] ptg = node.parmTemplateGroup() defaultFolder = hou.FolderParmTemplate('default', 'Default', parm_templates=ptg.entriesWithoutFolders()) for p in ptg.entriesWithoutFolders(): ptg.remove(p) ptg.append(defaultFolder) ht = exportTab.createTab() ptg.append(ht) node.setParmTemplateGroup(ptg) Maybe my explanation is confusing, but I hope the code and screenshot help to show what I try to do. In other words, in conclusion, with the screenshot, how to export multi tabs¶m (#1) and expression(#2:sorry it's empty,,) ? Thanks!
-
I created a python SOP_Node, there's a class inside that with a list class member, I want to create an array attribute for the node and put that list on the array attribute. I studied all the method that exists for creating attribute but I couldn't figure that out. Please help me. BEST REGARDS.
-
Hello wizards, i'm trying to get the camera from the current stage and then get the frustum I'm following the Pixar API, but probably i'm missing something... Here my code: from pxr import Usd, UsdGeom, Sdf node = hou.pwd() stage = node.editableStage() # Add code to modify the stage. # Use drop down menu to select examples. camera=stage.GetPrimAtPath('/cameras/camera1') gfCam = UsdGeom.Camera(camera).GetCamera(1.0) frustum = gfCam.GetFrustum() Problem: GetFrustum() gave me an error, it seems that is not a method of the camera class, but it should... Any idea ?
-
-
Hey All, I'm trying to customize a python settings.json file with int, float, bool, and sting values set up on a Null control with parameter sliders. I've read in the initial file I want to modify with a Json file, and have matched all the tags with the slider controls. I'm then collecting the tags into an array called query and trying to replace the original values in the .json with the slider control values. This is what I have so far (python novice), but I feel like there is a more solid way to do this. I know I'm not actually storing any files or values, I'm just printing to console for now import hou parentstr = '/obj/geo1/null1' query = work_item.stringAttribArray("query") vars = {} for q in query: parmstr = parentstr + "/" + q transval = hou.parm(parmstr).eval() vars[q] = transval if isinstance(vars[q], str): strv ='"'+q+'"'+':'+'"'+vars[q]+'"' print(strv) else: strv = '"'+q+'"'+":"+str(vars[q]) print(strv) There's also one section "animation_prompts" that goes one level deeper and would need some sort of formatting love where I need to indent and put in a few other lines. Thanks in advance! -Dana
-
i making a shelf tool and i'd like to have a popup window with a custom interface appear. is this possible? i'd like to have a node selector, a directory selector and a dropdown can't seem to find any info on custom ui from SideFX documentation
-
I have a custom pyqt ui with a list widget in it. I'd like that list widget to update if the user changes context in the network view. e.g. from object to SOP to ROP (Driver) etc. I believe I can utilise the ContextEvent handler but I don't know how to initiate it. Can anyone help me out or point me to a script I can dissect? https://www.sidefx.com/docs/houdini/hom/network.html I briefly flirted with the pypanel nodepath hook but ideally I'd like to run this from a toolshelf too. https://www.sidefx.com/docs/houdini/examples/python_panels/nodepath.html
-
I am trying to get createModuleFromSection() in the Python module in an HDA I am developing. It can't find the module. I am less than a python noob thus struggling. I have a modified nodegraphvellumutils.py (which works perfectly) renamed as PythonSubmod.py and I want to attach it to the HDA then call it from the PythonModule. import toolutils submod = toolutils.createModuleFromSection("submod", kwargs["type"], "PythonSubmod.py") # Add network editor hooks if hou.isUIAvailable(): from submod import setSelectPosContextData, isPassThroughConnection, createEventHandler def isVellumNode(): return True test_PythonModule.hda
-
Hi Masters of Houdini ! Is there a solution of checking of all node parameters change made in HIP file from the very begining like a log of changes ? Is there a chance to see the undo data ? Thanks in Advance ! Szabolcs
-
Hi Masters of Houdini ! Is there a solution of checking of node parameters change made in HIP file from the very begining like a log of changes ? Thanks in Advance ! Szabolcs
-
Hi All, Do I need to learn Python to become a Houdini developer? If yes, what are some resources from which I can learn python programming?
-
-
I have an HDA with a parameter that allows users to return a selection from the viewport (same type of parameter used on blast nodes etc.). I have a callback script that I want to run whenever the artist makes a selection, however, the script only seems to execute when the string portion of the parameter is edited. For example if I manually type the name of an object into the parameter the callback script executes as expected, but if I use the arrow button to select the objects in the viewport and hit enter to confirm my selection the callback script is not executed. This obviously isn't very useful or intuitive for artists. Does anyone have any workarounds or suggestions on how to get this functioning the way one would expect it to?