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 hqueue.houdini as hq | |
node = hq.getNode("/obj/topnet1").displayNode() | |
node.executeGraph(False, True, False) |
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
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
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
// 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
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
# Callbacks | |
idx = kwargs["script_multiparm_index"] | |
# In a parameter expression | |
idx = evaluatingParm().multiParmInstanceIndices[0] # Returns a tuple. Will need subscript for the right level, and test for IndexError | |
# In a parameter expression, better | |
import re | |
idx = re.match(r".+(\d+)$", evaluatingParm().name()).group(1) |
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
def toggle_manual(): | |
"""Toggle cook mode""" | |
current_mode = hou.updateModeSetting() | |
auto = (hou.updateMode.AutoUpdate, hou.updateMode.OnMouseUp) | |
toggle_cook = hou.shelves.tool("toggle_manual") | |
toggle_cook.setLabel("Auto Update") | |
if current_mode in auto: | |
hou.setUpdateMode(hou.updateMode.Manual) | |
toggle_cook.setIcon("MISC_cook") | |
elif current_mode == hou.updateMode.Manual: |
OlderNewer