This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
class SetScreenLayout(bpy.types.Operator): | |
"""Switches to the screen layout of the given name.""" | |
bl_idname="screen.set_layout" | |
bl_label="Switch to Screen Layout" | |
layoutNamme=bpy.props.StringProperty() | |
def execute(self,context): | |
bpy.context.window.screen=bpy.data.screens[self.layoutNamme] | |
return{'FINISHED'} | |
def invoke(self,context,event): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# POPULATE! | |
# | |
import bpy | |
import math | |
from bpy_extras import object_utils | |
from random import randint | |
from math import radians |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# POPULATE! | |
# | |
import bpy | |
import math | |
from bpy_extras import object_utils | |
from random import randint | |
from math import radians |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import bpy | |
from math import pi, sin, cos, sqrt, atan2, fabs | |
import socket | |
rad2deg = 180/3.14159265 | |
UDP_IP = "127.0.0.1" | |
UDP_PORT = 4950 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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... | |