density by age in kcm

hi there

sorry for the noobie questions :wink:

was wondering if doing the density by age would be faster directly in the kcm, and thus avoiding the mxsfloat script? If so how much faster would it be? (i don’t have box#3)

also can i grab the lifespan and age channels directly from pflow with a kcm without using box#3, or do i have to push them into a prt?

alternatively is there a possibility of using the mapping channels to work with the particle age map? (sorry if this is completely misunderstanding the whole thang!)

cheers

paul.

  1. You can save a PRT file with Age and LifeSpan channels, then add a KCM, load both channels, convert each one from Integer to Float, divide the Age by Lifespan, Subtract from 1.0 and dump into the Density channel.

  2. While I have not tested this yet, I would expect a Global Override Modifier with the same flow to have the same effect on a PFlow without saving to PRT. Try it out and let me know. (don’t have Krakatoa on my laptop from which I am writing this, and will be flying tomorrow so I will be offline for some time).

  3. The Particle Age Map in Max does NOT work with Krakatoa. We had it working in early betas years ago but it required some hacks we weren’t comfortable with. BUT what you can do is create a KCM that writes the 1-age/lifespan value to the TextureCoord channel or any Mapping channel and then apply a Gradient or GradientRamp to the particles via another KCM, setting the map to that same mapping channel. As result, the particles will be colored by the gradient based on their UVs, giving you nearly unlimited control over the gradient appearance and number of intermediate colors.

thanks for the reply bobo,

yeah i had already figured out the flow from looking at the script but i don’t seem to be able to get it even a imple multiplier to work directly on the pflow. don’t know you mean by global override modifier?

also my age density flow doesn’t seem to work! i’m now getting an error “append code segment() - received a null fn ptr”. for some reason its not happy when i hook up either the age or lifespan channels. i have definately selected them in the GUI for output to the prt.

heres a jpg of the setup…i’m probably doing something obviously wrong!

cheers

paul

I was just showing somebody how to do this here in the office and it worked nicely just the way you have connected it.
So let’s start again with the usual questions: Max version and build (32/64), Krakatoa build number etc…
I have never seen an error message like that.

ok…its max 2009 32bit sp1 with creativity extension, also fumefx and afterburn installed.

krakatoa v1.4.5.35773. I am running it with an alternative plugin.ini with the -p switch.

cheers

paul

That explains it. It was broken in Beta 5. We fixed it in Beta 6. Go download the latest build and try again.

thanks Bobo that error has gone.

now my problem seems to be that i have zero in the lifespan channel throughout. I have a delete operator set to delete at age 50 no var.

if i plumb this in directly to density to check its value, i get nothing. if i add 1 to it, i get same as if i turn off the kcm. if i multiply with a massive number i still get nothing, so i’m guessing i have zero in there throught the whole animation. obviously this means my density fallof with age will always result in zero density.

the age channel works just as expected, when connected into density i get particles whos densitys increase over time.

any ideas?

cheers

paul

Stupid question: Did you RESAVE the PRT? The bug we fixed in Beta 6 was in the SAVING of PFlow channels (the LifeSpan was not saving but always doing 0) so you would have to resave the PRTs to get the updated values. If you tried Beta 6 with the PRTs from Beta 5, you would get what you described.

right…duh! sorry, yes i had not resaved the prt. it works great now. thanks for your guidance!

one more question, is there a way to prt seperate events in pflow so for example one prt for leading particles and one for the spawns so as to apply different kcms to different events, much like you can with the script.

cheers

paul

You can save separate PRT files for the various events. Simply add a Render operator to each event and set all of them to Box instead of Geometry. Set the ONE event you want to save to Geometry. Enter a name and save to PRT. Then switch that Event to Box, the next Event to Geometry and save under a new name. Repeat for every event and you will have multiple PRTs, each one containing a single event (or any combination thereof). Then load via multiple PRT Loaders, each with its own KCMs.

Another way would be to save a single PRT file but use a Box #3 or Script Operator or just a simple Mapping operator to mark particles that enter an event with a specific value in a custom (Mapping?) channel. Then in the KCMs you could check the content of that channel with a Boolean Condition and a Switch Operator and thus control whether an effect will be applied or not.

oh cool, thats perfect.

sounds like you guys have covered a lot of possibilities with this.

thanks again

paul