Skip to content

Instantly share code, notes, and snippets.

View david-rhodes's full-sized avatar

David Rhodes david-rhodes

View GitHub Profile
float C0 = 0.28209479177387814;
float C1 = 0.4886025119029199;
float C2[] = {1.0925484305920792, -1.0925484305920792, 0.31539156525252005, -1.0925484305920792, 0.5462742152960396};
float C3[] = {-0.5900435899266435, 2.890611442640554, -0.4570457994644658, 0.3731763325901154, -0.4570457994644658, 1.445305721320277, -0.5900435899266435};
// Function to evaluate spherical harmonics at unit directions
function float[] eval_sh(int deg; float sh[]; vector dir; float C0; float C1; float C2[]; float C3[])
{
float x, y, z;
x = dir.x;
@david-rhodes
david-rhodes / HoudiniPointCloud.py
Created January 6, 2022 20:21
Houdini Point Cloud Decorator for Level I/O (asset: transformation)
# DevUtils
# ===========================
from DevUtils.OSP.PointCloudMarkup import PointCloud, PointInstance
# Houdini
# ===========================
from HoudiniUtils.Math.HoudiniMatrix4d import HoudiniMatrix4d
# 3rd Party
# ===========================
@david-rhodes
david-rhodes / decorators.py
Created December 16, 2021 08:46
Maya Python Decorators
import msvcrt
import maya.cmds as cmds
import functools
def interactive(fn):
EXIT = "exitObject"
@functools.wraps(fn)
def wrapped(*args, **kwargs):
if cmds.objExists(EXIT):
cmds.delete(EXIT)