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

  1. 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?
  2. 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,
  3. 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?
  4. 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
  5. 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)
  6. 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
  7. 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
  8. 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!
  9. 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!
  10. 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
  11. 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!
  12. 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?
  13. 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
  14. 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
  15. 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.
  16. 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
  17. 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
  18. 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?
  19. Hi, I am studying python to set a parameter of string (cachePath) by script. After executing the code, ideally it pastes original, "`chs("resouceA")`_`chs("resouceB")`", instead of expanded result "G:/Projects/RnD_000_001/geo_element " So far, I am thinking two methods: A a = r(\"\`chs(\"resouceA\")\`_\`chs(\"resouceB\")\` ") # this way is too many back splash and so confusing B resA = hou.node('.').parm('resourceA').unexpandedString() resA = hou.node('.').parm('resourceB').unexpandedString() a = resA + resB # this way is ok, but when there are 5-10 parmeters, it would be too much work. Do we have a simplest way or special command?? Ideally something like this: a = unexpandedExpression("`chs("resouceA")`_`chs("resouceB")` ") Thanks
  20. Hi, i checked all older threads but i still dont find a way to link houdinis python to my anaconda python environment in the houdini.env file I tried LD_PRELOAD ="/Users/userX/anaconda2/lib;&" LD_LIBRARY_PATH PATH didnt find the (in one thread mentioned) libpython2.7.so either using python 2.7.16 on mac os Thank you for your help!
  21. Hi Houdini friends, It seems that the flipbook lockfile name changed from 17.0 to 17.5? The hostname was using the one without the domain in 17.5, e.g. it is now .flipbook_lock.<hostname_with_out_domain>-<session_name> Is there a way / an env variable that is stored for this? trying to get it from socket.gethostname() or platform.node() would all produce the full host name with domain, and there seems to be only "HOSTNAME" in env related to this, which is also the full host name with domain. I could try to see if this lock file exists by wildcarding the domain, but just wanted to make sure that there might be a better way to know this for sure? Thanks so much in advance! - Viola
  22. Hi everyone, I hope someone can help me. I have a rather length piece of code set up in python that works great in 16.5. However I'd like to make the switch to 17.5 The error's I'm getting are: Error Python error: Traceback (most recent call last): File "", line 221, in File "", line 191, in newyarn File "", line 179, in poly2polys File "", line 122, in strands TypeError: slice indices must be integers or None or have an __index__ method Are these easy to fix changes, or has there been a big change between versions?
  23. Hi all, I recently found this Toolset on Github allowing realtime input & record of input from a leapmotion controller. https://github.com/arqtiq/HouLEAP Unfortunately I'm having a little trouble getting it to run properly. In the readme it explains to 'simply copy the content of the **/houdini16.x** folder to your houdini home/hsite folder.' So my question is, where would be the correct place to place the python scripts that the tool provides? (I'm not entirely sure what the 'hsite' folder is referring to?) Houdini see's the OTL's however i return the attached error in, what i assume, is the python scripting. Or perhaps I need to define LEAP in the .env file? Any tips much appreciated EDIT: The error is reported from the example .hip contained in the Github repository linked in my post. Also This was run in H 17.5.258.
  24. Start Orientation Picking

    Hi everyone, is there a way to get this command in python? Start Orientation Picking, i was searching in all documentation, here is nothing about it. Maybe at least somehow to recreate this function, anyway what i need is to create an object and immediately place it on any surface or point. Would be awesome to scale it and rotate it on the same time without release LMB, but i know is fantastic. i was trying to use selectOrientedPositions, thought maybe it will give me the normal of the polygon which i picked in matrix, but no, its just matrix between this new created points would be ideal to have such tool, so im trying to make it, or similar one i actually made some similar some time ago but its fake and not so good, i used some tricky stuff to make, not correct one =) and its using the input geometry, not so useful when you have a lot of geometry and want to create on geo level these objects here is this tool if you interested in https://drive.google.com/file/d/1VabGmzkV_afqQdAteFuXwlEMVL2HMIwB/view
  25. Hello guys, I'm trying to create two different parameter folders on a node. These two folders would be created by two different python nodes with the hou.FolderParmTemplate() method. Unfortunately when I try to achieve this, the second folder created doesn't get its name set properly. It sort of automatically takes an incremented name of the first folder created, even though it has a distinct name set in the hou.FolderParmTemplate() method. Any idea as to why this is happening and how to resolve it? I've attached a file, a simple setup of what i'm trying to do. There are three nodes : a null on which i'm trying to create two separate folders and the two python nodes that generate the different folders. If you run both of their codes and then go in the Parameter interface of the null, you'll see the second file hasn't been properly named. Many Thanks.
×