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

  1. Matcaps selector

    Hi, In my path of learn python I did this simple tool which creates a HDA to select and assing a matcap to one object. Basically opens a folder selector interface and creates a matcap material (from game dev tools) . The material is assigned to the selected objects and generates an slider where you can choose one of the textures stored in the folder. The max value of the slider is adjusted relative to the number of textures existing in the folder. It's pretty simple tool but I struggled a bit how to approach the best solution and how to store global variables and retrieve it from other part of the code. I don't know if this is the best way to do this, probably there are other solutions more direct and clever, but it has been a good learning exercice. Would be nice if you can test it and give me any advice. The download link is in the description of the youtube video. Thanks, O.
  2. Python setHSV

    Hello I`m stuck with setting correct color to nodes. I would like to set value with HSV. I want to do slight automatic gradient when I creating nodes in network box this one work in RGB: my_list = [nullA, nullB, nullC, nullD] loop = 0 nodePos = -1 for node in my_list: node.setColor(hou.Color(0.3, 0.5 * loop, 0.8)) node.setPosition(hou.Vector2(0, loop * nodePos)) loop += 1 but cant find the way how to set values with HSV, from doc should be something like this: my_list = [nullA, nullB, nullC, nullD] loop = 0 nodePos = -1 for node in my_list: node.setColor(hou.Color().setHSV(50, 0.5 * loop, 0.8)) node.setPosition(hou.Vector2(0, loop * nodePos)) loop += 1 Thanks for help, Jan
  3. Hi everyone, Does anybody know how I can set an HDA's parameters with an external Text or Python File? For example how would I change the sizex and sizey parameters of a Grid SOP in the HDA. Thank you, I appreciate any help! - Von Doom
  4. Python Tic Tac Toe Game

    In the process of explore new ways to use python in Houdini I decided to do the Tic Tac Toe game. It's a classic when one wants to learn how to program a game and I had a good time trying. I surprise how houdini is open enough to do silly things like this and how it is becoming my favorite tool ever. In the way of typing clean and short code, I struggled with a simple but as efective AI I could. ( it's a simple test of machine wins in the next move if not, test if player wins at the next move if not, makes a random move). Actually is a very boring game, as said in the 80's movie of "War Games", because nobody wins eventually. I tryed and I just barely won two or three games in a row. Please, let me know how many game you won in a row ( score points). HIP file in youtube video description. Thanks for testing it !! Oscar
  5. Hi, I am specialized in Houdini FX, Simulations (flip, pyro, RBD Bullet), VEX and Python scripting also a good experience in lighting and compositing. Currently based in Shenzhen, China (willing to relocate worldwide). you can checkout my vimeo for my work and contact me on LinkedIn. Available for freelance/full-time Houdini FX work and Houdini pipeline development. Thanks, Mahesh MS. vimeo: https://vimeo.com/maxcolor/ LinkedIn: https://www.linkedin.com/in/maxcolor/ email: msmahesh@live.com
  6. resizable pyside widget

    hi, i need some help with resizable widgets. it seems the window wont redraw the window canvas. i tried to resize the window with a event(second picture), but nothing worked. the .ui comes from QtDesigner. do i have to set some flags? is it possible at all? i appreciate your help, thx. nic.
  7. python folder creating

    Hi, I'm trying to make folder structure from python... there is a renaming problem I'm facing... How do we can make "vnc_001.......vnc_015", please check the image attached, I strongly required only 3 numbers at the end...
  8. I just did a Python script to create a sphere only with nulls. Actually can be done any shape you want. Here the video with the HIP file included: I know, it's a completely useless and silly project, but was fun to do. Any comment will be welcomed, Oscar
  9. Hi, Can a Shelf Tab set visible for the current Desktop in Python ? THX!
  10. Hello, i think this will be simple for someone more experienced. i have two vector primitive attributes and i want to write them in a text file so-------> v1.x, v1.y v1.z, n1.x, n1.y ,n1.z , v2.x, v2.y v2.z, ....etc for each primitive this is how far i am now ############# READ ATTRIBUTES ###################### for prim in geo.prims() : pos = hou.Vector3(prim.attribValue('pos')) dir = hou.Vector3(prim.attribValue('dir')) data = str(pos) + "," + str(dir) ############# WRITE TO TEXT FILE ###################### myfile = '$HIP/lattice.txt' with open(myfile, 'w') as f: for item in data: f.write("%s\n" % item) spits out this nonsense, splits every character to a new line [ - 1 7 5 2 , - 1 1 9 . 0 3 , 1 4 6 4 ] , [ 0 , 3 0 . 9 0 1 4 , 0 ]
  11. 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
  12. Get list of rcently opened HIP files in Python?

    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...
  13. 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!
  14. 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()
  15. 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("???")
  16. 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
  17. 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?
  18. 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?
  19. 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,
  20. 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?
  21. 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
  22. 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)
  23. 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
  24. 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
  25. 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!
×