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
    • 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 341 results

  1. Hello folks, so, i have a bunch of houdini file with a top node at OBJ level, all file have the same structure and are in the same folder I would like to cook the TOP node from external, Python or another TOP graph. I tried in a background script to access with hou.node('/obj/topnet').parm('cookbutton').pressButton(), but it seems that doesn't cook anything Any idea ? Thanks in advance
  2. Is there a way to get a list of the most recently opened HIP files in Python? I am trying to set up my home Houdini install to auto-open the most recent file when I start it fresh...
  3. I'm trying to create and customize a node through a python script. I'm adding parms using the hou.parmTemplate() class and for one of the parameters I need to edit the Channel tab (see below). I can't seem to find anything in the python documentation on how to do this; anybody know what the best solution would be? Thanks!
  4. Hey guys, I was wondering if anyone new of a simple way to run a function when I select a different node? I've currently got a little UI with pyQt and I've gotten to it to update using the ChildSelectionChanged node callbackEvent but that is only for specific networks. The only thing I can come up with is I have the script check for new sub networks everytime it runs and creates new callbacks for them. Surely there is a more efficient less dirty way to do this? Doing it the dirty way this is what i'm using when running the script, updating it per change on selection and when calling the close event: Only works with networks one down from obj but I imagine if I made this find all sub children it will have a performance impact? def callBacks(self, enable): nodes = hou.node('/obj/').children() for node in nodes: if enable: if len(node.eventCallbacks()) == 0: node.addEventCallback((hou.nodeEventType.ChildSelectionChanged,), self.updateUI) else: node.removeAllEventCallbacks()
  5. Hi. After we install a HDA like this hou.hda.installFile('hda_path.hda') how is it possible to get the hda's operator name, so we can "create" it? The installFile function does not return anything... hou.node("/obj").createNode("???")
  6. get list of materials

    Help I have a model with several materials in shop_materialpath. I want to get a list of each material (I will use this information to create groups later). I made the following code, and it works !. My question is if I did it right? Because with objects of many polygons, it is extremely slow. import hou root = hou.selectedNodes()[0] geo = root.geometry() path_a = [] path_b = [] for prim in geo.prims(): shop = prim.attribValue('shop_materialpath') path_a.append(shop) if shop not in path_b: path_b.append(shop) print path_b
  7. In a test scene I have a sphere node inside a geo node inside a subnet node I want to promote the sphere node parameters to the subnet node with this code I'm getting an error: The attempted operation failed. Invalid indices/name/parm template import hou #get pTGroup on node node = hou.node('obj/subnet1') ptg = node.parmTemplateGroup() #create new folder in group sphereFolder = houFolderParmTemplate('sphr', 'sphere', folder_type=hou.folderType.Simple) ptg.addParmTemplate(sphereFolder) node.setParmTemplateGroup(ptg) #find inner sphere node sph = hou.node('obj/subnet1/sphere_object1/sphere1') #get pTGroup on sphere node sphG = sph.parmTemplateGroup() #promote the parameters of sphere node to upper node (subnet1) sphere_folder = ptg.findFolder("sphere") for i in sphG.entriesWithoutFolders(): ptg.appendToFolder(sphere_folder, i) node.setParmTemplateGroup(ptg) what am I doing wrong?
  8. Hide parameters through python

    Hey guys! I'm creating a python script in an HDA. When the hda is created, this node is also going to create a null at /obj level and adds some parameters. What I don't like is that parameters that we usually find in this kind of null has not a clean interface but has already some parameters by default. I am trying to hide them using the suggested code https://www.sidefx.com/forum/topic/30708/. Using the following code I can hide one of the parameters (xOrd). ##### CREATING CONTROL NULL ###### ################################## def control(node, parms): import hou creation_place = hou.node("/obj") null = creation_place.createNode('null','CONTROL') ### HIDE INTERFACE OF NULL null_tg = null.parmTemplateGroup() copy_parm_template = null_tg.find(“xOrd”) null_tg.hide(copy_parm_template, True) #setting the template null.setParmTemplateGroup(null_tg) What I would like to do is to loop through all the parameters/folders and hide them all. But if I loop through all the parameters using null.parms() I am not able to make it work the hide function. Any hints?
  9. Python export flipbook as mp4

    Hey, I've written a shelf tool to create flipbooks with custom parameters, and I want to know if it's possible to export it as mp4 once it's finished ? I tried with the flipbook_options.output() but it's exporting a video for each frame (so an image sequence), and I don't want to export an image sequence, but directly a video, if it's possible ! Cheers,
  10. Icons path

    I know the icons are stored here: hicon:/SVGIcons.index? and the short form to add one to a tool or shelf would be, for example, BUTTONS_add.svg. But how can I point to one of these icons from a pyside gui? Is there a fullpath I can use?
  11. Hi, I would simply ceate a script which creates lock file when a hip is opened for the reason more users should not overwrite their scenes. The lock file should be deleted when a new hip is about to open. So i created a hip event in my scene and check which event is fired (i check the opening hip name). My problem is that I can not fire an event before the new hip is opened ( to clear the lock file ) the event always shows the opened hip not the hip which is being closed. Any idea ? thx!!! G My scripts: ---Registering the event----- hipFileEvent_script = """ def hipFileEventsFired( event_type): import houdini.illessz.events as ev reload( ev) ev.hipFileEvents( event_type) """ hou.setSessionModuleSource( hipFileEvent_script ) hou.hipFile.addEventCallback( hou.session.hipFileEventsFired) ---- The event ---- def hipFileEvents( event_type): # print kwargs if event_type == hou.hipFileEventType.BeforeClear: if not hou.hipFile.isLoadingHipFile() and not hou.hipFile.name()=='untitled.hip': print 'clear event %s' % hou.hipFile.name() else: # print 'clear ?' pass print event_type, hou.hipFile.name() if event_type == hou.hipFileEventType.BeforeLoad: print 'before load event %s' % hou.hipFile.name() # hou.hipFile.removeEventCallback( hou.session.hipFileEventsFired) OUTPUTS: hipFileEventType.BeforeLoad X:/temp/saveTest.hip before load event X:/temp/saveTest.hip hipFileEventType.BeforeClear X:/temp/saveTest.hip hipFileEventType.AfterClear X:/temp/saveTest.hip hipFileEventType.AfterLoad X:/temp/saveTest.hip hipFileEventType.BeforeLoad X:/temp/saveTestB.hip before load event X:/temp/saveTestB.hip hipFileEventType.BeforeClear X:/temp/saveTestB.hip hipData deleted X:/temp/saveTestB.hip hipFileEventType.AfterClear X:/temp/saveTestB.hip hipFileEventType.AfterLoad X:/temp/saveTestB.hip
  12. Hi, I would simply ceate a script which creates lock file when a hip is opened for the reason more users should not overwrite their scenes. The lock file should be deleted when a new hip is about to open. So i created a hip event in my scene and check which event is fired (i check the opening hip name). My problem is that I can not fire an event before the new hip is opened ( to clear the lock file ) the event always shows the opened hip not the hip which is being closed. Any idea ? thx!!! G My scripts: ---Registering the event----- hipFileEvent_script = """ def hipFileEventsFired( event_type): import houdini.illessz.events as ev reload( ev) ev.hipFileEvents( event_type) """ hou.setSessionModuleSource( hipFileEvent_script ) hou.hipFile.addEventCallback( hou.session.hipFileEventsFired) ---- The event ---- def hipFileEvents( event_type): # print kwargs if event_type == hou.hipFileEventType.BeforeClear: if not hou.hipFile.isLoadingHipFile() and not hou.hipFile.name()=='untitled.hip': print 'clear event %s' % hou.hipFile.name() else: # print 'clear ?' pass print event_type, hou.hipFile.name() if event_type == hou.hipFileEventType.BeforeLoad: print 'before load event %s' % hou.hipFile.name() # hou.hipFile.removeEventCallback( hou.session.hipFileEventsFired)
  13. i have this geo and i want to apply random textures from a folder hierarchy. i friend of mine helped with some python code, so now i can select a folder randomly and then get the first image of the sequence with a little tweaking i managed to plug it in a quickshade and converting the file numbers to $F4 or $F3. so it should read the sequence BUT!! although i have the iterations attribute of the foreach meta node as a seed for the python script, the same image applies to all primitives. What is missing? Side question: why are the uvs rotating? any tip much appreciated, houdini forums are bit dry right now random_sequences.hip untitled.bgeo
  14. Hi all, I'm trying to make a IK/FK seamless transition. Theres anyone who have done such a thing in houdini that can point me into right direction? My first instinct was to create 3 bones chains. One to bind, other to FK and the last for IK. Since I'm comming from Maya that was my first aproach. Lately I get that I can do all with just one chain of bones and control with a blend when is IK or FK. But I'm lacking os seamless transation. What is the best path to do so? Still 3 chains? One chain is enouph but use python to copy the values? Thank you for the orientation
  15. Hi Houdini friends, I'm having a pretty weird issue right now and was wondering if this is something that someone else has encountered before: When I call a function as a callback to some button on an HDA/ shelf script, the result is different from when I directly call it in the python shell of an opened Houdini session / directly in a hython shell. More specifically, when called as a callback, it hangs; while when called from hython it went through as expected; The function involves some general wrapping code, that execute some houdini specific code, and it seems that any call from the hou module would hang when ran as callback. Does anyone have similar issues before / knows more about what might be different when something is executed as parm callback vs. directly from hython? Thanks soooooo much in advance!
  16. Handling array in Vex

    Hi, In Python, we can create a "quick array" with conditions in a single line: a1 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] a2 = [0, 2, 4, 6, 8] a3 = [i for i in a1 if i not in a2] >>>> a3 == [1, 3, 5, 7, 9] In vex, I know how to do it the long way: int a1[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; int a2[] = [0, 2, 4, 6, 8]; int a3; foreach( int i; a1 ){ if( find(a2, i) >= 0 ){ append(a3, i); } } >>>> a3 == [1, 3, 5, 7, 9] Is there a faster way to do this kind of things, maybe like in Python? Thanks!
  17. Hi, How do I find the name of a node to pass into the 'createNode()' function? I'm following a tutorial, and in it he writes: .createNode(“ifd”) to create a mantra node. But I can't figure out where I find this. I've printed the node using the ‘.asCode()’ function, but I'm not really sure what I'm looking for. Thanks a lot
  18. Iterate in subnet python

    Hey, I have subnet in obj with few geometry nodes inside. I need iterate all geo nodes and find all nulls inside each geo node. How can I make this with python? All I have been trying gave me all null nodes in obj context , but I need only from this subnet. Thanks!
  19. Hi all, I'm writing a little python script to change some geometry values and it's working only if I declare the parameter name. hou.node("../subnet1/").parm("L_ear_shape01") But since I've about 20 custom parameters (could be more), to be passed to a function, the current parameter should be returned as soon as I change it's value, either by sliding the slider or roll the mouse button over it's text field. If there is anything like this it would be great: hou.node("../subnet1/").parm( #CURRENTLY_MANIPULATED_PARAMETER# ) I tried the following code at the very top of the script, but it returned None once. hou.evaluatingParm Is there away to get which parameter is being manipulated?
  20. Hello everyone, I made this tutorial to show a workflow to setup passes for rendering using python. The same can be achieved by the Takes, but I find using python for the task can be quite useful in some cases
  21. Load QT UI from HDA extra file

    Hi everyone, I wonder if someone has already succeed to load a .ui file made with qtdesigner, but the particular case is that .ui file is inside a HDA in Extra Files. I've tried with opdef but it seems to be not working. the command I used was QUILoader().load(path.ui) (and it's working if the .ui file is on disk) Thanks to all
  22. Geodesics in Heat

    Hi everyone! I've made an illustration video-tutorial about the Heat Method application to point clouds by Keenan Crane et al, Yang Liu et al and others.
  23. Hi, Can the Network Editor View be 'placed' without zoom on a node (home) ? I tried the setCursorPosition but not worked. Any Idea ? THX! G
  24. Hi, I'm playing around with limiting transform handles on nulls to act as a rigging control surface. I found on these forums a cool hscript snippet that allows this: clamp(cubic(),min,max). Does anyone know the python equivalent? The python clamp doesn't seem to accept a cubic() as a parameter. Also, does anyone know of another method of allowing for manual transform handle input that feeds into an expression? (HScript or Python). I can't wrap my head around why cubic() works! Cheers Dan
  25. there are 2 nodes, and can we remotely execute a python script by another node, especially def too? For instance, there is a python_target null node. If I click its execute button, it writes C in result as I expect. Then I want to do same thing by a code of another python_remote_control null node. After succeeding controlling remotely, I also like to execute setA() remotely, too. Is that possible?
×