Krakatoa hair lenght

Hi,

Some day ago I found an interesting krakatoa’s feature, Krakatoa PRT Hair object. It’s very useful for rendering hair and some motion graphic stuff!
The interface is almost self-explanatory, there are good webinar videos on the thinkbox channel and the reference guide is very good.

I played a bit with 3dsmax hair&fur and prt hair and I made interesting stuff, but when I tried to use magma flow I meet some problem.

My goal is to control the hair lenght by magma flow trough a simple float operator(for now!). I have a simple plane with 3dsmax Hair&Fur with default setting applied.

My magma setting is:

-Inputchannel: HairLenght divided with a simple float operator and connected to Hairlenght output operator.

Assuming this setup:

If I had hair lenght 10(stupid and raw example) with my setup with float operator with value 2 my hair lenght will be 5 right?
but when I render, the hair lenght is the same.

I tried also a spline object instead of HairFur thinking was a fur problem. but is the same result!

So Is my magma setup wrong? or isn’t possible to control the hair lenght with magma?

Thanks in advance :slight_smile:

This is a misunderstanding :slight_smile:
The HairLength does not control how long the hair will render (since, to rephrase The Matrix, “There Is No Hair”, just particles).
The HairLength channel stores in the particle how long the hair spline was when the particle was created. So it is Input-only, it can be used to learn about the hair length, but does not affect the renderer directly.

You could do what you want using Magma in one of two ways.
You could set the Density value of the particles to a value that sets some of the particles to 0.0, making them invisible based on the Distance channel. The Distance channel tells you how far from the root the particle is. When it is 0.0, it is at the root. When it is equal to HairLenght, it is at the tip. You could use a Float factor between 0.0 and 1.0 (or 100%) to use a fraction of the HairLength value, and only render particles that are below that value, and set the rest to Density 0.0 to hide them.

The other method would be to set the Selection channel if the Distance is greater than your Length value. Then drop a Krakatoa Delete on the stack and delete the particles that are farther along the hair than the specified Length value. Again, you could use a fraction of the HairLength instead, so hairs with different lengths would retain their relative lengths, just get shorter.

Since the PRT Hair has its own Density Falloff controls, in both cases you would have to reimplement that in Magma unless you are using a Falloff of 0 anyway (no falloff at all). This was shown in the early PRT Hair videos around Siggraph 2011.

Please let me know if you have questions…

Here is an example scene (Max 2013).
Basically it has the Density Falloff of the PRT Hair set to 0.0 so it does not do any falloff. Then the Magma calculates the Density Falloff itself and exposes the Power value to the UI, and also exposes a Hair Length factor value which scales the HairLength channel between 0.0 and 1.0 of its original length. The values are clamped between 0.0 and 1.0, so when Distance becomes greater than the new HairLength and then subtracted from 1.0 producing a negative value, it gets clampled at 0.0 and the particle disappears. The incoming Density channel is multiplied by the Density Falloff value and is sent out as Density.
This way, you get a control that scales the hair to a fraction of its original length, while allowing you to calculate Density Falloff based on the NEW length…

I then expanded this setup using a Selection channel to delete any particles that get a Density of 0.0. This speeds up the rendering, but does not change the look at all. Also, it lets you see the shorter hair in the viewport as you change the Hair Length factor value…
KMX2_PRTHair_Length_v001.zip (50.6 KB)