Skip to content

Instantly share code, notes, and snippets.

@joshuazt
joshuazt / Attribute Driven Blendshape
Last active February 19, 2021 01:25
Attribute Driven Blendshape
v@P=lerp(v@P, point(1,'P',@ptnum), f@mask*ch('blend'));
@joshuazt
joshuazt / MinPos
Last active February 19, 2021 01:25
@P = minpos (1, @P);
`npoints(0)-1`
//define scales
float seed = ch('seed') + @primseed;
@Rand_Pscale = fit01(rand(i@ptnum+seed+225), -ch('Rand_Scale'), ch('Rand_Scale')) * chramp("Ramp_Scale", @curveu);
@Uniform_Pscale = chf('Scale') * chramp('Ramp_Scale', @curveu);
//apply pscale
//create variables
vector tangentv = v@tangentv;
vector tangentu = v@tangentu;
tangentv = cross(tangentu, @N);
float seed = ch('seed') + @primseed;
@up = tangentu;
//define scales
float seed = ch('seed') + @primseed;
@Rand_Pscale = fit01(rand(i@ptnum+seed+225), -ch('Rand_Scale'), ch('Rand_Scale'));
@Uniform_Pscale = chf('Scale');
//apply pscale
v@P += chf('scale') * v@N;
int pt = nearpoint(1,@P);
v@vel = point(1,'v',pt);
vector cd = point(1, 'Cd', @ptnum);
v@P += normalize(v@N) * fit01(cd.r, -0.5, 0.5) * chf('scale');