Friday 3 March 2017

Reorient joints

Simply rotate the bone (might be best to do this in the bind pose frame) to the orientation you want & hit the Align Capture Pose button in the Rigging shelf. Remember to clean the rotations out of the joint and adjust the child-bones too (maybe there is a way to fix a joint without affecting it's children? un parent first maybe)

Update - the bracketed suggestion works.. remember to turn on the Keep Position When Parenting when you detach though...

Switch between world/local/screenspace transform on widgets

Press M

Sunday 8 January 2017

Getting point values from primitives

Here's a way to get point values from specific vertices. The application here is quite specific actually..
When you make glue constraints for Bullet simming you get a bunch of 2 vertex lines and one method I've been ripping off is to use voronoi noise patterns to cluster the vertices. The aim of this is to check what voronoi cluster value i've assigned to the vertex.

primvertex(0,@primnum, 0);
returns the vertex number, of @primnum's primitive.

vertexpoint(0, vertexnumber);
returns the point number of the vertex you feed it.. Cos points and vertices aren't the same :)

so.. to get a point number from a primitive (say the first point in a line), we combine it all a bit..

int pt= vertexpoint(0,primvertex(0,@primnum,0));

Then you might access some values

float value=point(0, @something, pt);

Thursday 5 January 2017

add point to centre of primitive and have UVs (sort of)

Just to add points and then remove the primitive.

addpoint(0, @P);
removeprim(0, @primnum, 1);



This goes into a primitve wrangle!


To also have UVs:

vector uv = primuv(0,"uv",@primnum,set(0.5,0.5,0));


int pt = addpoint(0,@P);
removeprim(0, @primnum, 1);


setpointattrib(0,"uv2",pt,uv,"set");


Above this wrangle node, we'd initialise the uv2 value. After it, we'd rename the attribute to "uv". For some reason Houdini doesn't like it when you have UVs in both point and vertex.

Saturday 3 December 2016

Attribute Reorient & giving animated geo new normals for fur

Sometimes you want to reorient your normals on an object. However when you do it & it turns out that your object is animated, the new normals might not behave as expected. The normals are probably "swimming" and not following the verts/points as you'd expect.
This is because you generally want your animation done AFTER the modelling process and your new normals don't know anything about the transforms that have happened before. Simply timeshifting and attribute interpolating doesn't seem to work.

Fortunately there's a node called Attribute Reorient. It will reorient more than just normals, but so far this is the use I've had for it.

Oh - my problem was having a pre animated alembic. I wanted to alter the normals for fur direction purposes, but the pre-animation was making the normals & thus also the fur behaviour freak out. By using the Attribute Reorient to essentially force new normals onto the animated geo I sorted out my problem! WINNER.
*note* seems like it looks for the vectors in the points section..so make sure your stuff is there!

Attribute Interpolating UVs & things other than scattered points.

Creating "sourceprim" and "sourceprimuv" attributes for things other than scattered points. In the Houdini docs for the scatter node, there is a guide on getting your scattered points to follow animated/deforming geometry. The scatter node can generate the source primitive and it's uv attributes for you at the tick of a box. You then stick that into an attribute interpolate node and away you go.

However, if you want to interpolate something else like say..a colour attribute or a UV attribute, or something like that - then you'll have to create your own sourceprim and sourceprimuv.
Freeze your geo using a timeshift. Then just lay down a pointVOP, connect it to your geo & then plug the source (ie in the case of the scatter example, it's the object you want to stick to) into the second input.
Within the VOP make an XYZdist node and wire up P to the position input and the second input into the "file" . Create two bind exports and change the output names to sourceprim and sourceprimuv, making sure the data types are correct.
Finally just play around with the search distance in the XYZdist node so you get correct values. Jump out of the VOP and plug the appropriate bits into the Attribute Interpolate node. Adjust the settings to whatever you need (Vertex,point etc...) and everything should be good! You might have to change the pointVop to a vertexVop... too haha.

FLIP volume velocity field (again)

Create a VDB with desired turbulence/noise in whichever way you fancy. Make sure the vdb is called "vel". Keeps things neater..

Inside the FLIP autodopnetwork, use a Source Volume node to bring in your velocity vdb. Scale & Temperature can be ignored. Be sure to uncheck the velocity "mask" and set the volume operation to "add".