Inline simulations

This commit is contained in:
Tanasart 2023-12-18 19:54:33 +07:00
parent 21f6a17143
commit 791dbef07f
24 changed files with 208 additions and 63 deletions

View file

@ -299,6 +299,7 @@
{"name":"s_node_frame","order":1,"path":"sprites/s_node_frame/s_node_frame.yy",},
{"name":"sh_mk_tile18_edge_r","order":2,"path":"shaders/sh_mk_tile18_edge_r/sh_mk_tile18_edge_r.yy",},
{"name":"node_active_canvas","order":22,"path":"scripts/node_active_canvas/node_active_canvas.yy",},
{"name":"node_VFX_group_inline","order":12,"path":"scripts/node_VFX_group_inline/node_VFX_group_inline.yy",},
{"name":"s_node_fluidSim_turbulence","order":10,"path":"sprites/s_node_fluidSim_turbulence/s_node_fluidSim_turbulence.yy",},
{"name":"node_pb_fx_hash","order":7,"path":"scripts/node_pb_fx_hash/node_pb_fx_hash.yy",},
{"name":"sh_pb_draw_mask","order":8,"path":"shaders/sh_pb_draw_mask/sh_pb_draw_mask.yy",},
@ -564,6 +565,7 @@
{"name":"s_node_pb_fx_strip","order":26,"path":"sprites/s_node_pb_fx_strip/s_node_pb_fx_strip.yy",},
{"name":"s_node_rigidSim_global","order":4,"path":"sprites/s_node_rigidSim_global/s_node_rigidSim_global.yy",},
{"name":"sh_channel_G_grey","order":8,"path":"shaders/sh_channel_G_grey/sh_channel_G_grey.yy",},
{"name":"node_strand_sim_inline","order":12,"path":"scripts/node_strand_sim_inline/node_strand_sim_inline.yy",},
{"name":"s_node_smokeSim_update","order":10,"path":"sprites/s_node_smokeSim_update/s_node_smokeSim_update.yy",},
{"name":"node_3d_depth","order":15,"path":"scripts/node_3d_depth/node_3d_depth.yy",},
{"name":"s_node_vec4","order":9,"path":"sprites/s_node_vec4/s_node_vec4.yy",},
@ -1015,6 +1017,7 @@
{"name":"append_function","order":1,"path":"scripts/append_function/append_function.yy",},
{"name":"node_3dsurf","order":5,"path":"scripts/node_3dsurf/node_3dsurf.yy",},
{"name":"fd_rectangle_reset_target","order":17,"path":"scripts/fd_rectangle_reset_target/fd_rectangle_reset_target.yy",},
{"name":"node_fluid_sim_inline","order":12,"path":"scripts/node_fluid_sim_inline/node_fluid_sim_inline.yy",},
{"name":"node_rate_remap","order":3,"path":"scripts/node_rate_remap/node_rate_remap.yy",},
{"name":"s_node_dynasurf","order":3,"path":"sprites/s_node_dynasurf/s_node_dynasurf.yy",},
{"name":"obj_reader","order":2,"path":"scripts/obj_reader/obj_reader.yy",},
@ -1579,6 +1582,7 @@
{"name":"_node_VFX_spawner","order":4,"path":"scripts/_node_VFX_spawner/_node_VFX_spawner.yy",},
{"name":"s_node_bar_graph","order":27,"path":"sprites/s_node_bar_graph/s_node_bar_graph.yy",},
{"name":"sh_channel_B_grey","order":9,"path":"shaders/sh_channel_B_grey/sh_channel_B_grey.yy",},
{"name":"node_rigid_group_inline","order":11,"path":"scripts/node_rigid_group_inline/node_rigid_group_inline.yy",},
{"name":"s_node_pb_fx_hash","order":8,"path":"sprites/s_node_pb_fx_hash/s_node_pb_fx_hash.yy",},
{"name":"draw_UI_scale","order":8,"path":"scripts/draw_UI_scale/draw_UI_scale.yy",},
{"name":"s_node_strandSim_update","order":1,"path":"sprites/s_node_strandSim_update/s_node_strandSim_update.yy",},

View file

@ -495,6 +495,7 @@
{"id":{"name":"s_node_frame","path":"sprites/s_node_frame/s_node_frame.yy",},},
{"id":{"name":"sh_mk_tile18_edge_r","path":"shaders/sh_mk_tile18_edge_r/sh_mk_tile18_edge_r.yy",},},
{"id":{"name":"node_active_canvas","path":"scripts/node_active_canvas/node_active_canvas.yy",},},
{"id":{"name":"node_VFX_group_inline","path":"scripts/node_VFX_group_inline/node_VFX_group_inline.yy",},},
{"id":{"name":"s_node_fluidSim_turbulence","path":"sprites/s_node_fluidSim_turbulence/s_node_fluidSim_turbulence.yy",},},
{"id":{"name":"windowManager","path":"scripts/windowManager/windowManager.yy",},},
{"id":{"name":"node_pb_fx_hash","path":"scripts/node_pb_fx_hash/node_pb_fx_hash.yy",},},
@ -796,6 +797,7 @@
{"id":{"name":"s_node_pb_fx_strip","path":"sprites/s_node_pb_fx_strip/s_node_pb_fx_strip.yy",},},
{"id":{"name":"s_node_rigidSim_global","path":"sprites/s_node_rigidSim_global/s_node_rigidSim_global.yy",},},
{"id":{"name":"sh_channel_G_grey","path":"shaders/sh_channel_G_grey/sh_channel_G_grey.yy",},},
{"id":{"name":"node_strand_sim_inline","path":"scripts/node_strand_sim_inline/node_strand_sim_inline.yy",},},
{"id":{"name":"s_node_smokeSim_update","path":"sprites/s_node_smokeSim_update/s_node_smokeSim_update.yy",},},
{"id":{"name":"node_3d_depth","path":"scripts/node_3d_depth/node_3d_depth.yy",},},
{"id":{"name":"s_node_vec4","path":"sprites/s_node_vec4/s_node_vec4.yy",},},
@ -1314,6 +1316,7 @@
{"id":{"name":"append_function","path":"scripts/append_function/append_function.yy",},},
{"id":{"name":"node_3dsurf","path":"scripts/node_3dsurf/node_3dsurf.yy",},},
{"id":{"name":"fd_rectangle_reset_target","path":"scripts/fd_rectangle_reset_target/fd_rectangle_reset_target.yy",},},
{"id":{"name":"node_fluid_sim_inline","path":"scripts/node_fluid_sim_inline/node_fluid_sim_inline.yy",},},
{"id":{"name":"node_rate_remap","path":"scripts/node_rate_remap/node_rate_remap.yy",},},
{"id":{"name":"s_node_dynasurf","path":"sprites/s_node_dynasurf/s_node_dynasurf.yy",},},
{"id":{"name":"obj_reader","path":"scripts/obj_reader/obj_reader.yy",},},
@ -1960,6 +1963,7 @@
{"id":{"name":"_node_VFX_spawner","path":"scripts/_node_VFX_spawner/_node_VFX_spawner.yy",},},
{"id":{"name":"s_node_bar_graph","path":"sprites/s_node_bar_graph/s_node_bar_graph.yy",},},
{"id":{"name":"sh_channel_B_grey","path":"shaders/sh_channel_B_grey/sh_channel_B_grey.yy",},},
{"id":{"name":"node_rigid_group_inline","path":"scripts/node_rigid_group_inline/node_rigid_group_inline.yy",},},
{"id":{"name":"s_node_pb_fx_hash","path":"sprites/s_node_pb_fx_hash/s_node_pb_fx_hash.yy",},},
{"id":{"name":"__node_PCX","path":"scripts/__node_PCX/__node_PCX.yy",},},
{"id":{"name":"draw_UI_scale","path":"scripts/draw_UI_scale/draw_UI_scale.yy",},},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

View file

@ -25,6 +25,8 @@ event_inherited();
anchor = ANCHOR.left | ANCHOR.top;
node_menu_selecting = noone;
is_global = PANEL_GRAPH.getCurrentContext() == noone;
#region ---- category ----
category = NODE_CATEGORY;
switch(instanceof(context)) {
@ -72,7 +74,11 @@ event_inherited();
if(node_called == noone && junction_hovering == noone) return true;
if(!struct_has(node, "node")) return true;
if(!struct_has(global.NODE_GUIDE, node.node)) return true;
if(is_instanceof(node, NodeObject) && node.is_patreon_extra && !IS_PATREON) return false;
if(is_instanceof(node, NodeObject)) {
if(node.is_patreon_extra && !IS_PATREON) return true;
if(is_global && !node.show_in_global) return true;
}
var io = global.NODE_GUIDE[$ node.node];
@ -431,7 +437,10 @@ event_inherited();
for(var index = 0; index < node_count; index++) {
var _node = _list[| index];
if(is_undefined(_node)) continue;
if(is_instanceof(_node, NodeObject) && _node.is_patreon_extra && !IS_PATREON) continue;
if(is_instanceof(_node, NodeObject)) {
if(_node.is_patreon_extra && !IS_PATREON) continue;
if(is_global && !_node.show_in_global) continue;
}
if(is_string(_node)) {
if(!PREFERENCES.dialog_add_node_grouping)
@ -551,7 +560,10 @@ event_inherited();
for(var i = 0; i < node_count; i++) {
var _node = _list[| i];
if(is_undefined(_node)) continue;
if(is_instanceof(_node, NodeObject) && _node.is_patreon_extra && !IS_PATREON) continue;
if(is_instanceof(_node, NodeObject)) {
if(_node.is_patreon_extra && !IS_PATREON) continue;
if(is_global && !_node.show_in_global) continue;
}
if(is_string(_node)) {
if(!PREFERENCES.dialog_add_node_grouping)
@ -702,7 +714,11 @@ event_inherited();
if(is_string(_node)) continue;
if(ds_map_exists(search_map, _node)) continue;
if(struct_try_get(_node, "deprecated")) continue;
if(is_instanceof(_node, NodeObject) && _node.is_patreon_extra && !IS_PATREON) continue;
if(is_instanceof(_node, NodeObject)) {
if(_node.is_patreon_extra && !IS_PATREON) continue;
if(is_global && !_node.show_in_global) continue;
}
var match = string_partial_match(string_lower(_node.getName()), search_lower);
var param = "";

View file

@ -0,0 +1,17 @@
function Node_VFX_Group_Inline(_x, _y, _group = noone) : Node_Collection_Inline(_x, _y, _group) constructor {
name = "VFX";
color = COLORS.node_blend_vfx;
icon = THEME.vfx;
update_on_frame = true;
if(!LOADING && !APPENDING && !CLONING) { #region
var input = nodeBuild("Node_VFX_Spawner", x, y);
var output = nodeBuild("Node_VFX_Renderer", x + 256, y);
output.inputs[| output.input_fix_len + 1].setFrom(input.outputs[| 0]);
addNode(input);
addNode(output);
} #endregion
}

View file

@ -0,0 +1,11 @@
{
"resourceType": "GMScript",
"resourceVersion": "1.0",
"name": "node_VFX_group_inline",
"isCompatibility": false,
"isDnD": false,
"parent": {
"name": "VFX",
"path": "folders/nodes/data/simulation/VFX.yy",
},
}

View file

@ -10,7 +10,7 @@ function groupNodes(nodeArray, _group = noone, record = true, check_connect = tr
var node = nodeArray[i];
for( var j = 0, m = array_length(node.context_data); j < m; j++ ) {
var _cnt = node.context_data[i];
var _cnt = node.context_data[j];
array_push_unique(_ctx_nodes, _cnt);
for( var k = 0, n = array_length(_cnt.members); k < n; k++ ) {

View file

@ -4,10 +4,10 @@ function Node_Collection_Inline(_x, _y, _group = noone) : Node(_x, _y, _group) c
group_vertex = [];
group_dragging = false;
group_adding = false;
group_alpha = 0;
vertex_hash = "";
group_hovering = false;
group_hover_al = 0;
static removeNode = function(node) { #region
array_remove(attributes.members, node.node_id);
@ -51,6 +51,7 @@ function Node_Collection_Inline(_x, _y, _group = noone) : Node(_x, _y, _group) c
}
var _node = PROJECT.nodeMap[? attributes.members[i]];
array_push_unique(_node.context_data, self);
array_push(members, _node);
}
} #endregion
@ -123,25 +124,16 @@ function Node_Collection_Inline(_x, _y, _group = noone) : Node(_x, _y, _group) c
static groupCheck = function(_x, _y, _s, _mx, _my) { #region
if(array_length(group_vertex) < 3) return;
var _inGroup = true;
var _m = [ _mx / _s - _x, _my / _s - _y ];
group_adding = false;
if(PANEL_GRAPH.node_dragging && key_mod_press(SHIFT)) {
var side = undefined;
for( var i = 1, n = array_length(group_vertex); i < n; i++ ) {
var a = group_vertex[i - 1];
var b = group_vertex[i - 0];
var _side = sign(ccw(a, b, _m));
if(side == undefined) side = _side;
else if(side != _side) _inGroup = false;
}
var _list = PANEL_GRAPH.nodes_selecting;
var _list = PANEL_GRAPH.nodes_selecting;
if(_inGroup) {
if(group_hovering) {
group_adding = true;
for( var i = 0, n = array_length(_list); i < n; i++ )
array_push_unique(attributes.members, _list[i].node_id);
@ -175,8 +167,8 @@ function Node_Collection_Inline(_x, _y, _group = noone) : Node(_x, _y, _group) c
var _color = getColor();
draw_set_color(_color);
group_alpha = lerp_float(group_alpha, group_adding, 4);
draw_set_alpha(0.025 + 0.025 * group_alpha + 0.025 * group_hovering);
group_hover_al = lerp_float(group_hover_al, group_hovering, 4);
draw_set_alpha(0.025 + 0.050 * group_hover_al);
draw_primitive_begin(pr_trianglelist);
var a = group_vertex[0];
var b = group_vertex[1];

View file

@ -10,7 +10,7 @@ function Node_Fluid_Add(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group) con
inputs[| 1] = nodeValue("Fluid brush", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
inputs[| 2] = nodeValue("Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [0, 0])
inputs[| 2] = nodeValue("Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [0, 0])
.setDisplay(VALUE_DISPLAY.vector);
inputs[| 3] = nodeValue("Active", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true);

View file

@ -8,7 +8,7 @@ function Node_Fluid_Apply_Velocity(_x, _y, _group = noone) : Node_Fluid(_x, _y,
inputs[| 1] = nodeValue("Brush", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
inputs[| 2] = nodeValue("Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [0, 0])
inputs[| 2] = nodeValue("Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [0, 0])
.setDisplay(VALUE_DISPLAY.vector);
inputs[| 3] = nodeValue("Velocity", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [0, 0])

View file

@ -2,7 +2,6 @@ function Node_Fluid_Domain(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group)
name = "Domain";
color = COLORS.node_blend_smoke;
icon = THEME.smoke_sim;
min_h = 128;
inputs[| 0] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF)
@ -103,11 +102,11 @@ function Node_Fluid_Domain(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group)
outputs[| 0].setValue(domain);
} #region
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region
var bbox = drawGetBbox(xx, yy, _s);
var _mat = getInputData(1);
if(!is_surface(_mat)) return;
draw_surface_fit(_mat, bbox.xc, bbox.yc, bbox.w, bbox.h);
}
} #endregion
}

View file

@ -1,4 +1,4 @@
#macro FLUID_DOMAIN_CHECK if(!is_instanceof(group, Node_Fluid_Group)) return; if(!instance_exists(_dom)) _dom = group.domain; if(_dom == noone || !instance_exists(_dom)) return;
#macro FLUID_DOMAIN_CHECK if(!instance_exists(_dom) && is_instanceof(group, Node_Fluid_Group)) _dom = group.domain; if(_dom == noone || !instance_exists(_dom)) return;
function Node_Fluid_Group(_x, _y, _group = noone) : Node_Collection(_x, _y, _group) constructor {
name = "SmokeSim";

View file

@ -0,0 +1,15 @@
function Node_Fluid_Group_Inline(_x, _y, _group = noone) : Node_Collection_Inline(_x, _y, _group) constructor {
name = "SmokeSim";
color = COLORS.node_blend_smoke;
icon = THEME.smoke_sim;
if(!LOADING && !APPENDING && !CLONING) {
var _domain = nodeBuild("Node_Fluid_Domain", x, y);
var _render = nodeBuild("Node_Fluid_Render", x + 320, y);
_render.inputs[| 0].setFrom(_domain.outputs[| 0]);
addNode(_domain);
addNode(_render);
}
}

View file

@ -0,0 +1,11 @@
{
"resourceType": "GMScript",
"resourceVersion": "1.0",
"name": "node_fluid_sim_inline",
"isCompatibility": false,
"isDnD": false,
"parent": {
"name": "smokeSim",
"path": "folders/nodes/data/simulation/smokeSim.yy",
},
}

View file

@ -10,6 +10,7 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { #regio
deprecated = false;
show_in_recent = true;
show_in_global = true;
is_patreon_extra = false;
@ -52,6 +53,12 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { #regio
return self;
} #endregion
static hideGlobal = function() { #region
INLINE
show_in_global = false;
return self;
} #endregion
static patreonExtra = function() { #region
INLINE
is_patreon_extra = true;
@ -296,11 +303,11 @@ function __initNodes() {
#endregion
var vfx = ds_list_create(); #region
addNodeCatagory("VFX", vfx, ["Node_VFX_Group"]);
addNodeCatagory("VFX", vfx, ["Node_VFX_Group", "Node_VFX_Group_Inline"]);
ds_list_add(vfx, "Groups");
addNodeObject(vfx, "Input", s_node_vfx_input, "Node_Group_Input", [1, Node_Group_Input]).hideRecent();
addNodeObject(vfx, "Output", s_node_vfx_output, "Node_Group_Output", [1, Node_Group_Output]).hideRecent();
addNodeObject(vfx, "Renderer", s_node_vfx_render_output, "Node_VFX_Renderer_Output", [1, Node_VFX_Renderer_Output]).hideRecent();
addNodeObject(vfx, "Input", s_node_vfx_input, "Node_Group_Input", [1, Node_Group_Input]).hideRecent().hideGlobal();
addNodeObject(vfx, "Output", s_node_vfx_output, "Node_Group_Output", [1, Node_Group_Output]).hideRecent().hideGlobal();
addNodeObject(vfx, "Renderer", s_node_vfx_render_output, "Node_VFX_Renderer_Output", [1, Node_VFX_Renderer_Output]).hideRecent().hideGlobal();
ds_list_add(vfx, "VFXs");
addNodeObject(vfx, "Spawner", s_node_vfx_spawn, "Node_VFX_Spawner", [1, Node_VFX_Spawner],, "Spawn new particles.").hideRecent();
@ -325,11 +332,11 @@ function __initNodes() {
#endregion
var rigidSim = ds_list_create(); #region
addNodeCatagory("RigidSim", rigidSim, ["Node_Rigid_Group"]);
addNodeCatagory("RigidSim", rigidSim, ["Node_Rigid_Group", "Node_Rigid_Group_Inline"]);
ds_list_add(rigidSim, "Group");
addNodeObject(rigidSim, "Input", s_node_group_input, "Node_Group_Input", [1, Node_Group_Input]).hideRecent();
addNodeObject(rigidSim, "Output", s_node_group_output, "Node_Group_Output", [1, Node_Group_Output]).hideRecent();
addNodeObject(rigidSim, "Render", s_node_rigidSim_render_output, "Node_Rigid_Render_Output", [1, Node_Rigid_Render_Output]).hideRecent();
addNodeObject(rigidSim, "Input", s_node_group_input, "Node_Group_Input", [1, Node_Group_Input]).hideRecent().hideGlobal();
addNodeObject(rigidSim, "Output", s_node_group_output, "Node_Group_Output", [1, Node_Group_Output]).hideRecent().hideGlobal();
addNodeObject(rigidSim, "Render", s_node_rigidSim_render_output, "Node_Rigid_Render_Output", [1, Node_Rigid_Render_Output]).hideRecent().hideGlobal();
ds_list_add(rigidSim, "RigidSim");
addNodeObject(rigidSim, "Object", s_node_rigidSim_object, "Node_Rigid_Object", [1, Node_Rigid_Object],, "Spawn a rigidbody object.").hideRecent().setVersion(1110);
@ -344,12 +351,12 @@ function __initNodes() {
#endregion
var smokeSim = ds_list_create(); #region
addNodeCatagory("SmokeSim", smokeSim, ["Node_Fluid_Group"]);
addNodeCatagory("SmokeSim", smokeSim, ["Node_Fluid_Group", "Node_Fluid_Group_Inline"]);
ds_list_add(smokeSim, "Group");
addNodeObject(smokeSim, "Input", s_node_group_input, "Node_Group_Input", [1, Node_Group_Input]).hideRecent();
addNodeObject(smokeSim, "Output", s_node_group_output, "Node_Group_Output", [1, Node_Group_Output]).hideRecent();
addNodeObject(smokeSim, "Render Domain", s_node_smokeSim_render_output, "Node_Fluid_Render_Output", [1, Node_Fluid_Render_Output]).hideRecent().setVersion(11540);
addNodeObject(smokeSim, "Input", s_node_group_input, "Node_Group_Input", [1, Node_Group_Input]).hideRecent().hideGlobal();
addNodeObject(smokeSim, "Output", s_node_group_output, "Node_Group_Output", [1, Node_Group_Output]).hideRecent().hideGlobal();
addNodeObject(smokeSim, "Render Domain", s_node_smokeSim_render_output, "Node_Fluid_Render_Output", [1, Node_Fluid_Render_Output]).hideRecent().setVersion(11540).hideGlobal();
ds_list_add(smokeSim, "Domain");
addNodeObject(smokeSim, "Domain", s_node_smokeSim_domain, "Node_Fluid_Domain", [1, Node_Fluid_Domain]).hideRecent().setVersion(1120);
addNodeObject(smokeSim, "Update Domain", s_node_smokeSim_update, "Node_Fluid_Update", [1, Node_Fluid_Update],, "Run smoke by one step.").hideRecent().setVersion(1120);
@ -366,10 +373,10 @@ function __initNodes() {
#endregion
var strandSim = ds_list_create(); #region
addNodeCatagory("StrandSim", strandSim, ["Node_Strand_Group"]);
addNodeCatagory("StrandSim", strandSim, ["Node_Strand_Group", "Node_Strand_Group_Inline"]);
ds_list_add(strandSim, "Group");
addNodeObject(strandSim, "Input", s_node_group_input, "Node_Group_Input", [1, Node_Group_Input]).hideRecent();
addNodeObject(strandSim, "Output", s_node_group_output, "Node_Group_Output", [1, Node_Group_Output]).hideRecent();
addNodeObject(strandSim, "Input", s_node_group_input, "Node_Group_Input", [1, Node_Group_Input]).hideRecent().hideGlobal();
addNodeObject(strandSim, "Output", s_node_group_output, "Node_Group_Output", [1, Node_Group_Output]).hideRecent().hideGlobal();
ds_list_add(strandSim, "System");
addNodeObject(strandSim, "Strand Create", s_node_strandSim_create, "Node_Strand_Create", [1, Node_Strand_Create],, "Create strands from point, path, or mesh.").hideRecent().setVersion(1140);
@ -607,10 +614,10 @@ function __initNodes() {
ds_list_add(generator, "Simulation");
addNodeObject(generator, "Particle", s_node_particle, "Node_Particle", [1, Node_Particle],, "Generate particle effect.");
addNodeObject(generator, "VFX", s_node_vfx, "Node_VFX_Group", [1, Node_VFX_Group],, "Create VFX group, which generate particles that can be manipulated using different force nodes.");
addNodeObject(generator, "RigidSim", s_node_rigidSim, "Node_Rigid_Group", [1, Node_Rigid_Group],, "Create group for rigidbody simulation.").setVersion(1110);
addNodeObject(generator, "RigidSim Global", s_node_rigidSim_global, "Node_Rigid_Global", [1, Node_Rigid_Global]).setVersion(1110);
addNodeObject(generator, "SmokeSim", s_node_smokeSim_group, "Node_Fluid_Group", [1, Node_Fluid_Group],, "Create group for fluid simulation.").setVersion(1120);
addNodeObject(generator, "StrandSim", s_node_strandSim, "Node_Strand_Group", [1, Node_Strand_Group], ["Hair"], "Create group for hair simulation.").setVersion(1140);
addNodeObject(generator, "Inline VFX", s_node_vfx, "Node_VFX_Group_Inline", [1, Node_VFX_Group_Inline],, "Create VFX group, which generate particles that can be manipulated using different force nodes.");
addNodeObject(generator, "RigidSim", s_node_rigidSim, "Node_Rigid_Group_Inline", [1, Node_Rigid_Group_Inline],, "Create group for rigidbody simulation.").setVersion(1110);
addNodeObject(generator, "SmokeSim", s_node_smokeSim_group, "Node_Fluid_Group_Inline", [1, Node_Fluid_Group_Inline],, "Create group for fluid simulation.").setVersion(1120);
addNodeObject(generator, "StrandSim", s_node_strandSim, "Node_Strand_Group_Inline", [1, Node_Strand_Group_Inline], ["Hair"], "Create group for hair simulation.").setVersion(1140);
ds_list_add(generator, "Region");
addNodeObject(generator, "Separate Shape", s_node_sepearte_shape, "Node_Seperate_Shape", [1, Node_Seperate_Shape],, "Separate disconnected pixel each into an image in an image array.");
@ -985,8 +992,11 @@ function __initNodes() {
addNodeObject(hid, "Sort Input", s_node_grid_hex_noise, "Node_Iterator_Sort_Input", [1, Node_Iterator_Sort_Input]).hideRecent();
addNodeObject(hid, "Sort Output", s_node_grid_hex_noise, "Node_Iterator_Sort_Output", [1, Node_Iterator_Sort_Output]).hideRecent();
addNodeObject(hid, "Onion Skin", s_node_cache, "Node_Onion_Skin", [1, Node_Onion_Skin]).setVersion(1147).hideRecent();
//addNodeObject(hid, "Pixel Builder", s_node_pixel_builder, "Node_Pixel_Builder", [1, Node_Pixel_Builder]).setVersion(1150).hideRecent();
addNodeObject(hid, "RigidSim", s_node_rigidSim, "Node_Rigid_Group", [1, Node_Rigid_Group],, "Create group for rigidbody simulation.").setVersion(1110).hideRecent();
addNodeObject(hid, "RigidSim Global", s_node_rigidSim_global, "Node_Rigid_Global", [1, Node_Rigid_Global]).setVersion(1110).hideRecent();
addNodeObject(hid, "SmokeSim", s_node_smokeSim_group, "Node_Fluid_Group", [1, Node_Fluid_Group],, "Create group for fluid simulation.").setVersion(1120).hideRecent();
addNodeObject(hid, "StrandSim", s_node_strandSim, "Node_Strand_Group", [1, Node_Strand_Group], ["Hair"], "Create group for hair simulation.").setVersion(1140).hideRecent();
ds_list_add(hid, "DynaSurf");
addNodeObject(hid, "Input", s_node_pixel_builder, "Node_DynaSurf_In", [1, Node_DynaSurf_In]).hideRecent();
addNodeObject(hid, "Output", s_node_pixel_builder, "Node_DynaSurf_Out", [1, Node_DynaSurf_Out]).hideRecent();

View file

@ -0,0 +1,15 @@
function Node_Rigid_Group_Inline(_x, _y, _group = noone) : Node_Collection_Inline(_x, _y, _group) constructor {
name = "RigidSim";
color = COLORS.node_blend_simulation;
icon = THEME.rigidSim;
if(!LOADING && !APPENDING && !CLONING) {
var _object = nodeBuild("Node_Rigid_Object", x, y);
var _output = nodeBuild("Node_Rigid_Render", x + 160, y);
_output.inputs[| 2].setFrom(_object.outputs[| 0])
addNode(_object);
addNode(_output);
}
}

View file

@ -0,0 +1,11 @@
{
"resourceType": "GMScript",
"resourceVersion": "1.0",
"name": "node_rigid_group_inline",
"isCompatibility": false,
"isDnD": false,
"parent": {
"name": "rigidSim",
"path": "folders/nodes/data/simulation/rigidSim.yy",
},
}

View file

@ -57,11 +57,14 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
.rejectArray()
.setAnimable(false);
inputs[| 12] = nodeValue("Collision group", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.rejectArray()
outputs[| 0] = nodeValue("Object", self, JUNCTION_CONNECT.output, VALUE_TYPE.rigid, self);
input_display_list = [ 8,
input_display_list = [ 8, 12,
["Texture", false], 6,
["Physical", false], 0, 1, 2, 3, 4,
["Physical", false], 0, 1, 2, 3, 4,
["Shape", false], 7, 5, 9, 10, 11,
];
@ -514,11 +517,12 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
} #endregion
static fixtureCreate = function(fixture, object, dx = 0, dy = 0) { #region
var _mov = getInputData(0);
var _den = getInputData(1);
var _cnt_frc = getInputData(2);
var _air_frc = getInputData(3);
var _rot_frc = getInputData(4);
var _mov = getInputData(0);
var _den = getInputData(1);
var _cnt_frc = getInputData(2);
var _air_frc = getInputData(3);
var _rot_frc = getInputData(4);
var collIndex = getInputData(12);
if(!_mov) {
physics_fixture_set_kinematic(fixture);
@ -530,8 +534,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
physics_fixture_set_linear_damping(fixture, _air_frc);
physics_fixture_set_angular_damping(fixture, _rot_frc);
physics_fixture_set_awake(fixture, true);
if(group != noone)
physics_fixture_set_collision_group(fixture, group.collIndex);
physics_fixture_set_collision_group(fixture, collIndex);
array_push(object.fixture, physics_fixture_bind_ext(fixture, object, dx, dy));
physics_fixture_delete(fixture);

View file

@ -1,17 +1,26 @@
function Node_Strand_Group(_x, _y, _group = noone) : Node_Collection_Inline(_x, _y, _group) constructor {
function Node_Strand_Group(_x, _y, _group = noone) : Node_Collection(_x, _y, _group) constructor {
name = "StrandSim";
color = COLORS.node_blend_strand;
icon = THEME.strandSim;
ungroupable = false;
update_on_frame = true;
if(!LOADING && !APPENDING && !CLONING) {
var _create = nodeBuild("Node_Strand_Create", x, y);
var _render = nodeBuild("Node_Strand_Render", x + 256, y);
var _create = nodeBuild("Node_Strand_Create", -384, -32, self);
var _update = nodeBuild("Node_Strand_Update", 0, -32, self);
var _render = nodeBuild("Node_Strand_Render", 128, -32, self);
var _output = nodeBuild("Node_Group_Output", 384, -32, self);
_render.inputs[| 1].setFrom(_create.outputs[| 0]);
_output.inputs[| 0].setFrom(_render.outputs[| 0]);
_render.inputs[| 1].setFrom(_update.outputs[| 0]);
_update.inputs[| 0].setFrom(_create.outputs[| 0]);
}
static onStep = function() {
RETURN_ON_REST
addNode(_create);
addNode(_render);
setRenderStatus(false);
RENDER_ALL
}
}

View file

@ -0,0 +1,17 @@
function Node_Strand_Group_Inline(_x, _y, _group = noone) : Node_Collection_Inline(_x, _y, _group) constructor {
name = "StrandSim";
color = COLORS.node_blend_strand;
icon = THEME.strandSim;
update_on_frame = true;
if(!LOADING && !APPENDING && !CLONING) {
var _create = nodeBuild("Node_Strand_Create", x, y);
var _render = nodeBuild("Node_Strand_Render", x + 256, y);
_render.inputs[| 1].setFrom(_create.outputs[| 0]);
addNode(_create);
addNode(_render);
}
}

View file

@ -0,0 +1,11 @@
{
"resourceType": "GMScript",
"resourceVersion": "1.0",
"name": "node_strand_sim_inline",
"isCompatibility": false,
"isDnD": false,
"parent": {
"name": "strandSim",
"path": "folders/nodes/data/simulation/strandSim.yy",
},
}