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".