addpoint(0, @P);
removeprim(0, @primnum, 1);
@uv = v@opinput1_uv;
if (@Cd.x<chf("seuilColor"))removepoint(0,@ptnum);
if (rand(@class+8675)<ch("seuil"))removepoint(0,@ptnum,1);
// From yarg666 - Get cameraOrigin in input 1
vector pt0 = point(1,'P',0);
v@raydir = normalize( pt0 - @P )*-1;
// Get falloff attribute
@falloff = dot(v@raydir, @N);
// Promote falloff on Primitives then in a Wrangle set on Primitives
if ( f@falloff>chf("seuil") ) removeprim(0,@primnum,1);
if ( @P.y<chf("seuil") ) removeprim(0,@primnum,1);
// As seen on Sidefx forum, posted by paulboiii
// First create a measure SOP, set to per piece
// Then, in an attribwrangle set on primitives
float threshold = chf("Size_Threshold");
if ( f@area < threshold ) removeprim(0,@primnum,1);
if(@uv.y<chf("seuil")) @group_base = 1;
//// Blend shape through a mask attribute - Posted by Cudarsjanis on Odforce
// Geo with mask attribute in first input, blend shape in second
v@P=lerp(v@P, point(1,'P',@ptnum), f@mask*ch('blend'));
@Cd.r = relbbox(0,@P).x;
@Cd.g = relbbox(0,@P).y;
@Cd.b = relbbox(0,@P).z;
vector basePtPos = point (0,"P",chi("basepoint"));
matrix m = ident();
v@Z_axis =normalize( basePtPos - point(0,"P",neighbour(0,chi("basepoint"),1)));
v@Y_axis =normalize( cross(@Z_axis,basePtPos-point(0,"P",neighbour(0,chi("basepoint"),0))))*1;
v@X_axis =normalize ( cross (@Z_axis,@Y_axis))*-1 ;
m*= set (@X_axis,@Y_axis,@Z_axis);
//rotate
float angleX = radians(ch("angleX"));
vector axisX = {1,0,0};
rotate(m,angleX,axisX);
float angleY = radians(ch("angleY"));
vector axisY = {0,1,0};
rotate(m,angleY,axisY);
float angleZ = radians(ch("angleZ"));
vector axisZ = {0,0,1};
rotate(m,angleZ,axisZ);
translate (m,basePtPos);
4@myMatrix = m;
m=invert(m);
@P*= m;
//set pscale first
f@bboxY = relbbox(0,@P).y;
@pscale *= chramp("rampBbox",@bboxY)*4 ;
string path = @path;
s@path = re_replace(r"Deformed", "", path);
setpointattrib(0,"mask",324,1,mode="set") ;
//or
if (@ptnum == 322) f@mask=1;
itoa(i@crowd)
string shop_materialpath = usd_attrib(0, @primpath, 'primvars:shop_materialpath');
string dir, name;
splitpath(shop_materialpath, dir, name);
string roots = "/materials/";
string matPath = roots + name;
return matPath;
//coucou Antoine
//bonjour agent Fregeneuil
f@lenV = length(v@v);
string name [] = split(s@path,"/");
s@path = name[0];
vector basePtPos = point (0,"P",chi("basepoint"));
matrix m = ident();
v@Z_axis =normalize( basePtPos - point(0,"P",neighbour(0,chi("basepoint"),1)));
v@Y_axis =normalize( cross(@Z_axis,basePtPos-point(0,"P",neighbour(0,chi("basepoint"),0))))*-1;
v@X_axis =normalize ( cross (@Z_axis,@Y_axis))*-1 ;
m*= set (@X_axis,@Y_axis,@Z_axis);
translate (m,basePtPos);
4@myMatrix = m;
m=invert(m);
@P*= m;
vector basePtPos = point (0,"P",chi("basepoint"));
matrix m = ident();
v@Z_axis =normalize( basePtPos - point(0,"P",neighbour(0,chi("basepoint"),1)));
v@Y_axis =normalize( cross(@Z_axis,basePtPos-point(0,"P",neighbour(0,chi("basepoint"),0))))*1;
v@X_axis =normalize ( cross (@Z_axis,@Y_axis))*-1 ;
m*= set (@X_axis,@Y_axis,@Z_axis);
//rotate
float angleX = radians(ch("angleX"));
vector axisX = {1,0,0};
rotate(m,angleX,axisX);
float angleY = radians(ch("angleY"));
vector axisY = {0,1,0};
rotate(m,angleY,axisY);
float angleZ = radians(ch("angleZ"));
vector axisZ = {0,0,1};
rotate(m,angleZ,axisZ);
translate (m,basePtPos);
4@myMatrix = m;
m=invert(m);
@P*= m;
4@Um = point (1,"myMatrix",0);
@P*= @Um ;
VEX