Tuesday 27 August 2024

creating orient and rotating points around vector

I think Toadstorm posted this somewhere on odforce... but it's a useful little vex snippet


 vector fwd = v@N;

vector up = {0,1,0};
// if you don't have a defined up vector but want to compute one the way houdini does it natively,
// compute the rotation that rotates +Z to N and apply this to +Y...
// matrix3 d = dihedral({0,0,1}, fwd);
// up = normalize(d * up);matrix3 m = maketransform(fwd, up);
// now you can rotate this around whatever axis you want.
vector axis = normalize(chv("axis")); // or use an existing vector attribute!
float angle = @noiseVal*radians(ch("angle")); // or use a random float attribute!
rotate(m, angle, axis);// now convert this rotated matrix to a quaternion and bind to p@orient. copy to points and/or DOPs will understand this.
@orient = quaternion(m);

Monday 19 August 2024

houdini's unlock normals....

an equivalent to maya's "unlock normals" in houdini.. usually needed after a polyextrude -

 reverse sop node, followed by a normal node

Tuesday 30 July 2024

notes - christopher rutledge kinefx videos

general character rig workflow -

exoside quad remesh

labs 3d straight skeleton, fuse, delete half (for mirroring), resample.

use cgwiki matt estela's edge transport distance attrib propogate trick to reorder vert numbers

(edge transport "(distance)", promote to primitive (don't delete origintal), sort by distance, polypath)

rig doctor

mirror rig

joint capture biharmonic for mesh capture. joint capture paint to tweak any specific weights

stash captured geo and skele, externally(!)

plug all into joint deform.


rig wrangle to use curl noise vector attrib to mess with joint rotation/scale/pos.

he sets poses with multiple rig pose nodes. Then switch-nodes between them using a $F and modulo expression. This is nice for stepped anim style, but if you want to inbetween them,

Use a "smooth motion" node. It's used for fixing jittery mocap - but it also provides a nice tween between the different rig poses.

Another novel blending approach is to put the step anim through a solver. Inside the solver use a skeleton blend with the previous frame, using a blend value of less-than-one, for an interesting ramped blend between poses.
This can also be used with stepped blend shapes(eg for a stepped mountain sop anim). Smooth motion seems to have some nice secondary motion built in.


There is a secondary motion sop node which lets you specify a driver joint & the group to affect. Typically these will be joints down the hierarchy, eg in a tail/whip/arm. Also has some effect features - lag/overshoot, jiggle and gravity.




Tuesday 23 July 2024

Monday 22 July 2024

USD write .usd but in ascii

.usd files are written as binary by default. to write a .usd file as ascii, add
":SDF_FORMAT_ARGS:format=usda" (without quotes) directly after the file name.



eg.
$HIP/usd/$HIPNAME/scenes/extensions/extension_scene_ascii.usd:SDF_FORMAT_ARGS:format=usda

Wednesday 29 May 2024

getting distance to object in camera

 vlength(vtorigin(".","../FOCUS_MAN"))


paste this into the Focus Distance parameter, replacing FOCUS_MAN with whichever object/null you're following.

Monday 29 April 2024

padding zeroes in vex

 s@frameNum= sprintf('%04d',clamp((@Frame-1000),0,68));

//s@name = sprintf('%04d',@Frame);

s@textureFile=chs("part1")+@frameNum+chs("end");


slight update on zero padding in vex...

use sprintf to reformat numbers..