mercoledì 3 ottobre 2012

Houdini - UV on particle fluids

Last week I did some research about the techniques to add UVs on particle fluid.
Apparently it might seem rather pointless to map a liquid (since the texture will mix by itself and become chaotic in a few moments), but if you have to simulate a viscous liquid, the motion of the particles will be slow and limited, allowing you achieve some nice and slowly "advecting" UVs.


First of all, we have to distinguish two main cases:

1. Dynamics has not been simulated yet. In this case, all you have to do is create UVs and transfer the corresponding attribute to the particles in SOP context BEFORE you run the simulation: in this way you'll simulate particles that store UV while advecting and, after the simulation, you'll be able to transfer the uv attribute from particles to the particle fluid surface.


2. You have already done the simulation (in Houdini or external software, like Real Flow). In this case, you have to add somehow the uv attribute to particles in the first frame and make it follow the dynamics.

So,
  • create the particle fluid surface in the first frame and lock the particle surface node;
  • create UVs on this locked node and promote the uv attribute from vertex to point;
  • still working in the first frame, transfer the uv attribute from the particle surface to simulated particles and lock the attrib transfer node (see the picture below);
  • make the particles with UV follow the original particles;
  • create a new particle surface node and make sure you transfer the uv attribute to it


Note: more particles you have, the more precise are the resulting UVs.

You can download a sample scene from here (password: valeriodinapoli).

venerdì 29 giugno 2012

Python script for Maya - Create dynamic chain from curve

"Create dynamic chian from curve" is a python script for Autodesk Maya that I wrote just for fun about one year ago.
It creates chains procedurally from NURBS curves and adds IK animation controls, two different dynamics systems (one faster, one more accurate) and dynamic contraints. Everything is procedural, so you can re-arrange the curve, change rings size and shape and so on.


How it works:
- The script does a bunch of things. Basically it measures the curve length and places some hidden locators on it. On each locator it places a joint, an hi-res ring and a proxy ring.
- Each hi-res ring is equal to an original hidden ring (so, by modifying it, you affect all rings) and constrained to the corresponding low-res ring.
- Low-res rings are skinned on joints and used also as ncloth objects, to provide very fast simulations.
- The original curve is both used as IK spline for joints and hair for simulations with Hair system solver.

You can download it for free from Creativecrash: click here.
If you like it don't forget to rate it.

Thanks!

domenica 17 giugno 2012

Houdini - cookie node tip: how to make it work as it should

Last week I did a lot of boolean operations on geometries and I noticed that sometimes Houdini cookie node doesn't work properly, generating a bunch of artifacts. If you are a Houdini user you know well what I'm talking about!

Original geometry
Cookie with artifacts
After some tests I discovered how to fix that issue... and it's very simple! Basically this node works better with some scales and generates some errors when your geometries are too big or too small.

So,

  • if you have tiny geometries, scale them up a lot (100 times or more) BEFORE you plug them in the cookie node and re-scale down by the same value after the boolean operation;
  • if you have huge geometries, scale them down before the cookie op and scale 'em up after.

Finally working!