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
  • Houdini
    • General Houdini Questions
    • Effects
    • Modeling
    • Animation & Rigging
    • Lighting & Rendering
    • Compositing
    • Games
  • 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 193 results

  1. Hi, I 'd write a simple script what uses a Null object as a control object to call a python script in its parameters. I use the eval python function by called a callback line. The issue is that the capturing goes on but not writes only just a few images. What could be wrong ? THX
  2. Get position\orientation of handle

    I can set handle position and orientation with omparm hscript command. But is it possible to get position\orientation of handle?
  3. Hello, Is it possible to promote a ramp parameter (retaining channel links) via python (or even hscript)?
  4. Hey all, I'm trying to rotate Object B to match Object A's local rotation with Python. I've been using objectB.parmTuple('r').set(objectA.parmTuple('r').eval()), but this seems to be very wrong ^^ There seems to be some euler shinanigans, for starters, so I was going to use a rotation matrix but I can't find some setLocalTransform equivalent, and setParmTransform is equally unhappy. Thanks in advance for helping me understand how Houdini prefers this to be done!
  5. Add Name Attribute Via Python

    Hi, How to add a name attribute to each point in a selected geometry via the python sop? Suppose I have a box with 4 points and I want each point to be named as piece0, piece1 and so on where the number is its point number. I have written a code, it adds the attribute to the spreadsheet but is unable to add the value. The value is added only when it is not a string. Please Help. The code that I tried: node = hou.pwd() geo = node.geometry() geo.addAttrib(hou.attribType.Point, "name", "piece") Please also add how to add the respective point numbers to the string piece. Thanks
  6. Hi, I am trying to do my asset for houdini and I am looking a method which can allow me to connect one node to anoter I use something like this, but this option is connecting everything to imput1 ('grey imput') staticsolver = doptoolutils.createSolver("staticsolver", True) - create staticsolver node staticobject = dopnet.createNode("staticobject") - create staticobject node doptoolutils.addObjectToSolver(staticobject, staticsolver, True) - connect staticobject to staticsolver but some nodes has more inputs: multisolver has 2 inputs one is grey and another purple - how I can connect my node to the purple one using python language? and another constraintnetwork has 3 inputs, one grey, green and purple and also if merge node has 3 inputs connected, how I can tell which should be first? I need explanation how I can connect something to each input. I found something like this but I dont understand what I should write to make it works: http://www.sidefx.com/docs/houdini/hom/hou/NodeConnection.html#outputNode if someone can write to me an example how should I write my script lines which show how I should connect node to purple input in multisolver, how to connect to green and purple input for constraintnetwork and how to define which is the first input in merge node. I attached picture as example what I want to connect to. Thank you Bart
  7. Hello guys, I'm currently a Computer Graphics bachelor student, we are learning CGI but also, Mathematics, Python and C++ some people are very proficient with all these 3 while I'm very proficient in CG but not very strong in these field. I'm very motivated to learn and go deep into these 3 field but I would also like to be efficient in the way I will learn it. ( learning all the mathematics is unfortunately not possible. ) So I would like to know what is your best advice to start learning mathematics and programming to become an FX-TD, based on your own experience or on some experience from other people? Do FX-TD always use programming in the task they are asked for? Any advice, any experience is very much welcome and it would help me a lot.
  8. I'm in the middle of making an otl for our artists and was wondering if there is a way to switch Houdini's viewport panes between Scene View and Composite View. I haven't found the proper help files for manipulating Houdini's layout through scripting. Thanks Mike
  9. I'm trying to provide an option to render to background so my artists can continue working on their shots Houdini. Currently in my OTL I am calling hou.hipFile.save() then proceed to trigger the render in background option in my mantra rop. hou.node(node.path()+'/render/render').parm('executebackground').pressButton() Despite saving the file, when the render executes, I receive an error telling me to save the file. Is there a better way to approach this?
  10. Hey guys and girls I'm very new to python and Houdini tool creation.This might turn out to be incredibly simple for you,I have a button that when click dives into my current digital asset my objective is to before diving to pin/lock/focuses the parameter pane that I clicked the button on(so the current node).I cant figure out how to use the classes Desktop,Pane,PantTab to do this to save my life. Am I simply approaching the problem wrong?I would greatly appreciate any help on this, Thanks in advance.Cheers!
  11. I'm in the middle of making an otl for our artists and was wondering if there is a way to switch Houdini's viewport panes between Scene View and Composite View. I haven't found the proper help files for manipulating Houdini's layout through scripting. Thanks Mike
  12. Python read primitive attribute

    Hello, I feel like I should know this but Houdini keeps erroring on me so I am doing something wrong. I want to read the primitive attribute Cd, multiple the values by say 6, and then add it to a new attribute called color. For the example scene, drop a box, a color sop and set it to primitive and bounding color, followed with a python sop. I am not looking for this in VEX, via nodes, or any other language. It has to be in python for this case. Thanks for the help, -Ben
  13. On the SideFX forums I have added some information/videos & software on how to accelerate Python with Houdini in Windows & Linux: A custom node/plugin which speeds up execution of Python nodes in SOP-Context by a factor of up to 2 in certain conditions (e.g. Deformer, Attribute manipulation): Custom Python node for SOP context Using Numba (Python JIT-Compiler) in Houdini (Windows & Linux): How to use Numba with Houdini An optimzed/accelerated Numpy Python module (with OpenBLAS) for Houdini on Windows: Optimized Numpy python module for Houdini Hope it helps some people when using Python with Houdini. Any feedback welcome. Cheers
  14. Is Geometry Selected???

    Is there any way to verify if some geometry components selected?
  15. I want to use an external python library to create and write out a pdf file from houdini. Maybe it's a simple thing to many, but I've been struggling for the past couple of hours, even if I've done this before!! About a year ago I managed to usereportlab, but since I installed the latest houdini (or something else change on my computer) my python SOP fails to import the library and I am trying to figure out how to do it again. What's the typical process of installing and importing any external library to houdini? There is also the cairo library which would like to try. Any help will be highly appreciated thanks
  16. Good evening, New to python and wanted to get to grips with rigging in Houdini. Been working though the 3DBuzz Technical rigging series and been tripping up over all manner of stuff. On the stretchy spline section of the tuts there is a section that errors out and I am not sure why. The code is stretchRatioParm = hou.FloatParmTemplate("stretchRatio", "Stretch Ratio", 1) startBone.addSpareParmTuple(stretchRatioParm, (“Stretchy IK”, )) Error message reads Traceback (most recent call last): File “stretchyIK”, line 85, in <module> File “stretchyIK”, line 14, in techrig_stretchyIK_Tool File “stretchyIK”, line 54, in techrig_stretchyIK File “CPROGRA~1/SIDEEF~1/HOUDIN~1.671/houdini/python2.7libs\houpythonportion.py”, line 44, in addSpareParmTuple _addParmTuple(self, parm_template, in_folder, create_missing_folders) File “CPROGRA~1/SIDEEF~1/HOUDIN~1.671/houdini/python2.7libs\houpythonportion.py”, line 71, in _addParmTuple parm_template_group, in_folder, create_missing_folders) File “CPROGRA~1/SIDEEF~1/HOUDIN~1.671/houdini/python2.7libs\houpythonportion.py”, line 93, in _ensureFolderExists “Invalid containing folder name(s)”) OperationFailed: The attempted operation failed. Invalid containing folder name(s) Would love if somebody could explain this? I know the tutorials were made in Houdini 9 have there been changes that would make this not work now? Many thanks, Duncan
  17. Hi its probably a long shot but I'll try anyway. I am trying to build ui using the old ui scripting with the help of huilib. This is not an argument thread about .ui vs PyQt vs PySide. I am trying to build a selection list in the UI like those you found in hou.ui.selectFromList Upon searching I came across the CHOOSER command with NO helpful hints or docs whatsoever. A lot of examples of how to build it but none to show how to populate it. Can anyone help if they know please? All the examples seems to point that the content was build dynamically. This is taken from one of the examples: undoChooser = CHOOSER 1 VALUE(undoChoices) STRETCH; But thas no pointer of how undoChoices was constructed. Thank you all!!
  18. Hey all, Sorry to add another Python cooking question (I've seen a lot, searching), but here goes. I have two subnets, a 'source' (from an .fbx) and a 'target'. The Objects in each correlate by name, and those in the source subnet are keyframe-animated. I'm driving the target Objects via: sourceMg = sourceNode.worldTransform() # beep boop, additional calculations go here targetNode.setWorldTransform(sourceMg) It works great, but once Houdini caches the frame the script is no longer (apparently) cooked, which makes sense--I pasted my code into a Python Script Object for convenient testing, which I suppose is not its intended use. If the HOM documentation is telling me what to do instead, however, I don't see it. There's the 'Python object' page, but I don't know that this is quite the same. In short: my script works as intended, but after the scene plays through once, Python stops moving the target nodes (I'm guessing because Houdini quits cooking it, since it's not doing anything Houdini expects it to do, like make geometry). Where does a script like this belong? I'm sure there's something embarrassingly obvious I'm missing--it's just a little extra confusing to me because I have to manipulate everything on the Object level. Thanks in advance for the help! If anything's unclear, lemme know
  19. Hey Guys i want to push render to disk button in mantra node via python , but its not working , my code is something like this : myRenderNode = hou.node('/out/baketexture1') myRenderNode.parm('execute') is there any trick to do this ? thanks
  20. Hello all, I'm currently working on a digital asset that creates sections from a given model. Each of these sections will have different values for different sections (the attribute values of all points within a section remain the same). Since the number of sections can vary, I've decided to go with the multiparm list to handle input. Since I've never used the multiparm before, I'm not sure how I can use these values within the HDA. From what I've been able to find here and on odforce, python seems like a good way to go. I've never used python in houdini so I'm a bit lost. How would I use python to accept the user values and set it for the points of the corresponding sections? Any help or leads will be extremely helpful. Pictures attached. Thanks, Rushil
  21. Execute string in Python ?

    Hey guys is there any way to execute string in python ? its my string variable : "hou.parm('/obj/test3_FBX/materials/Google_Hybrid___7/Google_Hybrid___7_surface/map1')" i want to use it to set a parameter , but problem is its a string. im also tried to change it like this : myPath = '/obj/test3_FBX/materials/Google_Hybrid___7/Google_Hybrid___7_surface/map1' hou.parm(myPath) in 3dsmax maxscript you can using a execute syntax before string to do it. is there a similar way in python for that ?
  22. i dont know why i cant rename my nodes with str variable , can anyone tell me what is the problem ? setName not working with getChildrenName variable , but you can change it with typing string directly , for example newNodeGroup.setName('Hello') here is the code myNodes = hou.selectedNodes() getChildren = myNodes.children()[0] getChildrenName = getChildren.name() newNodeGroup = myNodes.createNode('group') newNodeGroup.setName(getChildrenName) thanks
  23. access menu item

    hi, is there a way to access the menu items with python to change dynamically the label name? or adding submenus etc.? in this case i want add a specific hipname beside the label. thx for help or hints. nic.
  24. Hey guys! I'm starting this thread to share few shelf scripts i use and came across, during my houdini journey. Please feel free to add in more! # ADD NODES/OBJECTS TO MANTRA (Customisable) Select node(s) and click on the script to add it to mantra's force object/matte object etc. You can customise where to add by changing the parameter name (line 22) import hou selection = hou.selectedNodes() names = [n.name() for n in selection] my_list = “” if len(selection) < 1 : my_list = "nothing selected, please select at least one object" else: a=1 for sel in selection: my_list = my_list + "\n" + "selected object " + str(a) + ":" + sel.name() a=a+1 hou.ui.displayMessage(my_list, buttons=('OK',)) length = len(selection) print "Number of nodes selected: " + str(length) paths = [n.path() for n in hou.node('/out').allSubChildren() if n.type() == hou.nodeType('Driver/ifd')] selected = hou.ui.selectFromTree(choices=paths) mantras = [hou.node(path) for path in selected] for m in mantras: m.parm('matte_objects').set(' '.join(n.name() for n in hou.selectedNodes())) #CHANGE PARAMETER NAME AS REQURIED print ("Selected mantra nodes : ") + m.name() new_name=' '.join(names) hou.ui.displayMessage("( "+ (new_name) + " ) – added to selected mantra(s) matte objects.", buttons=('*OK*',)) #SETUP DELAYED LOAD Select node(s) and execute. It'll create procedural shader and setup all the parameters. Works on all nodes with 'file' parameter. #function for node variable: return type, description and name def extract_getTypeName(node): nodetype = node.type() description = nodetype.description() type_name = nodetype.name() return type_name #show selection tuple names selection = hou.selectedNodes() print len(selection) my_list = “” if len(selection) < 1 : my_list = "nothing selected, please select at least one object" else: a=1 for sel in selection: my_list = "selected object : " + sel.name() a=a+1 hou.ui.displayMessage(my_list, buttons=('OK',)) #for each object in selection lenght = len(selection) print "DONE!" for i in range(lenght): #create python variable for selected node selected = hou.selectedNodes()[i] if selected: meshop=hou.node('/shop'); meshop=meshop.createNode('vm_geo_file'); meshop.setName('delayed_load_shop_1', 1) targetdshop=meshop.path(); meobj=hou.node('/obj') meobj=meobj.createNode("geo"); meobj.setParms({"shop_geometrypath":targetdshop}); meobj.setName('DELAYED_load_geo_1', 1) targetfile=selected.parm('file') or selected.parm('sopoutput') mefile=meobj.node('file1') meobj.parm("geo_velocityblur").set(1) meobj.parm("vm_forcegeometry").set(0) meshop.parm("file").set(targetfile)
  25. Hi all, I apologize if this is a noob question. Currently I am trying to find out how to change the options in a drop-down menu. Say if there are 3 options, and I am trying to set the option to the second option, I tried doing node.parm('resolution').set(1) I got the following errors: return _hou.Parm_set(*args) TypeError: Cannot set a string parm to a int But if I tried to replace `1` with the string value of the second option, while there are no errors to be seen, the option in the drop down did not get change to the second option at all, it is still stuck at the default option. Any ideas?