AWS Thinkbox Discussion Forums

Greater range in radius variation?

I’m really having some fun with Frost and I think I can use it to crack a long standing problem making foam for beer/liquid tops. I have a result I’m pretty happy with but one thing it could use is a few much larger “bubbles” scattered among the majority.

At the moment I can only affect the size range between 0-99. Is there any way to have a few (some small percentage) be more in the range of 300-400 percent of size? I can experiment with manually adding them, but it would be nice to have them scaling automatically with the rest as I adjust the overall size etc.

Thanks /b

The best and most powerful way is to add a Magma modifier to a PRT Loader and set a Radius channel with the distribution you want. For example, you can assign a Radius of 2.0 to all particles except for every Nth where the value could be 5.0. Then you can use the built-in variation option in FROST to scale down the particles by ID, but the general size difference would be coming from the Magma.

Here is the flow which gives every 10th particle Radius of 5.0, all others are set to 2.0:

The result in the viewport is on the left with the Magma Radius and 99% variation, on the right is the Frost without the Magma Radius:

Obviously, Frost was set to use the Radius Channel of the PRT Loader. My example uses Geometry > Sphere meshing.

That looks perfect! I will have to just button-monkey copy your Magma setup, but it does exactly what I need :slight_smile:

Thanks as always Bobo

b

Just click SELECT ALL below, Ctrl+C, Ctrl+V into a new Magma modifier.

[code](–MAGMAFLOW2–
global MagmaFlowEditor_EditBLOPHistory = #()
node0 = magmaNode.createNode “Output”
magmaNode.setNumNodeInputs node0 1
magmaNode.setNumNodeOutputs node0 0
magmaNode.setNodeProperty node0 “channelName” “Radius”
magmaNode.setNodeProperty node0 “channelType” “float16”
magmaNode.DeclareExtensionProperty node0 “Position”
magmaNode.SetNodeProperty node0 “Position” [334.556,173.889]

node1 = magmaNode.createNode “Switch”
magmaNode.setNumNodeInputs node1 3
magmaNode.setNumNodeOutputs node1 1
magmaNode.setNodeInputDefaultValue node1 3 1
magmaNode.DeclareExtensionProperty node1 “Position”
magmaNode.SetNodeProperty node1 “Position” [588,0]

node2 = magmaNode.createNode “InputValue”
magmaNode.setNumNodeInputs node2 0
magmaNode.setNumNodeOutputs node2 1
magmaNode.setNodeProperty node2 “forceInteger” false
ctrl=bezier_float(); ctrl.value = 2.0
magmaNode.setNodeProperty node2 “controller” ctrl
magmaNode.DeclareExtensionProperty node2 “Position”
magmaNode.SetNodeProperty node2 “Position” [448,70]

node3 = magmaNode.createNode “InputValue”
magmaNode.setNumNodeInputs node3 0
magmaNode.setNumNodeOutputs node3 1
magmaNode.setNodeProperty node3 “forceInteger” false
ctrl=bezier_float(); ctrl.value = 5.0
magmaNode.setNodeProperty node3 “controller” ctrl
magmaNode.DeclareExtensionProperty node3 “Position”
magmaNode.SetNodeProperty node3 “Position” [448,15]

node4 = magmaNode.createNode “InputChannel”
magmaNode.setNumNodeInputs node4 0
magmaNode.setNumNodeOutputs node4 1
magmaNode.setNodeProperty node4 “channelName” “Index”
magmaNode.setNodeProperty node4 “channelType” “”
magmaNode.DeclareExtensionProperty node4 “Position”
magmaNode.SetNodeProperty node4 “Position” [28,170]

node5 = magmaNode.createNode “Modulo”
magmaNode.setNumNodeInputs node5 2
magmaNode.setNumNodeOutputs node5 1
magmaNode.setNodeInputDefaultValue node5 1 0
magmaNode.setNodeInputDefaultValue node5 2 1
magmaNode.DeclareExtensionProperty node5 “Position”
magmaNode.SetNodeProperty node5 “Position” [308,140]

node6 = magmaNode.createNode “InputValue”
magmaNode.setNumNodeInputs node6 0
magmaNode.setNumNodeOutputs node6 1
magmaNode.setNodeProperty node6 “forceInteger” false
ctrl=bezier_float(); ctrl.value = 10.0
magmaNode.setNodeProperty node6 “controller” ctrl
magmaNode.DeclareExtensionProperty node6 “Position”
magmaNode.SetNodeProperty node6 “Position” [168,225]

node7 = magmaNode.createNode “Equal”
magmaNode.setNumNodeInputs node7 2
magmaNode.setNumNodeOutputs node7 1
magmaNode.setNodeInputDefaultValue node7 2 0.0
magmaNode.DeclareExtensionProperty node7 “Position”
magmaNode.SetNodeProperty node7 “Position” [448,125]

node8 = magmaNode.createNode “ToFloat”
magmaNode.setNumNodeInputs node8 1
magmaNode.setNumNodeOutputs node8 1
magmaNode.DeclareExtensionProperty node8 “Position”
magmaNode.SetNodeProperty node8 “Position” [168,155]

try(magmaNode.setNodeInput node0 1 node1 1)catch()
try(magmaNode.setNodeInput node1 1 node3 1)catch()
try(magmaNode.setNodeInput node1 2 node2 1)catch()
try(magmaNode.setNodeInput node1 3 node7 1)catch()
try(magmaNode.setNodeInput node5 1 node8 1)catch()
try(magmaNode.setNodeInput node5 2 node6 1)catch()
try(magmaNode.setNodeInput node7 1 node5 1)catch()
magmaNode.setNodeInput node7 2 -1 1
try(magmaNode.setNodeInput node8 1 node4 1)catch()

)

[/code]

wow - thanks Bobo!

Sorry - is this method only going to work with Kt MX by any chance? I am still on 1.6 and I don’t see a Magma modifier, and I can’t find some of the nodes you are using in the Magma editor when I try to rebuild it from the png.

tks/ b

The source code I posted won’t work unless you have 2.0, but you should have all operators necessary in 1.6.
Attached is the flow in 1.6 KMF format.
BubbleSizeByNth.zip (615 Bytes)

Also, you can rename your Krakatoa folder to “Krakatoa16” and then install Krakatoa 2.0 in Evaluation mode.
This way, you will have both and can simply change your plugin.ini to point to the 1.6 for rendering and 2.0 for everything else, like running the latest Magma modifiers. Just if you want.

I don’t feel right about doing it that way - I will see if I can find the operators.

Thanks Bobo

b

Just add a Krakatoa Channels modifier and load the KMF file I posted, it will work with your licensed 1.6 version.

Thanks Bobo - that is a huge help.

/b

That’s working like a charm. This has finally cracked a long standing problem I’ve had with creating CG foam. Frost/and PRT Volumes using the “union of spheres” meshing method is a great solution. It’s not perfectly physically accurate of course, but it looks pretty realistic IMO and is the best workable option I’ve yet to come across.

Thanks for all the help with it!
(this is just a lower quality render test - it’s renders painfully slowly due to all the overlapping transparency, but not much I can do about that :slight_smile: )

Congrats! It’s looking really cool.

love to see a video of this - maybe even for our siggraph reel!!
cb

Unfortunately I am not the man for that job - I am a stills guy and wouldn’t know where to start :slight_smile: Not sure if this exact setup is even animation-friendly, but I don’t see why it couldn’t be adapted.

/b

Privacy | Site terms | Cookie preferences