Jump to content

Search the Community

Showing results for tags 'Python'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • 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

Product Groups

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Skype


Name


Location


Interests

  1. 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!!
  2. 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&param (#1) and expression(#2:sorry it's empty,,) ? Thanks!
  3. 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.
  4. 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 ?
  5. Hello, is there a way to define the RMB choices of the hou.ui.selectFromTree function ?
  6. https://alexeyvanzhula.gumroad.com/l/modeler2023/black_friday
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. 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?
  14. Hi !! Is there a way to replace 'Geometry' text at the Network Editor ? Cheers, Szabolcs
  15. 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?
  16. Hi, I'd need to customize the behaviour of the default buttons of some nodes, e.g. - display a custom message when I press "Save to Disk" on a rop_alembic. Also, I want the script to run for all the users in my studio. Maybe should I create a preset from this and save it in the shared HOUDINI_PATH? Beyond the fact I'm not sure how to do it on a custom buttom I may create in the parameter interface, all the default parameters are locked. Can someone help me? thanks
  17. New Houdini class on Attributes. Enroll now: https://bit.ly/houdiniattributesclass Teaser: https://vimeo.com/714350608 Attributes are the heart and soul of Houdini. So many beginners and even intermediate users stumble over the importance of knowing the in and outs of Attributes. Understanding this topic is vital to getting the most out of Houdini itself. My goal is to give you a much deeper understanding of Attributes, so I have broken down this class into smaller topics. This way I can take you step by step from the core geometry component foundations, to common workflows, as well as reading & writing attributes from scratch. I'll also take you through examples of actual attribute implementations relating to RBD, FLIP, VELLUM, Crowd sim, and show some Viewport GL attributes. In session 1 you will be shown the core geometry components and how they relate to attributes. You'll also be given some clarity on confusing terminology, plus learn what attribute classes, and types you have available. Also covered will be a full explanation of the Geometry Spreadsheet, plus some tips on how you can sort through all of the data that it presents. I'll run you through what intrinisics are, how they can be accessed, and also explain what attributes are NOT, which is just as important as knowing what they are. In session 2 I will teach you the many different ways that attributes can be created, plus the the ways you can read those attributes back into your node streams. I will also take you through the world of Attributes versus variables, global versus local, and explain the reasoning and history of dollar sign versus the at symbol. In session 3, I'll focus solely on attribute usage in a variety of simulation setups. Showing you some implementation methods for simulation attributes. Houdini comes packed with a lot of native attributes already built in. I've gone ahead and collected together a massive list of well over 8,000 of them for you in PDF form. This course is aimed at getting beginners up and running with Attributes, but I will be taking you into intermediate territory fairly quickly as it's required to get a full understanding of Attributes. There WILL be discussions of VOPs, VEX, HScript, and Python in the second session. Don't worry though, because I will also be showing you many of the native SOP attribute nodes which simplify many common tasks for non-coders. I've packed a lot of information into this class, so even if you are an intermediate user to begin with, there is still plenty of good info for you as well. For more info and to enroll, head over to Houdini.School today.
  18. Hey everyone, I want to share my HDA. By that tool you can easily create hard surface objects, such as building, spacecraft and other constructions. by it you can generate, delete cut and unite blocks. It's free and I would love if you could use this tool: https://vimeo.com/679178527
  19. 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 ?
  20. Hey everyone! Like the title suggests I am trying to find a way to set quickmarks in Houdini via python (or if it is considerably easier to do via hscript I am totally open to doing it there as well). So far I've come across the "nodegraphview" module with it's "Quickmark", "createQuickMark" and "setQuickMark" functions but that's about as far as I have gotten. The documentation I've been able to find here is a little bit too sparse for my skill level. Mostly I am unsure of/confused about what the function wants as its inputs, as it is only listed by variable names with no further description. What does 'net' mean? Or 'bounds', or 'items'? This is what I have tried so far just to test and see what error messages I got which I hoped could lead me towards what to google for (Yeah the empty string are there just because I have no idea what to put there): import nodegraphview as view net = hou.ui.currentPaneTabs()[0] qmark = view.QuickMark(net, '', '', hou.node('/obj')) view.setQuickMark(8, qmark) And this is the error I got: AttributeError: 'NetworkEditor' object has no attribute 'isSelected' Has anyone out there done this before and could give me some tips or know of any more in depth documentations about how to use this module and these functions? Thank you so much for your time!
  21. So I am working on a project which is requiring me to extract the point numbers from an arbitrary polygonal object. The most pythonic way to do what I am trying to do is this: geo = hou.Geometry() geo.loadFromFile(path/to/my/file.bgeo.sc) primPoints = [[pt.number() for pt in pr.points()] for pr in geo.prims()] I need to maintain the winding order and get it down to just the ints for the point numbers. I have profiled every function in this, and hou.Prim.points() is god awful slow, taking up 16 of 22 seconds on a 1.5M poly, 800k point file. I am trying to find a way to circumvent hou.Prim.points() but nothing is jumping out to me. I have even moved everything into Pandas, which does make working with the data and doing further transformations easier, but I have not gotten any performance increases as it still relies on calling hou.Prim.points() for every primitive. I have contemplated trying to use hou.Geometry.points() and calling hou.Point.prims() to go at it from the other direction, thinking that it might save me some time since the list of points is always shorter than the list of prims, but it loses the winding order, which I need for my use case. Said use case is parsing cached geometry into a custom format for optimized use elsewhere. I have been able to get the performance up to snuff on just about everything else, and will save even more time on later steps thanks to Pandas data management, but this singular step is so sluggish that it just about tanks the whole project. Literally everything else in the pipeline that I am developing is under 4-5 seconds/frame for huge geometry volumes in the pre-process step (which this is part of) and the final end of the process is so fast I'm not even going to talk about it. Literally just this is bogging things down in an untenable way. Pandas code for reference: import pandas as pd geo = hou.Geometry() geo.loadFromFile(path/to/my/file.bgeo.sc) primsSeries = pd.Series(data=geo.prims()) primsSeries = primsSeries.apply(hou.Prim.points) primsSeries = primsSeries.apply(lambda x: list(map(hou.Point.number, x))) The two take virtually identical amounts of time with the pure pythonic one being a couple seconds faster because it is doing the hou.Point.number in the same step as the list generation, whereas the Pandas code currently does it as a secondary step. I'm sure I could include it in the hou.Prim.points apply, but this was mostly separated for profiling to see where all of my speed was going. Does anyone out there have any idea how to bypass hou.Prim.points in this process in favor of something faster or am I 100% stuck?
  22. Hi There, I'm trying to grab all attributes on the current work item in TOP and assign them to points in SOP. I wrote a python script and it works fine in SOP lively but I'm getting an error or crush when I kick off ROP Geometry Output TOP. I used python approach because I have several attributes to transfer and the attributes can be changed in the future so I'd like to avoid using @xxxx with hardcoded attribute names in SOP. It would be great to have some suggestions. Thanks you ~
  23. Hi, I have been struggling with this for the past 2 days. I need help in returning the name of the selected item in an ordered menu. What I am trying to achieve is to dynamically populate the ordered menu with the list of projects via menu scrip (python) import os path="k:/Projects/" dirList = os.listdir(path) dirs = [] for dirName in dirList: fullPath = os.path.normpath(os.path.join(path, dirName)) if os.path.isdir(fullPath): #dirs += [fullPath, dirName] dirs += [dirName, dirName] return dirs This code scans for folders in directory(k:/Projects/) and lists them in the menu. All works fine till here. Now I need to return the name value of the selected menu item from another parameter. So I have tried this listItemName = hou.pwd().parm("parmList_Projects").eval() and this listItemName = hou.pwd().parm("parmList_Projects").evalAsString() but it returns only integer values from (0,1,2,...) How can I get the name or label value ?
  24. Hello; I'm just getting into PDG and have an interesting problem I'm trying to solve. I have a list of files that I'm trying to sort using PDG. The files are labelled x0y0,x0y1,x0y2.....x7y7. When I load them with the "filepattern" TOP, it sorts them as x0y0, x0y1, x0y2, x0y3 etc. Instead, I would like to re-sort them as x0y0,x1y0,x2y0,x3y0,x4y0 ..... x0y1,x1y1,x2y1,x3y1,x4y1 etc. What would be the best approach for this? Any python algorithm that may be suitable for this that can be executed in TOPS? Maybe a feedback loop?
  25. Hi all, Is there a way I can use a shelf tool python script to select a joint in the rig tree window pane when I have a rig pose SOP selected?
×
×
  • Create New...