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
    • 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. I know basic python scripting in houdini so this question is easy one. I have a shelf tool, when clicked runs a python code. I want that tool to ask for a number when clicked and use it in the script. basically, I want to select a node and click that shelf tool to ask for a number, when given that code should copy and paste (duplicate) that node the number of times which is entered. i know i will have to use copyNodeTo function in python, just want to know about getting user input. Thanks!
  2. Hi! Cant find information about how to create empty folder with python inside digital asset parameters. I have a python callback script and at the end i'd like to create folder named, for example, Animation. Just it right now, no parameters inside, only empty folder inside asset. Did anyone know how to make it? That's what i am talkig about.
  3. Hi, I'm attempting to create a digital asset via python scripting and would like to set up some of the parameters and interface as part of that process. I've had success creating parameters and arranging the interface for normal nodes (spare parameters), but taking the same sort of approach with an asset only appears to be half working. Here is my debugging example code: hou.hipFile.clear() # just whilst we're testing; do a fresh start objNode = hou.node('/obj').createNode('geo') objNode.setName('myAsset') if objNode.canCreateDigitalAsset(): objNode = objNode.createDigitalAsset( name='test::myAssetA', description='myAsset', hda_file_name='/tmp/foo_v001.hda', ) parm_group = objNode.type().definition().parmTemplateGroup() first = parm_group.findFolder('Transform') folderTemplate = hou.FolderParmTemplate('myFolder','My Folder') buttonTemplate = hou.ButtonParmTemplate('myButton','My Button') folderTemplate.addParmTemplate(buttonTemplate) parm_group.insertBefore(first,folderTemplate) objNode.type().definition().setParmTemplateGroup(parm_group) What I'm hoping to do here is create an asset, add a folder as the first item in the interface, and add a button to that folder. Like I said, this sort of seems to work - if I then go to the Edit Opertator Type Properties dialog I see the parameters listed as expected. Weirdly though, all the pre-existing folders are now renamed to match the new folder I added (i.e. myFolder_1,myFolder_2 etc). Then when I look at the interface in the parameter editor, 'myFolder' appears as a check box instead of a folder and the custom UI elements are drawn last rather than first. (see attached screen grab). So, the question is - am I going about this the wrong way (likely), or do you think this might be a bug (happy to log if so)? cheers Ben
  4. Hi guys, This has boggled my mind for a while now. I have a OTL that has a tool script attached to it (Type Properties > Tool section), that evokes a PySide interface. The problem is that when I run the tool a few times, every single time a new instance of the interface is being opened, while the old one is still alive. So I'm ending up with lots of open windows of the same tool after a while which is super annoying. How can I prevent this from happening? I want to have only one single instance running at a time, basically close the old window if the tool is run again. Here's a really simple example that we could use as a test case. (Same problem if I run it as a shelf tool) from PySide import QtGui, QtCore class Window(QtGui.QWidget): """Simple Test""" def __init__(self): super(Window, self).__init__() self.setGeometry(50, 50, 500, 300) self.setWindowTitle("test") self.home() def home(self): btn = QtGui.QPushButton("Test Button") a_label = QtGui.QLabel("Test Label") qvbox = QtGui.QVBoxLayout() qvbox.addWidget(btn) qvbox.addWidget(a_label) qvbox.insertStretch(2) self.setLayout(qvbox) def run(self): self.show() main = Window() main.run() Some where I read that using the QEventLoop might help to detect running instances with hou.ui.eventLoopCallbacks(), but after trying some stuff for a few hours, I'm at my wits end. Help here would be much appreciated Thanks!!!
  5. Hi - I've got a feeling I'm coming about this from the wrong angle, but does anyone know if it is possible to programmatically export a subnet as an digital asset, without actually turning it into an asset? I'm looking for an equivalent to hou.Node.createDigitalAsset(), but which doesn't turn the source into an asset in the current session. Something like exportAsDigitalAsset().... If this seems backward or bizarre, please do say and I'll elaborate on the motivations. See if there's a better way of coming at it. thanks Ben
  6. Python Save Event Callback

    EDIT : I figured I would change the title so it will be possible to find this later... .......................................................................................................................... Yea... Whats up with that? I thought 123.py is supposed to run every time one launches Houdini, but it only runs when I launch Houdini into an empty file). I.e. C:\Program Files\Side Effects Software\Houdini 15.0.298\bin\houdinifx.exe without command args runs 123.py but with say I run it with $HIP\pythonToolsTesting.hip as a command arg it doesn't run 123.py. Is that right? If so how can I append a path to look for a python module then? ....EDIT: Okay Nevermind So just use 456.py right?
  7. Hi there! I've been scripting in Maya for some years now and I decided to give Houdini a try but I still have some issues understanding how cooking works. I'm trying to implement my own cellular automata (a classical 3D Game of Life). The algorythm is pretty simple: my class first generates a virtual 3D grid which is made of livings cells (1) and dead cells (0). Then, at each iteration of a custom user input parameter, it analyses the current grid and does some work to modify it. But I have a hard time figuring how to do this. How can I have my script memorize its current state at each frame? For now the node just cooks entirely at each iteration, which is obviously pointless. Is there a way to execute only one method of my class? I thought about using a callback on the iteration parameter but I can't understand how it works in Houdini (I just made a "New Operator Type" and wrote my script inside the "Code" tab). Sorry if this sounds stupid, I'm still learning! And I couldn't find anything useful on Google.. Thanks in advance for your help!
  8. Access Node's Icon by Python

    Hi, Is there a Python way to grab a nodes icon directly from houdini to use as an icon in a PyQt4 QTreeWidget or similar? Would be nice to add them for when I'm displaying a tree of nodes. Cheers!
  9. Rename label in multiparm list.

    Yo, I have perfectly working dynamic multiparm list. I get all the values and params ect. only thin I can`t find is how to rename the labels of the parameters!! I`m doing it in a python callback. Sounds so simple, but I`m new to Houdini(ex-softie) so simple things can be hard haha Thanks a bunch, - J
  10. Hello, what I would like to do is very simple, just for an exercise. I would like to run Houdini from a Python script using the hou module. What I am trying to get working is something like: import sys import subprocess sys.path.append('/opt/hfs15.0.244.16/houdini/python2.7libs') import hou hou.hipFile.load(file_name='/home/ramon/hello.hipnc') sf_geo = hou.node('/obj').createNode('geo') But I get no UI. I could do subprocess.Popen(['houdinifx', '/path/to/hipfile.hpnc']) but it creates deatached from the python script. Maybe should I create it first through shell (subprocess.Popen) and then load it using hou.hipFile? and start playing with it inside the python script? I would like to have a self-contained example. Just a python file that the user just runs like python script.py no more. Thanks and sorry for the stupid question. EDIT: I think I found out what I was looking for... haha... now i can compile vfls using Popen subprocesses and import them afterwards and doing everything in a self-contained file. cool. import sys import subprocess sys.path.append('/opt/hfs15.0.244.16/houdini/python2.7libs') import hou hou.hipFile.save(file_name='/home/ramon/hello.hipnc') hou.hipFile.load(file_name='/home/ramon/hello.hipnc') sf_geo = hou.node('/obj').createNode('geo') hou.hipFile.save(file_name='/home/ramon/hello.hipnc') subprocess.Popen(['houdinifx', '/home/ramon/hello.hipnc'])
  11. Junior FX TD / ATD

    Hi all, I am currently looking for a position as Junior FX TD / ATD (Assistant Technical Director) - either or a combination of both. Preferably in the London area but I am interested to hear about other locations as well. I have MA degrees in Game Art and Digital Effects (Bournemouth University NCCA), as well as a combined 2,5 years of work experience in the Game and VFX industries. Aside from my FX work I have been in ATD training at Double Negative Visual Effects in London, which I have successfully completed. This covered artist workflows for matchmove, layout, animation, fx and lighting, as well as the proprietary publishing system, disk cleanup, render wrangling, artist support, and python development for show artist tool creation using internal APIs. Within python development specifically, we covered python, PyQT, as well as code management and deployment using Git, Stash and Jenkins. I built a number of small tools for Maya, Houdini and Linux as per training, as well as automation scripts to decrease workload. Please contact me via e-mail should you wish to get in touch about possible opportunities: timothystam@hotmail.com My portfolio (with resume) and showreel can be found here: portfolio: www.timothystam.com showreel:
  12. Advanced Houdini Programming Course

    Hi Houdini enthusiasts! , I'm very exciting to say that we are ready to start our course in english! Houdini Tool Development was very successful in Russian language, and we get a lot of requests from our foreign friends to make an english version.So here is a little demo i've recorded to show you what to expect from this amazing course https://www.youtube.com/watch?v=ITa33iMpePY&feature=youtu.be This course will be 4 month long and contains 16 video lectures. One lecture per week. Each lecture - 3-4 hours long. Each Monday, starting from 21 Sep. new lecture video will be uploaded and link will be shared with you. Skype Group will be created where you can ask questions any time on weekdays. Detailed program: here UPDATE: For those of you guys interested only in HDK part of this course, it is possible to apply only on that part. Just contact us via email and you'll be on board right away.
  13. Houdini Tool Development

    Great news from School Online VFX! We are going to start English group on the program Houdini Tool Development. The first lesson is beginning on September 19th. This program will be useful for technical specialists, engaged in Pipeline construction, instruments creation, technology development, etc. We are waiting for houdini VFX artists, especially FX TD and all Houdini artists, who want to explore Python and improve the quality and productivity of their work. See details and videos: http://onlinevfx.ru/course-and-masters/142-houdini-tool-development-eng
  14. Python Shelf Btn Script With Simple UI

    Hi there! I wrote a couple lines of python code that lets you export Houdini point attributes to an xml file. And then another couple of lines that reads the xml file in Maya. Useful for getting Houdini point colors to vertex colors in Maya, and possible other things to. I thought I would create a simple UI for the Houdini part of the script that has a couple of user defined parameters. But after searching for a while I still don't have a clear idea what's the simplest way to do this. I've attached a image of what the UI could look like. If this was a scripted python Digital Asset then I would get the UI for free, it feel like this shouldn't be that hard either. To do this in Maya, with Python or Mel isn't that tricky either. If it's possible I would like to avoid using PySide & PyQt. I've been looking the the hou.ui module but I don't really understand, I read somewhere that one approach is to load a UI description from a external file. What is common practice here (for simple UI's & dialogs)? Thanks / John
  15. Hi. With Visual Studio 2015 released with Python Tools... did anyone succeeded to setup Hython Environment for Python development so it would display more than one level deep of help? With this setup I get standard one "." level deep help: Thanks!
  16. Effects Demo Reel 2015

    Hello Everyone! I just wanted to share my current demo reel! https://vimeo.com/111437682
  17. I am trying to create a primitive group with using a syntax something like this; n = hou.node('/obj/geo1/grid1') g = n.geometry() p = g.createPrimGroup("myGroup") I get an error when I do the last line. What is the way to create primitive or point groups with python, if I just want that group to have all the prims/points in that geometry? Thank you for the help, Alican Görgeç
  18. Dennis Albus | Technical Reel 2015

    This is my Technical Reel with some of the things I've been working on lately - mostly focused on lighting, shading and rendering. Please go to vimeo and watch it in HD as a lot of stuff is really hard or impossible to see in the SD version. Feel free to also check out my other work on my website (95% Houdini / Mantra) www.dennisalbus.com/portfolio The Blog is unfortunately a graveyard right now but I am planning on posting regular updates and information about some of my tools and shaders soon. Cheers, Dennis
  19. Hi! I have a problem with what strikes me as a simple task. I made this simplified test setup (see image): 4 boxes in a geometry node all going into a merge node. I select the merge node and run the following python script from a shelf tool (Don't bother about the purpose of this... This is only to show my problem): myMerge=hou.selectedNodes()[0] toDel = [] myBoxes=list(myMerge.inputs()) print(myBoxes[0]) toDel.extend(myBoxes[0]) This will fail at the last line that is supposed to add a single member of the myBoxes list to the toDel list. It throws the error in the second image. What bothers me is that the print statement works appropriately but for some reason, the same structure doesn't work to add the item to the list. Am I just missing something?? Thanks!
  20. Hey guys, Im digging at python outside the normal hom model from houdini, which modules u guys use daily Im studying around these, glob, subprocess, sys, Qtcore, shutil, which one I need to add to my study list. Thanks Wanderson
  21. I need to create a medieval crowd, anyone have information tutorials or ideas to customize a agent like that? Thanks wanderson
  22. Updating menu items with python

    Hi! I'm trying to find a way to read a config when a button is pressed, and update the available items in a menu parameter. I've tried a couple of methods, but haven't managed to get anything to work yet. First Attempt: target_menu_items = ["a", "b", "c"] menu_parm = node.parm("menu_parm") template = menu_parm.parmTemplate() template.setMenuItems(target_menu_items) The interface remains unchanged. Reading the docs that is understandable: So I tried what the docs recommended without any luck: ptg = node.parmTemplateGroup() menu_parm = node.parm("menu_parm") template = menu_parm.parmTemplate() template.setMenuItems(target_menu_items) ptg.replace("menu_parm", template) node.setParmTemplateGroup(ptg) I had some success by adding a line, but this isn't really a solution. template.setName("bahhumbug") I assume it's failing to replace the template if the name of the replacement template matches that of the existing one. I don't understand why that would be a problem though. I've had a thorough Google and can't find any examples of this... so I'm worried I'm approaching it the wrong way. Can anyone explain where I'm going wrong? Many many thanks in advance, Dan
  23. Qt widgets and Custom Shelfs using python

    Hi, I´m looking to integrate Houdini inside our custom pipeline. We already have a pipeline script working inside Maya and I´m trying to replicate it in Houdini. I started with interface creation with Qt and Pyside. I´m in the early stages but already have some doubts. In maya I can create a shelf panel, add some icons and integrate to my script. I´m trying to do it inside qt using buttons with icons but the result is very ugly. So, It´s possible to create these kind of special houdini panels with a qt interface? Somebody has some tutorials or docs about custom interfaces using python in houdini? I couldn´t find anything more than this Masterclass on vimeo. Thanks
  24. I'm using a small python script to open a hip file, "do something" , save, and press the button "render" on the proprietary node that sends the job on the farm. Of course this all happens without ui, so my script errors out cause somewhere there is some python code that uses hou.ui.setStatusMessage, and I guess hbatch doesn't load the ui module. This is the error I get: hou.ui.setStatusMessage( "Creating the render data", hou.severityType.Message) AttributeError: 'module' object has no attribute 'ui' This the script: import hou hou.hipFile.load("myfile.hip",True) <change parameters and do interesting stuff> print ("submitting job on the farm\n") farmrender=hou.node("/out/farm_render") farmrender.parm("FarmRender").pressButton() print ("done\n") hou.exit() and this is the error message ... hou.ui.setStatusMessage( "Creating the render data", hou.severityType.Message) AttributeError: 'module' object has no attribute 'ui' I already tried to execute the actual code contained in the button, but I get the same exact error. Is there any way to suppress any call to hou.ui when a script is executed via hbatch ?
  25. Hi, When I select points from the viewport, how do I get a value of point attribute in python? I wrote a beginning like this: 1 import toolutils 2 viewer = toolutils.sceneViewer() 3 selection = viewer.selectGeometry('Get Ids From Select Points',geometry_types = [hou.geometryType.Points]) but I don't know how to continue this. thanks Shawn