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 math | |
import os | |
import re | |
def timedelta(file1, file2): | |
t1 = os.path.getmtime(file1) | |
t2 = os.path.getmtime(file2) | |
time = abs(t2 - t1) / 60.0 | |
min = math.floor(time) |
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 toolutils as tu | |
viewer = tu.sceneViewer() | |
viewports = viewer.viewports() | |
cam = hou.node("/obj/rendercam") | |
# There are always 4 viewports! | |
# https://www.sidefx.com/forum/topic/38171/#post-174454 | |
for vp in viewports: | |
vp.setCamera(cam) |
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
int num_choices = 5; | |
int idx = floor(rand(i@id + 65536) * num_choices); | |
i@bitmask = int(pow(2, idx)); |
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
// Get packed xform and pivot | |
matrix xform = getpackedtransform(0, i@ptnum); | |
vector pivot = primintrinsic(0, "pivot", i@ptnum); | |
// Orient for instancing | |
p@orient = quaternion(matrix3(xform)); | |
// Crack pscale | |
vector scale = cracktransform(0, 0, 2, 0, xform); | |
f@pscale = avg(scale); |
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
{ | |
"path": "$HOME/cooltool/houdini{$HOUDINI_VERSION}" | |
} |
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
"""Action button script.""" | |
import os | |
if kwargs["shift"]: | |
# Copy evaluated parameter string | |
text = kwargs["parmtuple"][0].evalAsString() | |
command = "echo -n {0}| xclip -sel clip".format(text) | |
os.system(command) | |
else: | |
# Copy a reference to this parameter |
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
// Match forearm, leftArm, and arm | |
@name=*[aA]rm |
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 re | |
import hou | |
def ftrimify(parm): | |
"""Wrap an ftrim() function around channel refs. | |
Args: | |
parm (hou.Parm): Parameter to add ftrim()s to. Should be a |
OlderNewer