2023-02-28 09:43:01 +01:00
|
|
|
function Node_Fluid_Group(_x, _y, _group = noone) : Node_Collection(_x, _y, _group) constructor {
|
2023-02-14 02:48:33 +01:00
|
|
|
name = "FluidSim";
|
|
|
|
color = COLORS.node_blend_fluid;
|
|
|
|
icon = THEME.fluid_sim;
|
|
|
|
|
|
|
|
ungroupable = false;
|
|
|
|
update_on_frame = true;
|
|
|
|
|
|
|
|
if(!LOADING && !APPENDING && !CLONING) {
|
|
|
|
var _domain = nodeBuild("Node_Fluid_Domain", -384, -32, self);
|
|
|
|
var _update = nodeBuild("Node_Fluid_Update", 0, -32, self);
|
|
|
|
var _render = nodeBuild("Node_Fluid_Render", 128, -32, self);
|
|
|
|
var _output = nodeBuild("Node_Group_Output", 384, -32, self);
|
|
|
|
|
|
|
|
_output.inputs[| 0].setFrom(_render.outputs[| 0]);
|
|
|
|
_render.inputs[| 0].setFrom(_update.outputs[| 0]);
|
|
|
|
_update.inputs[| 0].setFrom(_domain.outputs[| 0]);
|
|
|
|
}
|
|
|
|
|
2023-10-03 07:14:28 +02:00
|
|
|
static update = function() {
|
|
|
|
for( var i = 0, n = ds_list_size(nodes); i < n; i++ ) {
|
|
|
|
var node = nodes[| i];
|
|
|
|
|
|
|
|
if(!is_instanceof(node, Node_Fluid_Render)) continue;
|
|
|
|
if(node.cacheExist()) node.cachedPropagate();
|
|
|
|
}
|
2023-02-14 02:48:33 +01:00
|
|
|
}
|
2023-03-08 14:59:54 +01:00
|
|
|
|
|
|
|
PATCH_STATIC
|
2023-02-14 02:48:33 +01:00
|
|
|
}
|