Skip to content

Instantly share code, notes, and snippets.

View K240-zz's full-sized avatar

Hideki Suzuki K240-zz

View GitHub Profile
@K240-zz
K240-zz / export houdini chan for Maya
Last active June 30, 2023 10:10
maya camera export to houdini chan.
import pymel.core as pm
import math
def exportCameraChan(obj, st, ed, filename):
bt = pm.currentTime( query=True )
fd = open(filename, 'wt')
for i in range(ed-st):
@K240-zz
K240-zz / gist:3212986
Created July 31, 2012 02:39
Where did you chaged Mr.Houdini?
import hou
def where_did_changed(node):
for child in node.children():
for parm in child.parms():
try:
value = parm.eval()
index = parm.componentIndex()
cvalue = parm.parmTemplate().defaultValue()[index]
if value != cvalue:
@K240-zz
K240-zz / gist:1767953
Created February 8, 2012 10:22
How to fix that Houdini 11.x.xxx no icon on Ubuntu 11.xx
$ cd /opt/hfs1x.x.xxx
$ source houdini_setup
$ cd hsvg
$ sudo mkdir oldlibs
$ sudo mv lib* oldlibs
$ sudo mv oldlibs/libgsf-1.so.114 .
$ sudo mv oldlibs/libpangoft2-1.0.so.0 .
$ sudo mv oldlibs/libpng12.so.0 .
$ sudo mv oldlibs/librsvg-2.so.2 .
$ sudo mv oldlibs/libxml2.so.2 .
@K240-zz
K240-zz / gist:1731263
Created February 3, 2012 17:24
Simple Expression using boost::spirit
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <boost/fusion/tuple.hpp>
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/phoenix.hpp>
using namespace std;
using namespace boost;
@K240-zz
K240-zz / gist:1722150
Created February 2, 2012 07:19
PyQt Skelton for Maya.
'''
original from http://nathanhorne.com/?p=183
'''
import os
import sip
import maya.cmds as cmds
import maya.OpenMayaUI as mui
from PyQt4 import QtGui, QtCore, uic
def getMayaWindow():
@K240-zz
K240-zz / gist:1719974
Created February 1, 2012 22:54
Import HGT Python SOP.
from struct import unpack, calcsize
def loadHGT( filename, row, row_length ):
data = []
try:
f = open( filename, 'rb' )
format = '!H'
f.seek( row * row_length * calcsize(format) )
for i in xrange(row_length):
data.append( unpack(format, f.read(calcsize(format)))[0] )
@K240-zz
K240-zz / gist:1713764
Created January 31, 2012 23:26
Export Maya camera to Nuke .chan file.
import maya.cmds as cmds
import math
def dump_camera_channels( cameraName, time ):
current = time
shapeName = cmds.listRelatives(cameraName,shapes=True)[0]
tx = cmds.getAttr(cameraName+".tx", t=current)
ty = cmds.getAttr(cameraName+".ty", t=current)
tz = cmds.getAttr(cameraName+".tz", t=current)
rx = cmds.getAttr(cameraName+".rx", t=current)