AWS Thinkbox Discussion Forums

Krakatoa 3dsMax Problems: ID, FitRange, Time

I’ve got few question I can’t get answer from internet (maybe, I’m not searching right, but I’ve tried :slight_smile: )

  1. How to set Radius based on ID channel? Or use any other value based on ID channel.
    (I’ve managed to set radius based on noise and position, but noise is “still” in world space, and I don’t want that)

  2. How to generate random noise value? I want to make random Radius per ID.

  3. Is a way, to select particles to constant selection. For example: I insert box inside particles, and take it out. Those who touched box - stay in selection. Last Frame node? Time node?

  4. Is there some fit-range node/script? Simple: take number from 1-100, and make them between some other range.

The main issue with the Noise and ID is that the Noise function produces the same value on round input values.
In other words, feeding a Noise with 1.0, 2.0, 3.0 will produce the SAME value, not a different one.
Thus, simply converting the ID to a Float and passing it to Noise won’t help, you also need to scale the value to produce more variation and a decimal point part. For example, convert ID to Float, Divide the result by 123.456 and pass that into a Noise to get a variable value as the ID changes.
With a fixed ID, you will always get the same value on each frame, but the values will be different for different IDs…

See above.

This requires history-dependent channels. You cannot do this with Magma right now, the calculations are performed independently on each frame, and you cannot keep a selection over time once the selection volume has changed. Also, the particles in a PRT sequence have no knowledge of each-other between frames - only the ID channel allows us to somewhat infer a relationship. However, you should be able to do that in a true particle simulation using PFlow or TP, since data in a particle simulation can persist between frames.

This should be simple math - if you have a range from 1 to N, you can normalize it between 0.0 and 1.0, then scale as needed, and offset if necessary.
In your example, the Min is 1, the Max is 100. Min-Min = 1-1 = 0; Max-Min = 100-1 = 99. So the range is 0 to 99, divided by the range length (99-0=99.0) produces a normalized range from 0.0 to 1.0 (0.0/99.0=0, 99.0/99.0=1). Let’s say you want your new range to be from 100 to 256. The length of the new range is 256-100 = 156. The Min is 100, so you add the normalized 0.0 to 1.0 range multiplied by the range length of 156 to the Min. value:
100.0 + 0.0156 = 100.0 --> when the original value in the old range was 1, it is now 100.0
100.0 + 1.0
156 = 256.0 --> when the original value in the old range was 100, it is now 256.0

I will see if I can post a BLOP node definition for that…

Here is a BLOP node that does the remapping of ranges.
First and second inputs are the Min. and Max. range values of the current range.
Third input is the value to be remapped.
Fourth and fifth inputs are the new Min. and Max. range values to map to.
The values are clamped internally, so if you provide an out of range value, or your Min and Max are swapped, it still produces somewhat valid outputs.

RemapValueRange_BLOP.zip (1.06 KB)

Just copy this file into your BLOPs folder (create an empty BLOP node and press the Explore BLOP Folder button, then copy the file into Standard subfolder). Then you can find the BLOP in the BLOP>Standard category…

Great! Thanks for your help. I’ll try those solutions.

Great Blop!

Privacy | Site terms | Cookie preferences