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
numsegments = Math.max(2, Math.floor(effect("Segments")("Slider"))); | |
totallength = Math.max(0.001, effect("Line Length")("Slider")); | |
seglength = totallength / numsegments; | |
sepdist = Math.max(0.001, effect("Seperation Distance")("Slider") * 0.5) / (Math.PI * 2); | |
roll = clamp(effect("Roll")("Slider"), 0, 1); | |
pos = [0, 0]; | |
cv = []; | |
firsttheta = Math.sqrt(numsegments * seglength / sepdist); |
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
seg = Math.floor( Math.max(effect("Segments")("Slider"), 2) ); | |
starttime = effect("Start Time")("Slider"); | |
endtime = effect("End Time")("Slider"); | |
smooth = effect("Smooth")("Checkbox") > 0; | |
targetlayer = thisComp.layer("Tip"); | |
timemin = Math.min(starttime, endtime); | |
timemax = Math.max(starttime, endtime); | |
cv = []; |
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
seg = Math.floor( Math.max(effect("Segments")("Slider"), 2) ); | |
radius = effect("Radius")("Slider"); | |
angle_param = clamp(effect("Angle Control")("Angle"), -360, 360); | |
close = effect("Close")("Checkbox") > 0; | |
angle = degreesToRadians(angle_param) * 1 / seg; | |
tangent = [0, 4 / 3 * Math.tan(angle/4) ] * radius; | |
firsttangent = [0,0]; | |
numiterations = seg + 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
dist = effect("Offset")("Slider"); // Position on path. | |
w = effect("Width")("Slider"); // Normal direction width. | |
restpath = thisProperty; | |
targetpath = thisComp.layer("Path").content("Shape 1").content("Path 1").path; // Target Path | |
refpt = restpath.points(); | |
refintan = restpath.inTangents(); | |
refouttan = restpath.outTangents(); |
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
string edgegrp = chs('edge_group'); | |
string newgrpname = chs('new_polyline_group_name'); | |
int edges[] = expandedgegroup(0, edgegrp); | |
int prevpt = -1; | |
int curprim = -1; | |
for(int i=0; i<len(edges); i+=2) | |
{ |
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 soptoolutils | |
selection = None | |
if type(kwargs['pane']) is hou.SceneViewer: | |
viewer = kwargs['pane'] | |
selection = viewer.selectGeometry(geometry_types=(hou.geometryType.Primitives, hou.geometryType.Edges,)) | |
n = soptoolutils.genericTool(kwargs, '$HDA_NAME') |
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
vector origin = chv('t'); | |
vector dir = normalize( chv('dir') ); | |
vector v = @P - origin; | |
float dist = dot(v, dir); | |
float range = ch('range'); | |
f@falloff = fit(dist, range, 0, 0, 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 checkConnectivity(e1, e2): | |
chk = e1.points()[0].number == e2.points()[0].number | |
chk = chk or e1.points()[0].number == e2.points()[1].number | |
if chk: return 1 | |
chk = e1.points()[1].number == e2.points()[0].number | |
chk = chk or e1.points()[1].number == e2.points()[1].number | |
if chk: return 2 | |
return 0 | |
def isNext(e1, e2): |
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
node = hou.pwd() | |
geo = node.geometry() | |
geo.deletePrims(geo.prims(), True) | |
pt_delete = set(geo.points()) | |
ptns = node.parm('group').eval().split() | |
for ptn in ptns: | |
edges = geo.globEdges(ptn) |
NewerOlder