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
/** | |
* @param {Layer} layer | |
* @param {Array} point - array of numbers | |
* @param {Number} [t] | |
* @return {Array} - array of numbers | |
*/ | |
var toWorld = function(layer, point, t) { | |
var comp = layer.containingComp, | |
dammyLayer = comp.layers.addNull(), | |
dammySource = dammyLayer.source, |
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
float angle = ch('angle') * -1; | |
float range = ch('range'); | |
if(angle==0.0 || range==0.0) return; | |
angle = radians(angle / range); | |
int limit = chi('limit'); | |
vector origin = chv('orig'); | |
vector dir = normalize( chv('dir') ); | |
vector up = normalize( chv('up') ); | |
vector rotaxis = cross(up, dir); |
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
/* Initialize */ | |
float curvelength = primintrinsic(1, 'arclength', 0); | |
if( curvelength == 0 ) | |
curvelength = primintrinsic(1, 'measuredperimeter', 0); | |
float dist = @P.z / curvelength + ch('offset'); | |
vector2 uv = set(dist, 0); | |
// PRIMUV_UNITLEN_TO_UNIT = 7 | |
vector2 posuv = primuvconvert(@OpInput2, uv, 0, 7); |
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
/* Input1 is 'Geometry to Transfer Attribute to' */ | |
/* Input2 is 'Geometry to Transfer Attribute from' */ | |
string attrib_name = 'attrib_name'; | |
float search_lim = 0.5; | |
float accum = point(0, attrib_name, @ptnum); | |
for(int i=0; i<nprimitives(1); i++) | |
{ | |
vector bbxmin, bbxmax; | |
getbbox(1, itoa(i), bbxmin, bbxmax); |
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 | |
chk = chk or e1.points()[1].number == e2.points()[0].number | |
chk = chk or e1.points()[1].number == e2.points()[1].number | |
return chk | |
node = hou.pwd() | |
geo = node.geometry() |
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) |
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
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
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') |
OlderNewer