Skip to content

Instantly share code, notes, and snippets.

@howiemnet
howiemnet / Houdini-->Fusion animation exporter thingy.py
Last active January 14, 2024 20:48
Early version of Houdini to Fusion animation exporter
################################################################
#
# h's hacky Houdini --> Fusion camera animation exporter
#
# Last mod: 20/3/2020 / h@howiem.net
#
#
#
#
# Notes:
@howiemnet
howiemnet / AE_to_Houdini.py
Last active September 23, 2023 14:34
First attempt at getting AE camera data into Houdini (hacky woo)
# Ultra quick'n'hacky AE camera animation importer for Houdini.
# Create a new shelf, create a new tool, paste this into the script box.
#
# In AE, select the Orientation and/or Position keyframes, and Ctrl/Cmd-C them to the clipboard
# Open a new text file (Notepad or Textedit) and paste the clipboard contents in. There's your keyframes.
# Save the text file somewhere and amend the filename line below to suit
# In Houdini, create a camera (it's up to you to set the same zoom / aperture as the AE one).
# ... and run this script (well, press the shelf button you stuck this on)
@howiemnet
howiemnet / DAWmidi.py
Created May 29, 2019 10:39
Houdini control from a Behringer X-Touch One using pygame
# h's super dodgy, super-hacky MIDI controller for Houdini code
#
# Designed to get a Behringer X-Touch One controller to control Houdini
# while feeding back current frame and status to the lights and readouts
# on the controller. Super cool.
#
# But this really, really, shouldn't be public. My Python-fu is a little raw.
# But it may give someone a useful starting point...
@howiemnet
howiemnet / highlighter.html
Created May 17, 2023 14:06
Hacky JS file hilighter - takes a URL to a JS file (in the querystring - add ?file=https://url.to/my/javascript/file.js) and renders it nicely... -ish.
<!DOCTYPE html>
<html>
<body>
<div style="font-family: sans-serif; font-size: large; width: 100%; padding: 10px; margin:0 0 30px 0; border: 2px solid black;" id="titlebar"></div>
<div id="myDiv">
</div>
<script>
// h quick util: takes a querystring URL - ?file=URL_to_JS_file and renders out as hilighted JS
@howiemnet
howiemnet / Particle resizer.vex.cpp
Last active July 11, 2022 18:04
Houdini Particle distance resizer
// NOTE: ignore the .cpp extension on the filename - this is VEX
// but I couldn't find a gist-friendly way to syntax-hilight it
// ¯\_(ツ)_/¯
//
// h's magic adaptive point resizer for optimal
// rendering of tiny points/particles/wires
//
// 1/2/2018 h@howiem.net
// CC-0 - use and abuse
@howiemnet
howiemnet / Hacky_Houdini_to_AfterEffects.py
Created July 27, 2017 10:14
Houdini to After Effects animation exporter thingy
# first hacky attempt at getting camera / object animations into AE from Houdini.
# Stick this on a tool button on a shelf. Note the hard-coding below (!)
# A file will be created in your home folder; open it, copy to the clipboard, then go to AE and paste onto the cam/null of your choice
import hou
h = hou.node("/obj/geo1")
filename = "testfile.txt"
startFrame = 0
@howiemnet
howiemnet / Houdini - copy camera animation data to clipboard.py
Created November 7, 2018 06:01
Houdini to AE camera animation clipboard exporter (now with Zoom! Woo!)
# Houdini to After Effects camera animation exporter
# This version: 7/11/2018, by Howard Matthews - h@howiem.net
# Copyright: CC-0 - use and abuse. Please pass on the knowledge.
# Note: there's no error-checking in this script, but it alters nothing within the Houdini scene, so it'll just
# fail with an error if you try running it without a camera selected. No harm done.
import hou
theNodes = hou.selectedNodes()
@howiemnet
howiemnet / houdini_to_blender.py
Created August 22, 2019 15:31
Houdini to Blender camera animation exporter
# Houdini to Blender camera exporter thingy
# h@howiem.net / 22 Aug 2019
#
# v1.0: hacky but seemingly working
#
# Pop this into a toolbar button's script window in Houdini
# Select a camera (or a camera switcher) and press the button
#
# A newly generated python script is now on the clipboard.
#
@howiemnet
howiemnet / infinity_blur.js
Last active January 7, 2019 04:58
Blur objects at infinity depending on camera settings - After Effects expression
//
// This expression, applied to the blur radius of a Lens blur effect, will calc the right amount of blur
// to apply to objects at infinity (eg star fields) depending on the focus dist / aperture of the current active camera
//
// For safety it maxes out at 100 px (!)
//
try {
focLen = (thisComp.activeCamera.cameraOption.zoom * 102.05) / thisComp.width;
blurDiam = (focLen * thisComp.activeCamera.cameraOption.aperture) / (thisComp.activeCamera.cameraOption.focusDistance - focLen);
Math.min(100,Math.abs(blurDiam)/2)
# Motion export script
rad2deg = 180/3.14159265
import bpy
import math
from math import sqrt
sce = bpy.context.scene
saveFile = open("/Users/h/Documents/BlenderPlayback.csv","w")