Advanced Search
Search Results
37 total results found
Transforms and Junk
1. transforms to attribute matrix: p@orient = quaternion(3@transform); v@scale = cracktransform(0,0,2,set(0.0.0). 3@transform); 2. rotate packed fracture based on point + distance: vector p1= set(@P.x, @P.y, @P.z); vector crack1 = point(1, "P", 0); v...
Get frame range from alembic
import _alembic_hom_extensions as ahe; import hou; anode = hou.pwd(); cam = anode.parm("camera").eval(); fpath = hou.node(cam).parm("fileName"); ver = fpath.eval().split("_")[-1].split("/")[0]; print(ver); name = hou.node(cam).children() ; print(name[0]); anod...
Example On Node Buttons
This is how a button on a non-adminned node needs to be laid out: import hou ; do something ; This grabs frame range from supplied alembic camera, updates names, etc: import _alembic_hom_extensions as ahe; import hou; anode = hou.pwd(); cam = anode.p...
Hardware encoding
Intel example command: ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi -vaapi_device /dev/dri/renderD128 -i "${invid}" -codec:v h264_vaapi ${invid%.}_testHW.mp4
PDF to one image
convert in.pdf +append out%d.png sudo apt install imagemagick If convert is broken, update policy: # Open the file sudo nano /etc/ImageMagick-6/policy.xml # find and edit the line <policy domain="coder" rights="none" pattern="PDF" /> # to : <polic...
Send to Tops
import hou nodes = hou.selectedNodes() topnet = hou.node("/obj/topnet1") for x in nodes: name = x.name() fstart = x.parm("f1").eval() fend = x.parm("f2").eval() ver = x.parm("version") path = x.path() topcache = topnet...
Set Frame Range without Script
import hou; anode = hou.pwd(); start = anode.parm("framemin").eval(); end = anode.parm("framemax").eval(); hou.playbar.setFrameRange(start, end); hou.playbar.setPlaybackRange(start, end)
ROP
PostRender open MPLAY: import os; img_path = "`chs("picture")`".replace("$F", "\*"); os.system("mplay %s" % img_path)
Install Ubuntu in distrobox
Install Docker first: # Add Docker's official GPG key: sudo apt-get update sudo apt-get install ca-certificates curl gnupg sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/k...
Pull version from hipname
Can be used in a parameter. Returns a integer. import hou, re version = re.findall('_v\d+', hou.hipFile.basename())[0] version = int(re.findall('\d+', version)[0]) return version
One off shelf scripts
Version up sops that have a "version" parm - I use this to version up a lot of exports in tops or rops: import hou nodes = hou.selectedNodes() for x in nodes: ver = x.parm("version").eval() + 1 x.parm("version").set(ver) Send a ROP fetch to TOPs name...
Orientation
Get transform and orientation from camera: string camera = "/obj/alembicarchive1/Camera2/CameraShape2"; // path to your camera @P = ptransform(camera, "space:current", {0,0,0}); @N = ntransform(camera, "space:current", {0,0,-1});
Get Frame Size of Image File
node= hou.pwd(); bg=node.parm("image").eval(); res=hou.imageResolution(bg); node.parm("framesizex").set(res[0]); node.parm("framesizey").set(res[1]);
Create Agent from built in mocap rig - Simple
This will take a test mocap rig 3 built in to houdini, create an agent, add agent clips from the built in library (must be in your scene already), and lay everything out. import hou obj = hou.node("/obj") agentname = hou.ui.readInput("Agent Name", title="N...
Send selected nodes to new object (fancy way to create object merges)
import hou nodes = hou.selectedNodes() destnode = hou.node(hou.ui.selectNode(title="select destination node")) for x in nodes: name = x.name()+"_"+str(x.parent()) path= x.path() objmergenode = destnode.createNode("object_merge") objmerge...
Send nodes to new alembic export
import hou nodes = hou.selectedNodes() destnode = hou.node("/obj/EXPORT") if not destnode: destnode = hou.node("/obj").createNode("geo") destnode.setName("EXPORTS") for x in nodes: name = x.name()+"_"+str(x.parent()) path= x.path(...
TOPs - symlink output file of parent
exportFile = str(work_item.expectedInputFiles[0]) dir = os.path.dirname(exportFile) newFile = os.path.join(dir, "cache.abc") os.symlink(exportFile, newFile)