Jump to content

kishenpj

Members
  • Content count

    51
  • Joined

  • Last visited

Community Reputation

11 Good

About kishenpj

  • Rank
    Peon
  • Birthday 05/21/1994

Contact Methods

  • Website URL
    www.kishenfx.com

Personal Information

  • Name
    Kishen PJ
  • Location
    Montreal

Recent Profile Visitors

612 profile views
  1. hou.hipFile.save but stay in the same session.

    Well, this one works! import os.path as op import hou activeSession = hou.hipFile.name() # Fetch tuple with index of pressed button and input text. choice, text = hou.ui.readInput('Type comments message', help='Type comments description.', title='Commented HIP', buttons=('OK', 'Cancel'), default_choice=1, close_choice=1) # If OK was pressed with some non-empty text. if choice == 0 and text: path = hou.hipFile.path() dir, name = op.split(path) # Discard extension. name = op.splitext(name)[0] # Discard one '.anytext' occurence at the end. name = name.rsplit('.', 1)[0] # Make new name with input text. new_name = '%s.%s.hip' % (name, text) # Finally, create an absolute path to save file to. new = op.normpath(op.join(dir, new_name)) # Save the file. hou.hipFile.save(file_name=new, save_to_recent_files=False) hou.hipFile.setName(path) print "File saved to - " + (new)
  2. hou.hipFile.save but stay in the same session.

    Might be a problem if the file size is big but this is a good workaround! ....and the only choice i guess.
  3. Hello! I came across this super useful script by F1 few weeks ago which allows me to save hip files with comments. But i'd like to know if there's a way to save a scene while staying in current session. (i.e a new file save but stay on the current hip file) import os.path as op import hou # Fetch tuple with index of pressed button and input text. choice, text = hou.ui.readInput('Type comments message', help='Type comments description.', title='Commented HIP', buttons=('OK', 'Cancel'), default_choice=1, close_choice=1) # If OK was pressed with some non-empty text. if choice == 0: path = hou.hipFile.path() # Replace existing comment. if text: dir, name = op.split(path) name = op.splitext(name)[0] name = name.rsplit('.', 1)[0] name = '%s.%s.hip' % (name, text) path = op.join(dir, name) path = op.normpath(path) hou.hipFile.save(path) print(path)
  4. Shelf tools & scripts collection

    #Add Null node by pressing 'N' key selected_nodes = hou.selectedNodes() for node in selected_nodes: parent = node.parent() name_node_selected = node.name() null = parent.createNode(‘null’,’OUT_’ + name_node_selected) null.setInput(0,node) macolo = hou.Color((0,0.5,0)) null.setColor(macolo) pos = node.position() null.setPosition(pos) null.move([0,-1]) #flags null.setSelected(True,True) null.setDisplayFlag(True) null.setRenderFlag(True) Credit-Florian Bard
  5. 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)
  6. Manual cook on open/save

    Awesome! I've found this btw http://www.sidefx.com/docs/houdini/hom/locations but beforescenesave.py seem to work only for H16. I'm stuck with H15.5 for now and http://www.sidefx.com/docs/houdini15.5/hom/locations doesn't say anything about scripts before or after saving the hip file.
  7. Manual cook on open/save

    Oh ya, now it works. Thanks! hou.setFrame(1) hou.setUpdateMode(hou.updateMode.Manual) hou.updateModeSetting() Now, how do i tell houdini to always save with manual mode and shift to $FSTART? I think it's better to save hip file in manual mode instead.
  8. Manual cook on open/save

    Hey guys! On opening or saving any scene file, i want houdini to shift to frame $FSTART and turn to manual cook mode. So i know houdini needs a 456.py file in its home directory but i need help with the code. I've manged to find some help from other forums and ended up with this, which obviously doesn't work Badum Tss! hou.setFrame(1) hou.setUpdateMode(hou.updateMode.Manual) hou.updateModeSetting() hou.updateMode.Manual
  9. Impact Data from Particular Object Id

    http://forums.odforce.net/topic/29085-impact-glue-interaction/ - This might help. Cheers!
  10. Convert Scatter Point to 3D-Triangulation

    Try tetrahedralize. scatter points to first input, geometry to your second. VDB from particles > convert VDB is another way. Cheers!
  11. Your setup seems to work in H15. Don't know whether i'm missing something or it's a bug! I can suggest a workaround; 'attach to body' from the cloth shelf tool. works pretty well with FEM. Cheers! FEM_break_wa.hip
  12. Why Do Dop Points Move From Frame 1 to 2?

    Switching off the centre of mass for packed objects appears to solve the problem. But i'm not sure how much it affects when it comes to complex simulations.
  13. curve hair randomize density

    https://youtu.be/7bRr38S59i4 https://youtu.be/w2X6-LzITr8 This 2 tutorials might help you. Cheers!
  14. Particle attribute changes of any kind goes into second input. In your case of lava velocity, temperature, viscosity. Volume based changes (vdb collisions) in your case of bubbles goes to third input. The fourth input, i only use for sourcing but nothing else and this setup works for me very well. Take a look at the link, works pretty good for lava as well and ofcourse ben watts lava tutorial. Cheers! https://youtu.be/yZ70SR9xHUE
×