This file contains hidden or 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
#!/bin/env python | |
#****************************************************************************** | |
# | |
# Filename: hook.py | |
# | |
# Copyright (c) 2008 Autodesk Canada Co. | |
# All rights reserved. | |
# | |
# Use of this software is subject to the terms of the Autodesk license | |
# agreement provided at the time of installation or download, or which |
This file contains hidden or 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
# Creates perspective projection in a shader without UVs on the geo | |
# Select the camera to project from, run this, two nodes appear in /mat | |
# [email protected] | |
import hou, math | |
cam = hou.selectedNodes()[0] | |
world2cam = cam.worldTransform() | |
world2camvex = str(world2cam).replace('[', '{').replace(']', '}') | |
aspect = float(cam.evalParm('resx')) / float(cam.evalParm('resy')); | |
haperture = cam.evalParm('aperture') |
This file contains hidden or 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
set cut_paste_input [stack 0] | |
version 10.5 v3 | |
push $cut_paste_input | |
Tracker4 { | |
tracks { { 1 31 1 } | |
{ { 5 1 20 enable e 1 } | |
{ 3 1 75 name name 1 } | |
{ 2 1 58 track_x track_x 1 } | |
{ 2 1 58 track_y track_y 1 } | |
{ 2 1 63 offset_x offset_x 1 } |
This file contains hidden or 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
# Retime a tracked object to better fit a target curve | |
# Select two Transform nodes: the first with a jerky tracked curve, the | |
# second with a smooth target curve | |
# Group effort by Lewis Saunders, Unai Martínez Barredo, Erwan Leroy | |
# Make a function to calculate the distance between two points | |
def distance(a, b): | |
return pow((a[0]-b[0])**2 + (a[1]-b[1])**2, 0.5) | |
# Find the closest point to p on the line ab |
This file contains hidden or 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
set cut_paste_input [stack 0] | |
version 11.2 v1 | |
CheckerBoard2 { | |
inputs 0 | |
format "2048 1024 0 0 2048 1024 1 2048x1024" | |
name CheckerBoard1 | |
selected true | |
xpos -40 | |
ypos -153 | |
} |
This file contains hidden or 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
#!/usr/bin/python | |
# pass: /path/to/scene.hip ropname startframe endframe howmany threadseach | |
# e.g.: | |
# /works/useful/poast/hrender-multi.py /Volumes/fast/nissan/eye/eye_v08.hip mantra1 1 118 16 1 | |
import sys, os, time | |
hipfile = sys.argv[1] | |
rop = sys.argv[2] | |
start = int(sys.argv[3]) |
This file contains hidden or 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
#!/usr/bin/python | |
# Prints a progress bar and stats for a folder filling with files | |
# Pass the path and the total expected count, like: | |
# ./progress.py /path/to/somewhere/ 900 | |
# |UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU | 62% 157/250 0.2fps 6.4spf eta0:09:57 | |
# TODO: | |
# o Data rate stats | |
# o Take a fragment of shell script for custom counting | |
import os, sys, time, datetime |
This file contains hidden or 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
// Create a basis from points of triangle. | |
matrix3 basis_from_triangle(vector p1, p2, p3) | |
{ | |
// Axes vectors. May not be orthogonal. | |
vector X, Y, Z; | |
Z = p2 - p1; | |
X = p3 - p1; | |
Y = normalize(cross(Z, X)) * length(p2 - p3); | |
return set(X, Y, Z); | |
} |
This file contains hidden or 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
from PIL import Image | |
import imagehash, os, sys | |
basenames1 = os.listdir(sys.argv[1]) | |
basenames2 = os.listdir(sys.argv[2]) | |
list1 = [] | |
list2 = [] | |
for (dirn, basen, lis) in ((sys.argv[1], basenames1, list1), (sys.argv[2], basenames2, list2)): | |
for fil in basen: |
This file contains hidden or 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
#!/usr/bin/python | |
import os, glob, xml.etree.ElementTree as et | |
html = open('/tmp/matchboxlist.html', 'w') | |
xmls = glob.glob('/opt/Autodesk/presets/2019.2.1/matchbox/shaders/LOGIK/*.xml') | |
xmls.sort() | |
for xml in xmls: |