Fix several VFX bugs

This commit is contained in:
MakhamDev 2023-10-09 21:07:33 +07:00
parent 20073fd98c
commit 73ebadbfaa
180 changed files with 927 additions and 532 deletions

View file

@ -216,6 +216,7 @@
{"name":"biterator","order":2,"path":"folders/VCT/biterator.yy",}, {"name":"biterator","order":2,"path":"folders/VCT/biterator.yy",},
{"name":"widget","order":3,"path":"folders/VCT/widget.yy",}, {"name":"widget","order":3,"path":"folders/VCT/widget.yy",},
{"name":"widgets","order":5,"path":"folders/widgets.yy",}, {"name":"widgets","order":5,"path":"folders/widgets.yy",},
{"name":"effector","order":18,"path":"folders/nodes/data/simulation/VFX/effector.yy",},
], ],
"ResourceOrderSettings": [ "ResourceOrderSettings": [
{"name":"s_node_corner","order":16,"path":"sprites/s_node_corner/s_node_corner.yy",}, {"name":"s_node_corner","order":16,"path":"sprites/s_node_corner/s_node_corner.yy",},
@ -268,7 +269,7 @@
{"name":"node_2d_light","order":1,"path":"scripts/node_2d_light/node_2d_light.yy",}, {"name":"node_2d_light","order":1,"path":"scripts/node_2d_light/node_2d_light.yy",},
{"name":"node_rigid_activation","order":7,"path":"scripts/node_rigid_activation/node_rigid_activation.yy",}, {"name":"node_rigid_activation","order":7,"path":"scripts/node_rigid_activation/node_rigid_activation.yy",},
{"name":"s_node_image_gif","order":4,"path":"sprites/s_node_image_gif/s_node_image_gif.yy",}, {"name":"s_node_image_gif","order":4,"path":"sprites/s_node_image_gif/s_node_image_gif.yy",},
{"name":"node_VFX_effect_wind","order":5,"path":"scripts/node_VFX_effect_wind/node_VFX_effect_wind.yy",}, {"name":"node_VFX_effect_wind","order":7,"path":"scripts/node_VFX_effect_wind/node_VFX_effect_wind.yy",},
{"name":"s_node_tunnel_out","order":22,"path":"sprites/s_node_tunnel_out/s_node_tunnel_out.yy",}, {"name":"s_node_tunnel_out","order":22,"path":"sprites/s_node_tunnel_out/s_node_tunnel_out.yy",},
{"name":"__background_set_element","order":3,"path":"scripts/__background_set_element/__background_set_element.yy",}, {"name":"__background_set_element","order":3,"path":"scripts/__background_set_element/__background_set_element.yy",},
{"name":"s_node_3d_obj","order":3,"path":"sprites/s_node_3d_obj/s_node_3d_obj.yy",}, {"name":"s_node_3d_obj","order":3,"path":"sprites/s_node_3d_obj/s_node_3d_obj.yy",},
@ -679,7 +680,7 @@
{"name":"fd_rectangle_get_pressure_height","order":16,"path":"scripts/fd_rectangle_get_pressure_height/fd_rectangle_get_pressure_height.yy",}, {"name":"fd_rectangle_get_pressure_height","order":16,"path":"scripts/fd_rectangle_get_pressure_height/fd_rectangle_get_pressure_height.yy",},
{"name":"hyperbolic_function","order":16,"path":"scripts/hyperbolic_function/hyperbolic_function.yy",}, {"name":"hyperbolic_function","order":16,"path":"scripts/hyperbolic_function/hyperbolic_function.yy",},
{"name":"sh_rsh_rotate","order":1,"path":"shaders/sh_rsh_rotate/sh_rsh_rotate.yy",}, {"name":"sh_rsh_rotate","order":1,"path":"shaders/sh_rsh_rotate/sh_rsh_rotate.yy",},
{"name":"node_VFX_effect_destroy","order":12,"path":"scripts/node_VFX_effect_destroy/node_VFX_effect_destroy.yy",}, {"name":"node_VFX_effect_destroy","order":3,"path":"scripts/node_VFX_effect_destroy/node_VFX_effect_destroy.yy",},
{"name":"node_cache","order":9,"path":"scripts/node_cache/node_cache.yy",}, {"name":"node_cache","order":9,"path":"scripts/node_cache/node_cache.yy",},
{"name":"sh_bw","order":3,"path":"shaders/sh_bw/sh_bw.yy",}, {"name":"sh_bw","order":3,"path":"shaders/sh_bw/sh_bw.yy",},
{"name":"var_comparison","order":1,"path":"scripts/var_comparison/var_comparison.yy",}, {"name":"var_comparison","order":1,"path":"scripts/var_comparison/var_comparison.yy",},
@ -709,10 +710,10 @@
{"name":"sh_threshold","order":18,"path":"shaders/sh_threshold/sh_threshold.yy",}, {"name":"sh_threshold","order":18,"path":"shaders/sh_threshold/sh_threshold.yy",},
{"name":"fd_rectangle_set_initial_value_pressure","order":3,"path":"scripts/fd_rectangle_set_initial_value_pressure/fd_rectangle_set_initial_value_pressure.yy",}, {"name":"fd_rectangle_set_initial_value_pressure","order":3,"path":"scripts/fd_rectangle_set_initial_value_pressure/fd_rectangle_set_initial_value_pressure.yy",},
{"name":"o_dialog_drag_folder","order":2,"path":"objects/o_dialog_drag_folder/o_dialog_drag_folder.yy",}, {"name":"o_dialog_drag_folder","order":2,"path":"objects/o_dialog_drag_folder/o_dialog_drag_folder.yy",},
{"name":"node_VFX_effect_repel","order":9,"path":"scripts/node_VFX_effect_repel/node_VFX_effect_repel.yy",}, {"name":"node_VFX_effect_repel","order":4,"path":"scripts/node_VFX_effect_repel/node_VFX_effect_repel.yy",},
{"name":"s_node_alpha_cut","order":3,"path":"sprites/s_node_alpha_cut/s_node_alpha_cut.yy",}, {"name":"s_node_alpha_cut","order":3,"path":"sprites/s_node_alpha_cut/s_node_alpha_cut.yy",},
{"name":"node_iterator_length","order":4,"path":"scripts/node_iterator_length/node_iterator_length.yy",}, {"name":"node_iterator_length","order":4,"path":"scripts/node_iterator_length/node_iterator_length.yy",},
{"name":"node_VFX_effect_attract","order":8,"path":"scripts/node_VFX_effect_attract/node_VFX_effect_attract.yy",}, {"name":"node_VFX_effect_attract","order":2,"path":"scripts/node_VFX_effect_attract/node_VFX_effect_attract.yy",},
{"name":"sh_d3d_ssao_blur","order":1,"path":"shaders/sh_d3d_ssao_blur/sh_d3d_ssao_blur.yy",}, {"name":"sh_d3d_ssao_blur","order":1,"path":"shaders/sh_d3d_ssao_blur/sh_d3d_ssao_blur.yy",},
{"name":"panel_addon","order":5,"path":"scripts/panel_addon/panel_addon.yy",}, {"name":"panel_addon","order":5,"path":"scripts/panel_addon/panel_addon.yy",},
{"name":"s_node_text_splice","order":6,"path":"sprites/s_node_text_splice/s_node_text_splice.yy",}, {"name":"s_node_text_splice","order":6,"path":"sprites/s_node_text_splice/s_node_text_splice.yy",},
@ -923,7 +924,7 @@
{"name":"color_selector","order":4,"path":"scripts/color_selector/color_selector.yy",}, {"name":"color_selector","order":4,"path":"scripts/color_selector/color_selector.yy",},
{"name":"node_trigger_bool","order":1,"path":"scripts/node_trigger_bool/node_trigger_bool.yy",}, {"name":"node_trigger_bool","order":1,"path":"scripts/node_trigger_bool/node_trigger_bool.yy",},
{"name":"s_node_strandSim_gravity","order":4,"path":"sprites/s_node_strandSim_gravity/s_node_strandSim_gravity.yy",}, {"name":"s_node_strandSim_gravity","order":4,"path":"sprites/s_node_strandSim_gravity/s_node_strandSim_gravity.yy",},
{"name":"node_VFX_effect_turbulence","order":11,"path":"scripts/node_VFX_effect_turbulence/node_VFX_effect_turbulence.yy",}, {"name":"node_VFX_effect_turbulence","order":5,"path":"scripts/node_VFX_effect_turbulence/node_VFX_effect_turbulence.yy",},
{"name":"action_loader","order":15,"path":"scripts/action_loader/action_loader.yy",}, {"name":"action_loader","order":15,"path":"scripts/action_loader/action_loader.yy",},
{"name":"sh_surface_replace_replace","order":1,"path":"shaders/sh_surface_replace_replace/sh_surface_replace_replace.yy",}, {"name":"sh_surface_replace_replace","order":1,"path":"shaders/sh_surface_replace_replace/sh_surface_replace_replace.yy",},
{"name":"node_ase_file_read","order":14,"path":"scripts/node_ase_file_read/node_ase_file_read.yy",}, {"name":"node_ase_file_read","order":14,"path":"scripts/node_ase_file_read/node_ase_file_read.yy",},
@ -977,6 +978,7 @@
{"name":"sh_blend_replace","order":50,"path":"shaders/sh_blend_replace/sh_blend_replace.yy",}, {"name":"sh_blend_replace","order":50,"path":"shaders/sh_blend_replace/sh_blend_replace.yy",},
{"name":"node_rigid_render","order":3,"path":"scripts/node_rigid_render/node_rigid_render.yy",}, {"name":"node_rigid_render","order":3,"path":"scripts/node_rigid_render/node_rigid_render.yy",},
{"name":"node_image_splice_sheet","order":4,"path":"scripts/node_image_splice_sheet/node_image_splice_sheet.yy",}, {"name":"node_image_splice_sheet","order":4,"path":"scripts/node_image_splice_sheet/node_image_splice_sheet.yy",},
{"name":"node_VFX_renderer_output","order":17,"path":"scripts/node_VFX_renderer_output/node_VFX_renderer_output.yy",},
{"name":"sh_posterize_palette","order":12,"path":"shaders/sh_posterize_palette/sh_posterize_palette.yy",}, {"name":"sh_posterize_palette","order":12,"path":"shaders/sh_posterize_palette/sh_posterize_palette.yy",},
{"name":"fd_rectangle_set_material_maccormack_weight","order":6,"path":"scripts/fd_rectangle_set_material_maccormack_weight/fd_rectangle_set_material_maccormack_weight.yy",}, {"name":"fd_rectangle_set_material_maccormack_weight","order":6,"path":"scripts/fd_rectangle_set_material_maccormack_weight/fd_rectangle_set_material_maccormack_weight.yy",},
{"name":"collection_data","order":9,"path":"scripts/collection_data/collection_data.yy",}, {"name":"collection_data","order":9,"path":"scripts/collection_data/collection_data.yy",},
@ -1062,7 +1064,7 @@
{"name":"s_node_cache_array","order":25,"path":"sprites/s_node_cache_array/s_node_cache_array.yy",}, {"name":"s_node_cache_array","order":25,"path":"sprites/s_node_cache_array/s_node_cache_array.yy",},
{"name":"sh_blend_alpha_addition","order":13,"path":"shaders/sh_blend_alpha_addition/sh_blend_alpha_addition.yy",}, {"name":"sh_blend_alpha_addition","order":13,"path":"shaders/sh_blend_alpha_addition/sh_blend_alpha_addition.yy",},
{"name":"widget","order":25,"path":"scripts/widget/widget.yy",}, {"name":"widget","order":25,"path":"scripts/widget/widget.yy",},
{"name":"node_VFX_effect_vortex","order":10,"path":"scripts/node_VFX_effect_vortex/node_VFX_effect_vortex.yy",}, {"name":"node_VFX_effect_vortex","order":6,"path":"scripts/node_VFX_effect_vortex/node_VFX_effect_vortex.yy",},
{"name":"s_node_skew","order":11,"path":"sprites/s_node_skew/s_node_skew.yy",}, {"name":"s_node_skew","order":11,"path":"sprites/s_node_skew/s_node_skew.yy",},
{"name":"s_node_feedback_input","order":10,"path":"sprites/s_node_feedback_input/s_node_feedback_input.yy",}, {"name":"s_node_feedback_input","order":10,"path":"sprites/s_node_feedback_input/s_node_feedback_input.yy",},
{"name":"s_node_path_builder","order":9,"path":"sprites/s_node_path_builder/s_node_path_builder.yy",}, {"name":"s_node_path_builder","order":9,"path":"sprites/s_node_path_builder/s_node_path_builder.yy",},
@ -1442,7 +1444,7 @@
{"name":"s_node_3d_sphere","order":8,"path":"sprites/s_node_3d_sphere/s_node_3d_sphere.yy",}, {"name":"s_node_3d_sphere","order":8,"path":"sprites/s_node_3d_sphere/s_node_3d_sphere.yy",},
{"name":"fd_rectangle_replace_velocity","order":16,"path":"scripts/fd_rectangle_replace_velocity/fd_rectangle_replace_velocity.yy",}, {"name":"fd_rectangle_replace_velocity","order":16,"path":"scripts/fd_rectangle_replace_velocity/fd_rectangle_replace_velocity.yy",},
{"name":"s_node_group_thumbnail","order":34,"path":"sprites/s_node_group_thumbnail/s_node_group_thumbnail.yy",}, {"name":"s_node_group_thumbnail","order":34,"path":"sprites/s_node_group_thumbnail/s_node_group_thumbnail.yy",},
{"name":"node_VFX_effector","order":6,"path":"scripts/node_VFX_effector/node_VFX_effector.yy",}, {"name":"node_VFX_effector","order":8,"path":"scripts/node_VFX_effector/node_VFX_effector.yy",},
{"name":"node_path_shift","order":5,"path":"scripts/node_path_shift/node_path_shift.yy",}, {"name":"node_path_shift","order":5,"path":"scripts/node_path_shift/node_path_shift.yy",},
{"name":"s_node_wav_file_write","order":17,"path":"sprites/s_node_wav_file_write/s_node_wav_file_write.yy",}, {"name":"s_node_wav_file_write","order":17,"path":"sprites/s_node_wav_file_write/s_node_wav_file_write.yy",},
{"name":"s_node_3d_cylinder","order":1,"path":"sprites/s_node_3d_cylinder/s_node_3d_cylinder.yy",}, {"name":"s_node_3d_cylinder","order":1,"path":"sprites/s_node_3d_cylinder/s_node_3d_cylinder.yy",},
@ -1476,6 +1478,7 @@
{"name":"fd_rectangle_add_material","order":4,"path":"scripts/fd_rectangle_add_material/fd_rectangle_add_material.yy",}, {"name":"fd_rectangle_add_material","order":4,"path":"scripts/fd_rectangle_add_material/fd_rectangle_add_material.yy",},
{"name":"fd_rectangle_set_target","order":18,"path":"scripts/fd_rectangle_set_target/fd_rectangle_set_target.yy",}, {"name":"fd_rectangle_set_target","order":18,"path":"scripts/fd_rectangle_set_target/fd_rectangle_set_target.yy",},
{"name":"node_wav_file_read","order":17,"path":"scripts/node_wav_file_read/node_wav_file_read.yy",}, {"name":"node_wav_file_read","order":17,"path":"scripts/node_wav_file_read/node_wav_file_read.yy",},
{"name":"s_node_vfx_render_output","order":12,"path":"sprites/s_node_vfx_render_output/s_node_vfx_render_output.yy",},
{"name":"draw_line_dashed","order":7,"path":"scripts/draw_line_dashed/draw_line_dashed.yy",}, {"name":"draw_line_dashed","order":7,"path":"scripts/draw_line_dashed/draw_line_dashed.yy",},
{"name":"pseudo_regex","order":7,"path":"scripts/pseudo_regex/pseudo_regex.yy",}, {"name":"pseudo_regex","order":7,"path":"scripts/pseudo_regex/pseudo_regex.yy",},
{"name":"node_invert","order":6,"path":"scripts/node_invert/node_invert.yy",}, {"name":"node_invert","order":6,"path":"scripts/node_invert/node_invert.yy",},
@ -1524,7 +1527,7 @@
{"name":"fd_rectangle_get_material_height","order":10,"path":"scripts/fd_rectangle_get_material_height/fd_rectangle_get_material_height.yy",}, {"name":"fd_rectangle_get_material_height","order":10,"path":"scripts/fd_rectangle_get_material_height/fd_rectangle_get_material_height.yy",},
{"name":"rangeBox","order":10,"path":"scripts/rangeBox/rangeBox.yy",}, {"name":"rangeBox","order":10,"path":"scripts/rangeBox/rangeBox.yy",},
{"name":"s_node_array_copy","order":14,"path":"sprites/s_node_array_copy/s_node_array_copy.yy",}, {"name":"s_node_array_copy","order":14,"path":"sprites/s_node_array_copy/s_node_array_copy.yy",},
{"name":"node_VFX_effect_accelerate","order":7,"path":"scripts/node_VFX_effect_accelerate/node_VFX_effect_accelerate.yy",}, {"name":"node_VFX_effect_accelerate","order":1,"path":"scripts/node_VFX_effect_accelerate/node_VFX_effect_accelerate.yy",},
{"name":"node_flood_fill","order":11,"path":"scripts/node_flood_fill/node_flood_fill.yy",}, {"name":"node_flood_fill","order":11,"path":"scripts/node_flood_fill/node_flood_fill.yy",},
{"name":"node_frame","order":1,"path":"scripts/node_frame/node_frame.yy",}, {"name":"node_frame","order":1,"path":"scripts/node_frame/node_frame.yy",},
{"name":"s_node_scale_algo","order":7,"path":"sprites/s_node_scale_algo/s_node_scale_algo.yy",}, {"name":"s_node_scale_algo","order":7,"path":"sprites/s_node_scale_algo/s_node_scale_algo.yy",},

View file

@ -250,6 +250,7 @@
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"biterator","folderPath":"folders/VCT/biterator.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"biterator","folderPath":"folders/VCT/biterator.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"widget","folderPath":"folders/VCT/widget.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"widget","folderPath":"folders/VCT/widget.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"widgets","folderPath":"folders/widgets.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"widgets","folderPath":"folders/widgets.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"effector","folderPath":"folders/nodes/data/simulation/VFX/effector.yy",},
], ],
"IncludedFiles": [ "IncludedFiles": [
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ApolloHelp.html","ConfigValues":{"Itch":{"CopyToMask":"0",},},"CopyToMask":-1,"filePath":"datafiles",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ApolloHelp.html","ConfigValues":{"Itch":{"CopyToMask":"0",},},"CopyToMask":-1,"filePath":"datafiles",},
@ -1618,6 +1619,7 @@
{"id":{"name":"sh_blend_replace","path":"shaders/sh_blend_replace/sh_blend_replace.yy",},}, {"id":{"name":"sh_blend_replace","path":"shaders/sh_blend_replace/sh_blend_replace.yy",},},
{"id":{"name":"node_rigid_render","path":"scripts/node_rigid_render/node_rigid_render.yy",},}, {"id":{"name":"node_rigid_render","path":"scripts/node_rigid_render/node_rigid_render.yy",},},
{"id":{"name":"node_image_splice_sheet","path":"scripts/node_image_splice_sheet/node_image_splice_sheet.yy",},}, {"id":{"name":"node_image_splice_sheet","path":"scripts/node_image_splice_sheet/node_image_splice_sheet.yy",},},
{"id":{"name":"node_VFX_renderer_output","path":"scripts/node_VFX_renderer_output/node_VFX_renderer_output.yy",},},
{"id":{"name":"sh_posterize_palette","path":"shaders/sh_posterize_palette/sh_posterize_palette.yy",},}, {"id":{"name":"sh_posterize_palette","path":"shaders/sh_posterize_palette/sh_posterize_palette.yy",},},
{"id":{"name":"fd_rectangle_set_material_maccormack_weight","path":"scripts/fd_rectangle_set_material_maccormack_weight/fd_rectangle_set_material_maccormack_weight.yy",},}, {"id":{"name":"fd_rectangle_set_material_maccormack_weight","path":"scripts/fd_rectangle_set_material_maccormack_weight/fd_rectangle_set_material_maccormack_weight.yy",},},
{"id":{"name":"collection_data","path":"scripts/collection_data/collection_data.yy",},}, {"id":{"name":"collection_data","path":"scripts/collection_data/collection_data.yy",},},
@ -2196,6 +2198,7 @@
{"id":{"name":"fd_rectangle_add_material","path":"scripts/fd_rectangle_add_material/fd_rectangle_add_material.yy",},}, {"id":{"name":"fd_rectangle_add_material","path":"scripts/fd_rectangle_add_material/fd_rectangle_add_material.yy",},},
{"id":{"name":"fd_rectangle_set_target","path":"scripts/fd_rectangle_set_target/fd_rectangle_set_target.yy",},}, {"id":{"name":"fd_rectangle_set_target","path":"scripts/fd_rectangle_set_target/fd_rectangle_set_target.yy",},},
{"id":{"name":"node_wav_file_read","path":"scripts/node_wav_file_read/node_wav_file_read.yy",},}, {"id":{"name":"node_wav_file_read","path":"scripts/node_wav_file_read/node_wav_file_read.yy",},},
{"id":{"name":"s_node_vfx_render_output","path":"sprites/s_node_vfx_render_output/s_node_vfx_render_output.yy",},},
{"id":{"name":"draw_line_dashed","path":"scripts/draw_line_dashed/draw_line_dashed.yy",},}, {"id":{"name":"draw_line_dashed","path":"scripts/draw_line_dashed/draw_line_dashed.yy",},},
{"id":{"name":"pseudo_regex","path":"scripts/pseudo_regex/pseudo_regex.yy",},}, {"id":{"name":"pseudo_regex","path":"scripts/pseudo_regex/pseudo_regex.yy",},},
{"id":{"name":"node_invert","path":"scripts/node_invert/node_invert.yy",},}, {"id":{"name":"node_invert","path":"scripts/node_invert/node_invert.yy",},},

View file

@ -22,5 +22,13 @@
"connectTo": { "connectTo": {
"key": "connectionType", "key": "connectionType",
"relations": {} "relations": {}
},
"context": {
"key": "contextNode",
"relations": {
"Node_Fluid_Group": [ "Node_Fluid_Add", "Node_Fluid_Apply_Velocity", "Node_Fluid_Update", "Node_Fluid_Render", "Node_Fluid_Render_Output" ],
"Node_Rigid_Group": [ "Node_Rigid_Object", "Node_Rigid_Force_Apply", "Node_Rigid_Render", "Node_Rigid_Render_Output" ],
"Node_Strand_Group": [ "Node_Strand_Create", "Node_Strand_Gravity", "Node_Strand_Update", "Node_Strand_Render", "Node_Strand_Render_Texture" ]
}
} }
} }

View file

@ -318,17 +318,22 @@ event_inherited();
} else if(ADD_NODE_PAGE == NODE_PAGE_DEFAULT) { } else if(ADD_NODE_PAGE == NODE_PAGE_DEFAULT) {
_list = ds_list_create(); _list = ds_list_create();
var sug = [];
if(node_called != noone) { if(node_called != noone) {
var sug = nodeReleatedQuery( array_append(sug, nodeReleatedQuery(
node_called.connect_type == JUNCTION_CONNECT.input? "connectTo" : "connectFrom", node_called.connect_type == JUNCTION_CONNECT.input? "connectTo" : "connectFrom",
node_called.type node_called.type
); ));
}
if(array_length(sug)) { var _cont = PANEL_GRAPH.getCurrentContext();
ds_list_add(_list, "Related"); if(_cont != noone)
for( var i = 0, n = array_length(sug); i < n; i++ ) array_append(sug, nodeReleatedQuery("context", instanceof(_cont)));
ds_list_add(_list, ALL_NODES[? sug[i]]); if(array_length(sug)) {
} ds_list_add(_list, "Related");
for( var i = 0, n = array_length(sug); i < n; i++ )
ds_list_add(_list, ALL_NODES[? sug[i]]);
} }
ds_list_add(_list, "Favourites"); ds_list_add(_list, "Favourites");

View file

@ -98,7 +98,7 @@ _HOVERING_ELEMENT = noone;
if(PROJECT.animator.frame_progress) { if(PROJECT.animator.frame_progress) {
__addon_preAnim(); __addon_preAnim();
if(PROJECT.animator.current_frame == 0) if(CURRENT_FRAME == 0)
ResetAllNodesRender(); ResetAllNodesRender();
Render(true); Render(true);

View file

@ -313,8 +313,8 @@ Project.fps = 0;
function lua_projectData(state) { function lua_projectData(state) {
lua_add_code(state, @" lua_add_code(state, @"
Project.frame = " + string(PROJECT.animator.current_frame) + @"; Project.frame = " + string(CURRENT_FRAME) + @";
Project.frameTotal = " + string(PROJECT.animator.frames_total) + @"; Project.frameTotal = " + string(TOTAL_FRAMES) + @";
Project.fps = " + string(PROJECT.animator.framerate) + @"; Project.fps = " + string(PROJECT.animator.framerate) + @";
"); ");
} }

View file

@ -66,6 +66,8 @@ function __part(_node) constructor {
ground_bounce = 0; ground_bounce = 0;
ground_friction = 1; ground_friction = 1;
frame = 0;
static reset = function() { #region static reset = function() { #region
gml_pragma("forceinline"); gml_pragma("forceinline");
@ -85,7 +87,7 @@ function __part(_node) constructor {
life = _life; life = _life;
life_total = life; life_total = life;
node.onPartCreate(self); if(node.onPartCreate != noone) node.onPartCreate(self);
} #endregion } #endregion
static setPhysic = function(_sx, _sy, _ac, _g, _gDir, _turn, _turnSpd) { #region static setPhysic = function(_sx, _sy, _ac, _g, _gDir, _turn, _turnSpd) { #region
@ -148,19 +150,20 @@ function __part(_node) constructor {
alp_fade = _fade; alp_fade = _fade;
} #endregion } #endregion
static kill = function() { #region static kill = function(callDestroy = true) { #region
gml_pragma("forceinline"); gml_pragma("forceinline");
active = false; active = false;
if(callDestroy && node.onPartDestroy != noone)
node.onPartDestroy(self); node.onPartDestroy(self);
} #endregion } #endregion
static step = function() { #region static step = function(frame = 0) { #region
gml_pragma("forceinline"); gml_pragma("forceinline");
if(!active) return; if(!active) return;
x += speedx; x += speedx;
self.frame = frame;
random_set_seed(seed + life); random_set_seed(seed + life);
@ -192,7 +195,7 @@ function __part(_node) constructor {
if(follow) rot = spVec[1]; if(follow) rot = spVec[1];
else rot += rot_s; else rot += rot_s;
if(step_int > 0 && safe_mod(life, step_int) == 0) if(node.onPartStep != noone && step_int > 0 && safe_mod(life, step_int) == 0)
node.onPartStep(self); node.onPartStep(self);
if(life-- < 0) kill(); if(life-- < 0) kill();
@ -235,15 +238,21 @@ function __part(_node) constructor {
ss = surf[ping >= len? (len - 1) * 2 - ping : ping]; ss = surf[ping >= len? (len - 1) * 2 - ping : ping];
break; break;
case ANIM_END_ACTION.destroy: case ANIM_END_ACTION.destroy:
if(ind >= len) return; if(ind >= len) {
else ss = surf[ind]; //print($"Drawing part destroy when animation end");
kill();
return;
} else ss = surf[ind];
break; break;
} }
} }
var surface = is_instanceof(ss, SurfaceAtlas)? ss.getSurface() : node.surface_cache[$ ss]; var surface = is_instanceof(ss, SurfaceAtlas)? ss.getSurface() : node.surface_cache[$ ss];
if(!is_surface(surface)) return; if(!is_surface(surface)) {
//print($"Drawing part failed: Not a surface");
return;
}
var lifeRat = 1 - life / life_total; var lifeRat = 1 - life / life_total;
var scCurve = sct.get(lifeRat); var scCurve = sct.get(lifeRat);
@ -268,12 +277,16 @@ function __part(_node) constructor {
var x1 = _xx + s_w * 1.5; var x1 = _xx + s_w * 1.5;
var y1 = _yy + s_h * 1.5; var y1 = _yy + s_h * 1.5;
if(x0 > surf_w || y0 > surf_h || x1 < 0 || y1 < 0) return; //culling if(x0 > surf_w || y0 > surf_h || x1 < 0 || y1 < 0) {
//print($"Drawing part failed: Outside view");
return; //culling
}
var cc = (col == -1)? c_white : col.eval(lifeRat); var cc = (col == -1)? c_white : col.eval(lifeRat);
if(blend != c_white) cc = colorMultiply(blend, cc); if(blend != c_white) cc = colorMultiply(blend, cc);
alp_draw = alp * alp_fade.get(lifeRat); alp_draw = alp * alp_fade.get(lifeRat);
//print($"Draw part [{frame}]: {surface} at {_xx}, {_yy}, scale {drawsx}, {drawsy} - {scCurve} color {cc}, {alp_draw}");
draw_surface_ext_safe(surface, _xx, _yy, scx, scy, drawrot, cc, alp_draw); draw_surface_ext_safe(surface, _xx, _yy, scx, scy, drawrot, cc, alp_draw);
} #endregion } #endregion

View file

@ -11,7 +11,7 @@ function __Node_Base(x, y) constructor {
anim_priority = -999; anim_priority = -999;
static step = function() {} static step = function() {}
static update = function(frame = PROJECT.animator.current_frame) {} static update = function(frame = CURRENT_FRAME) {}
static valueUpdate = function(index) {} static valueUpdate = function(index) {}
static triggerRender = function() {} static triggerRender = function() {}

View file

@ -145,7 +145,7 @@ function __Node_3D_Combine(_x, _y, _group = noone) : Node(_x, _y, _group) constr
_3d_clear_local_transform(); _3d_clear_local_transform();
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var _dim = getInputData(0); var _dim = getInputData(0);
var _lpos = getInputData(1); var _lpos = getInputData(1);
var _lrot = getInputData(2); var _lrot = getInputData(2);

View file

@ -194,7 +194,7 @@ function __Node_3D_Obj(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
_3d_clear_local_transform(); _3d_clear_local_transform();
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
if(!surface_exists(tex_surface)) reset_tex(); if(!surface_exists(tex_surface)) reset_tex();
if(do_reset_material) { if(do_reset_material) {

View file

@ -170,7 +170,7 @@
// _3d_clear_local_transform(); // _3d_clear_local_transform();
// } // }
// static update = function(frame = PROJECT.animator.current_frame) { // static update = function(frame = CURRENT_FRAME) {
// if(!surface_exists(tex_surface)) reset_tex(); // if(!surface_exists(tex_surface)) reset_tex();
// if(do_reset_material) { // if(do_reset_material) {

View file

@ -162,7 +162,7 @@ function __Node_3D_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constru
inputs[| 21].setVisible(_proj); inputs[| 21].setVisible(_proj);
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var _dim = getInputData(0); var _dim = getInputData(0);
var _lpos = getInputData(1); var _lpos = getInputData(1);
var _lrot = getInputData(2); var _lrot = getInputData(2);

View file

@ -27,7 +27,7 @@ function Node_Iterator(_x, _y, _group = noone) : Node_Collection(_x, _y, _group)
static doInitLoop = function() {} static doInitLoop = function() {}
static update = function(frame = PROJECT.animator.current_frame) { initLoop(); } static update = function(frame = CURRENT_FRAME) { initLoop(); }
static outputNextNode = function() { static outputNextNode = function() {
LOG_BLOCK_START(); LOG_BLOCK_START();

View file

@ -5,7 +5,7 @@
"isCompatibility": false, "isCompatibility": false,
"isDnD": false, "isDnD": false,
"parent": { "parent": {
"name": "VFX", "name": "effector",
"path": "folders/nodes/data/simulation/VFX.yy", "path": "folders/nodes/data/simulation/VFX/effector.yy",
}, },
} }

View file

@ -177,7 +177,6 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
scatter_index = 0; scatter_index = 0;
def_surface = -1; def_surface = -1;
current_data = [];
surface_cache = {}; surface_cache = {};
wiggle_maps = { wiggle_maps = {
@ -195,46 +194,46 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
for( var i = 0; i < attributes.part_amount; i++ ) for( var i = 0; i < attributes.part_amount; i++ )
parts[i] = new __part(self); parts[i] = new __part(self);
static spawn = function(_time = PROJECT.animator.current_frame, _pos = -1) { #region static spawn = function(_time = CURRENT_FRAME, _pos = -1) { #region
var _inSurf = current_data[ 0]; var _inSurf = getInputData( 0);
var _spawn_amount = current_data[ 2]; var _spawn_amount = getInputData( 2);
var _spawn_area = current_data[ 3]; var _spawn_area = getInputData( 3);
var _distrib = current_data[ 4]; var _distrib = getInputData( 4);
var _dist_map = current_data[30]; var _dist_map = getInputData(30);
var _scatter = current_data[24]; var _scatter = getInputData(24);
var _life = current_data[ 5]; var _life = getInputData( 5);
var _direction = current_data[ 6]; var _direction = getInputData( 6);
var _directCenter = current_data[29]; var _directCenter = getInputData(29);
var _velocity = current_data[18]; var _velocity = getInputData(18);
var _accel = current_data[ 7]; var _accel = getInputData( 7);
var _grav = current_data[19]; var _grav = getInputData(19);
var _gvDir = current_data[33]; var _gvDir = getInputData(33);
var _turn = current_data[34]; var _turn = getInputData(34);
var _turnBi = current_data[35]; var _turnBi = getInputData(35);
var _turnSc = current_data[36]; var _turnSc = getInputData(36);
var _follow = current_data[15]; var _follow = getInputData(15);
var _rotation = current_data[ 8]; var _rotation = getInputData( 8);
var _rotation_speed = current_data[ 9]; var _rotation_speed = getInputData( 9);
var _scale = current_data[10]; var _scale = getInputData(10);
var _size = current_data[17]; var _size = getInputData(17);
var _color = current_data[12]; var _color = getInputData(12);
var _blend = current_data[28]; var _blend = getInputData(28);
var _alpha = current_data[13]; var _alpha = getInputData(13);
var _arr_type = current_data[22]; var _arr_type = getInputData(22);
var _anim_speed = current_data[23]; var _anim_speed = getInputData(23);
var _anim_end = current_data[26]; var _anim_end = getInputData(26);
var _ground = current_data[37]; var _ground = getInputData(37);
var _ground_offset = current_data[38]; var _ground_offset = getInputData(38);
var _ground_bounce = current_data[39]; var _ground_bounce = getInputData(39);
var _ground_frict = current_data[40]; var _ground_frict = getInputData(40);
if(_rotation[1] < _rotation[0]) _rotation[1] += 360; if(_rotation[1] < _rotation[0]) _rotation[1] += 360;
@ -244,7 +243,8 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
var _amo = irandom_range(_spawn_amount[0], _spawn_amount[1]); var _amo = irandom_range(_spawn_amount[0], _spawn_amount[1]);
if(_distrib == 2) _posDist = get_points_from_dist(_dist_map, _amo, seed); if(_distrib == 2) _posDist = get_points_from_dist(_dist_map, _amo, seed);
//print($"Frame {_time}: Spawning {_amo} particles, seed {seed}, {irandom(99999999)}"); //print($"[{display_name}] Frame {_time}: Spawning {_amo} particles, seed {seed}, at {_pos}");
for( var i = 0; i < _amo; i++ ) { for( var i = 0; i < _amo; i++ ) {
seed += 100; seed += 100;
random_set_seed(seed); random_set_seed(seed);
@ -335,49 +335,60 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
static updateParticleForward = function() {} static updateParticleForward = function() {}
function reset() { #region static getSurfaceCache = function() { #region
spawn_index = 0; var surfs = getInputData(0);
scatter_index = 0;
for(var i = 0; i < array_length(parts); i++) { if(!is_array(getInputData(0))) surfs = [ surfs ];
if(!parts[i].active) continue; if(!array_empty(getInputData(0))) {
parts[i].kill(); if(is_array(getInputData(0)))
surfs = array_spread(surfs);
for( var i = 0, n = array_length(surfs); i < n; i++ ) {
if(is_surface(surface_cache[$ surfs[i]])) continue;
surface_cache[$ surfs[i]] = surface_clone(surfs[i]);
}
} }
} #endregion
render(); function reset() { #region
seed = getInputData(32); getInputs(0);
var _wigg_pos = getInputData(41);
var _wigg_rot = getInputData(42);
var _wigg_sca = getInputData(43);
var _wigg_dir = getInputData(20);
wiggle_maps.wig_psx.check(_wigg_pos[0], _wigg_pos[1], seed + 10);
wiggle_maps.wig_psy.check(_wigg_pos[0], _wigg_pos[1], seed + 20);
wiggle_maps.wig_rot.check(_wigg_rot[0], _wigg_rot[1], seed + 30);
wiggle_maps.wig_scx.check(_wigg_sca[0], _wigg_sca[1], seed + 40);
wiggle_maps.wig_scy.check(_wigg_sca[0], _wigg_sca[1], seed + 50);
wiggle_maps.wig_dir.check(_wigg_dir[0], _wigg_dir[1], seed + 60);
var _curve_sca = getInputData(11);
var _curve_alp = getInputData(14);
curve_scale = new curveMap(_curve_sca, PROJECT.animator.frames_total);
curve_alpha = new curveMap(_curve_alp, PROJECT.animator.frames_total);
var keys = variable_struct_get_names(surface_cache); var keys = variable_struct_get_names(surface_cache);
for( var i = 0, n = array_length(keys); i < n; i++ ) for( var i = 0, n = array_length(keys); i < n; i++ )
surface_free_safe(surface_cache[$ keys[i]]); surface_free_safe(surface_cache[$ keys[i]]);
surface_cache = {}; surface_cache = {};
getSurfaceCache();
var _loop = getInputData(21); spawn_index = 0;
if(!_loop) return; scatter_index = 0;
for(var i = 0; i < PROJECT.animator.frames_total; i++) { for(var i = 0; i < array_length(parts); i++) {
runVFX(i, false); if(!parts[i].active) continue;
updateParticleForward(); parts[i].kill(false);
} }
seed = getInputData(32); #region ----- precomputes -----
seed = getInputData(32);
var _wigg_pos = getInputData(41);
var _wigg_rot = getInputData(42);
var _wigg_sca = getInputData(43);
var _wigg_dir = getInputData(20);
wiggle_maps.wig_psx.check(_wigg_pos[0], _wigg_pos[1], seed + 10);
wiggle_maps.wig_psy.check(_wigg_pos[0], _wigg_pos[1], seed + 20);
wiggle_maps.wig_rot.check(_wigg_rot[0], _wigg_rot[1], seed + 30);
wiggle_maps.wig_scx.check(_wigg_sca[0], _wigg_sca[1], seed + 40);
wiggle_maps.wig_scy.check(_wigg_sca[0], _wigg_sca[1], seed + 50);
wiggle_maps.wig_dir.check(_wigg_dir[0], _wigg_dir[1], seed + 60);
var _curve_sca = getInputData(11);
var _curve_alp = getInputData(14);
curve_scale = new curveMap(_curve_sca, TOTAL_FRAMES);
curve_alpha = new curveMap(_curve_alp, TOTAL_FRAMES);
#endregion
render();
} #endregion } #endregion
function checkPartPool() { #region function checkPartPool() { #region
@ -392,7 +403,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
} }
} #endregion } #endregion
static runVFX = function(_time = PROJECT.animator.current_frame, _render = true) { #region static runVFX = function(_time = CURRENT_FRAME, _render = true) { #region
var _spawn_delay = inputs[| 1].getValue(_time); var _spawn_delay = inputs[| 1].getValue(_time);
var _spawn_type = inputs[| 16].getValue(_time); var _spawn_type = inputs[| 16].getValue(_time);
var _spawn_active = inputs[| 27].getValue(_time); var _spawn_active = inputs[| 27].getValue(_time);
@ -400,22 +411,8 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
//print($"{_time} : {_spawn_trig} | {ds_list_to_array(inputs[| 44].animator.values)}"); //print($"{_time} : {_spawn_trig} | {ds_list_to_array(inputs[| 44].animator.values)}");
for( var i = 0; i < ds_list_size(inputs); i++ ) getInputs(_time);
current_data[i] = inputs[| i].getValue(_time); getSurfaceCache();
var surfs = current_data[0];
if(!is_array(current_data[0])) surfs = [ surfs ];
if(!array_empty(current_data[0])) {
if(is_array(current_data[0]))
surfs = array_spread(surfs);
for( var i = 0, n = array_length(surfs); i < n; i++ ) {
if(is_surface(surface_cache[$ surfs[i]])) continue;
surface_cache[$ surfs[i]] = surface_clone(surfs[i]);
}
}
//print(surface_cache);
if(_spawn_active) { if(_spawn_active) {
switch(_spawn_type) { switch(_spawn_type) {
@ -425,11 +422,16 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
} }
} }
//var activeParts = 0;
for(var i = 0; i < array_length(parts); i++) { for(var i = 0; i < array_length(parts); i++) {
if(!parts[i].active) continue; if(!parts[i].active) continue;
parts[i].step(); //activeParts++;
parts[i].step(_time);
} }
//print($"Run VFX frame {_time} seed {seed}");
//print($"[{display_name}] Running VFX frame {_time}: {activeParts} active particles.");
if(!_render) return; if(!_render) return;
render(_time); render(_time);
@ -493,18 +495,18 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
static onDrawOverlay = -1; static onDrawOverlay = -1;
static update = function(frame = PROJECT.animator.current_frame) { #region static update = function(frame = CURRENT_FRAME) { #region
checkPartPool(); checkPartPool();
onUpdate(); onUpdate(frame);
} #endregion } #endregion
static onUpdate = function() {} static onUpdate = function(frame = CURRENT_FRAME) {}
static render = function() {} static render = function() {}
static onPartCreate = function(part) {} static onPartCreate = noone;
static onPartStep = function(part) {} static onPartStep = noone;
static onPartDestroy = function(part) {} static onPartDestroy = noone;
static doSerialize = function(_map) { #region static doSerialize = function(_map) { #region
_map.part_base_length = input_len; _map.part_base_length = input_len;

View file

@ -1,8 +1,9 @@
function Node_Fluid(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { function Node_Fluid(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
color = COLORS.node_blend_fluid; color = COLORS.node_blend_fluid;
icon = THEME.fluid_sim; icon = THEME.fluid_sim;
update_on_frame = true;
static updateForward = function(frame = PROJECT.animator.current_frame, _update = true) { static updateForward = function(frame = CURRENT_FRAME, _update = true) {
if(_update) update(frame); if(_update) update(frame);
//print($"Update {frame}: {name}"); //print($"Update {frame}: {name}");

View file

@ -147,7 +147,7 @@ function _Node_Strand_Affector(_x, _y, _group = noone) : Node(_x, _y, _group) co
active &= inputs[| 3].drawOverlay(active, px, py, _s, _mx, _my, _snx, _sny, 0, 1, THEME.anchor_scale_hori); active &= inputs[| 3].drawOverlay(active, px, py, _s, _mx, _my, _snx, _sny, 0, 1, THEME.anchor_scale_hori);
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var _typ = getInputData(1); var _typ = getInputData(1);
inputs[| 4].setVisible(_typ == 1); inputs[| 4].setVisible(_typ == 1);

View file

@ -154,8 +154,8 @@ function __addon_lua_panel_variable(lua, panel) {
); );
lua_add_code(lua, lua_add_code(lua,
"Animator.frame_current = " + string(PROJECT.animator.current_frame) + "\n" + "Animator.frame_current = " + string(CURRENT_FRAME) + "\n" +
"Animator.frame_total = " + string(PROJECT.animator.frames_total) + "\n" + "Animator.frame_total = " + string(TOTAL_FRAMES) + "\n" +
"Animator.frame_rate = " + string(PROJECT.animator.framerate) + "\n" "Animator.frame_rate = " + string(PROJECT.animator.framerate) + "\n"
); );
} }

View file

@ -7,6 +7,8 @@
} }
#macro ANIMATION_STATIC !(PROJECT.animator.is_playing || PROJECT.animator.frame_progress) #macro ANIMATION_STATIC !(PROJECT.animator.is_playing || PROJECT.animator.frame_progress)
#macro CURRENT_FRAME PROJECT.animator.current_frame
#macro TOTAL_FRAMES PROJECT.animator.frames_total
#endregion #endregion
#region animation class #region animation class

View file

@ -69,7 +69,7 @@ function ase_layer(name) constructor {
cels[index] = cel; cels[index] = cel;
} }
static getCel = function(index = PROJECT.animator.current_frame) { static getCel = function(index = CURRENT_FRAME) {
var ind; var ind;
if(tag != noone) { if(tag != noone) {

View file

@ -285,7 +285,7 @@ function curveBox(_onModify) : widget() constructor {
var cc = merge_color(COLORS._main_icon, COLORS._main_icon_dark, 0.5); var cc = merge_color(COLORS._main_icon, COLORS._main_icon_dark, 0.5);
if(point_in_rectangle(_m[0], _m[1], bxF, byF, _x + _w, byF + byH)) { if(point_in_rectangle(_m[0], _m[1], bxF, byF, _x + _w, byF + byH)) {
cc = COLORS._main_icon; cc = COLORS._main_icon;
if(mouse_click(mb_left, active)) if(mouse_press(mb_left, active))
zooming = true; zooming = true;
} }

View file

@ -117,7 +117,7 @@ function __LOAD_PATH(path, readonly = false, safe_mode = false, override = false
try { try {
if(struct_has(_load_content, "animator")) { if(struct_has(_load_content, "animator")) {
var _anim_map = _load_content.animator; var _anim_map = _load_content.animator;
PROJECT.animator.frames_total = _anim_map.frames_total; TOTAL_FRAMES = _anim_map.frames_total;
PROJECT.animator.framerate = _anim_map.framerate; PROJECT.animator.framerate = _anim_map.framerate;
} }
} catch(e) { } catch(e) {

View file

@ -107,7 +107,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, "", THEME.prop_keyframe, 2) == 2) { if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, "", THEME.prop_keyframe, 2) == 2) {
for(var j = 0; j < ds_list_size(jun.animator.values); j++) { for(var j = 0; j < ds_list_size(jun.animator.values); j++) {
var _key = jun.animator.values[| j]; var _key = jun.animator.values[| j];
if(_key.time > PROJECT.animator.current_frame) { if(_key.time > CURRENT_FRAME) {
PROJECT.animator.setFrame(_key.time); PROJECT.animator.setFrame(_key.time);
break; break;
} }
@ -118,7 +118,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
var cc = COLORS.panel_animation_keyframe_unselected; var cc = COLORS.panel_animation_keyframe_unselected;
var kfFocus = false; var kfFocus = false;
for(var j = 0; j < ds_list_size(jun.animator.values); j++) { for(var j = 0; j < ds_list_size(jun.animator.values); j++) {
if(jun.animator.values[| j].time == PROJECT.animator.current_frame) { if(jun.animator.values[| j].time == CURRENT_FRAME) {
cc = COLORS.panel_animation_keyframe_selected; cc = COLORS.panel_animation_keyframe_selected;
kfFocus = true; kfFocus = true;
break; break;
@ -130,18 +130,18 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
var _add = false; var _add = false;
for(var j = 0; j < ds_list_size(jun.animator.values); j++) { for(var j = 0; j < ds_list_size(jun.animator.values); j++) {
var _key = jun.animator.values[| j]; var _key = jun.animator.values[| j];
if(_key.time == PROJECT.animator.current_frame) { if(_key.time == CURRENT_FRAME) {
if(ds_list_size(jun.animator.values) > 1) if(ds_list_size(jun.animator.values) > 1)
ds_list_delete(jun.animator.values, j); ds_list_delete(jun.animator.values, j);
_add = true; _add = true;
break; break;
} else if(_key.time > PROJECT.animator.current_frame) { } else if(_key.time > CURRENT_FRAME) {
ds_list_insert(jun.animator.values, j, new valueKey(PROJECT.animator.current_frame, jun.showValue(), jun.animator)); ds_list_insert(jun.animator.values, j, new valueKey(CURRENT_FRAME, jun.showValue(), jun.animator));
_add = true; _add = true;
break; break;
} }
} }
if(!_add) ds_list_add(jun.animator.values, new valueKey(PROJECT.animator.current_frame, jun.showValue(), jun.animator)); if(!_add) ds_list_add(jun.animator.values, new valueKey(CURRENT_FRAME, jun.showValue(), jun.animator));
} }
bx -= ui(26); bx -= ui(26);
@ -149,7 +149,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
var _t = -1; var _t = -1;
for(var j = 0; j < ds_list_size(jun.animator.values); j++) { for(var j = 0; j < ds_list_size(jun.animator.values); j++) {
var _key = jun.animator.values[| j]; var _key = jun.animator.values[| j];
if(_key.time < PROJECT.animator.current_frame) if(_key.time < CURRENT_FRAME)
_t = _key.time; _t = _key.time;
} }
if(_t > -1) PROJECT.animator.setFrame(_t); if(_t > -1) PROJECT.animator.setFrame(_t);

View file

@ -36,7 +36,7 @@ function Node_VCT(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) const
vct[$ inputs[| i].display_data.key].setDirect(_data[i]); vct[$ inputs[| i].display_data.key].setDirect(_data[i]);
var params = { var params = {
frame: PROJECT.animator.current_frame frame: CURRENT_FRAME
}; };
return vct.process(params); return vct.process(params);

View file

@ -5,7 +5,7 @@
"isCompatibility": false, "isCompatibility": false,
"isDnD": false, "isDnD": false,
"parent": { "parent": {
"name": "VFX", "name": "effector",
"path": "folders/nodes/data/simulation/VFX.yy", "path": "folders/nodes/data/simulation/VFX/effector.yy",
}, },
} }

View file

@ -5,7 +5,7 @@
"isCompatibility": false, "isCompatibility": false,
"isDnD": false, "isDnD": false,
"parent": { "parent": {
"name": "VFX", "name": "effector",
"path": "folders/nodes/data/simulation/VFX.yy", "path": "folders/nodes/data/simulation/VFX/effector.yy",
}, },
} }

View file

@ -5,7 +5,7 @@
"isCompatibility": false, "isCompatibility": false,
"isDnD": false, "isDnD": false,
"parent": { "parent": {
"name": "VFX", "name": "effector",
"path": "folders/nodes/data/simulation/VFX.yy", "path": "folders/nodes/data/simulation/VFX/effector.yy",
}, },
} }

View file

@ -5,7 +5,7 @@
"isCompatibility": false, "isCompatibility": false,
"isDnD": false, "isDnD": false,
"parent": { "parent": {
"name": "VFX", "name": "effector",
"path": "folders/nodes/data/simulation/VFX.yy", "path": "folders/nodes/data/simulation/VFX/effector.yy",
}, },
} }

View file

@ -5,7 +5,7 @@
"isCompatibility": false, "isCompatibility": false,
"isDnD": false, "isDnD": false,
"parent": { "parent": {
"name": "VFX", "name": "effector",
"path": "folders/nodes/data/simulation/VFX.yy", "path": "folders/nodes/data/simulation/VFX/effector.yy",
}, },
} }

View file

@ -5,7 +5,7 @@
"isCompatibility": false, "isCompatibility": false,
"isDnD": false, "isDnD": false,
"parent": { "parent": {
"name": "VFX", "name": "effector",
"path": "folders/nodes/data/simulation/VFX.yy", "path": "folders/nodes/data/simulation/VFX/effector.yy",
}, },
} }

View file

@ -5,7 +5,7 @@
"isCompatibility": false, "isCompatibility": false,
"isDnD": false, "isDnD": false,
"parent": { "parent": {
"name": "VFX", "name": "effector",
"path": "folders/nodes/data/simulation/VFX.yy", "path": "folders/nodes/data/simulation/VFX/effector.yy",
}, },
} }

View file

@ -139,7 +139,7 @@ function Node_VFX_effector(_x, _y, _group = noone) : Node(_x, _y, _group) constr
onAffect(part, str); onAffect(part, str);
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var val = getInputData(0); var val = getInputData(0);
outputs[| 0].setValue(val); outputs[| 0].setValue(val);
if(val == -1) return; if(val == -1) return;
@ -162,4 +162,6 @@ function Node_VFX_effector(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var bbox = drawGetBbox(xx, yy, _s); var bbox = drawGetBbox(xx, yy, _s);
draw_sprite_fit(node_draw_icon, 0, bbox.xc, bbox.yc, bbox.w, bbox.h); draw_sprite_fit(node_draw_icon, 0, bbox.xc, bbox.yc, bbox.w, bbox.h);
} }
getPreviewingNode = VFX_PREVIEW_NODE;
} }

View file

@ -5,7 +5,7 @@
"isCompatibility": false, "isCompatibility": false,
"isDnD": false, "isDnD": false,
"parent": { "parent": {
"name": "VFX", "name": "effector",
"path": "folders/nodes/data/simulation/VFX.yy", "path": "folders/nodes/data/simulation/VFX/effector.yy",
}, },
} }

View file

@ -1,17 +1,76 @@
function VFX_PREVIEW_NODE() {
if(!is_instanceof(group, Node_VFX_Group)) return self;
return group.getPreviewingNode();
}
function Node_VFX_Group(_x, _y, _group = noone) : Node_Collection(_x, _y, _group) constructor { function Node_VFX_Group(_x, _y, _group = noone) : Node_Collection(_x, _y, _group) constructor {
name = "VFX"; name = "VFX";
color = COLORS.node_blend_vfx; color = COLORS.node_blend_vfx;
icon = THEME.vfx; icon = THEME.vfx;
ungroupable = false;
topoList = ds_list_create();
ungroupable = false;
preview_node = noone;
inputs[| 0] = nodeValue("Loop", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true )
.rejectArray();
custom_input_index = ds_list_size(inputs);
if(!LOADING && !APPENDING && !CLONING) { if(!LOADING && !APPENDING && !CLONING) {
var input = nodeBuild("Node_VFX_Spawner", -256, -32, self); var input = nodeBuild("Node_VFX_Spawner", -256, -32, self);
var renderer = nodeBuild("Node_VFX_Renderer", 256, -32, self); var output = nodeBuild("Node_VFX_Renderer_Output", 256 + 32 * 5, -32, self);
var output = nodeBuild("Node_Group_Output", 256 + 32 * 5, -32, self);
renderer.inputs[| renderer.input_fix_len].setFrom(input.outputs[| 0]); output.inputs[| output.input_fix_len].setFrom(input.outputs[| 0]);
output.inputs[| 0].setFrom(renderer.outputs[| 0]); preview_node = output;
} }
PATCH_STATIC static reset = function() {
for( var i = 0, n = ds_list_size(nodes); i < n; i++ ) {
var node = nodes[| i];
if(is_instanceof(node, Node_VFX_Spawner_Base))
node.reset();
}
var loop = getInputData(0);
if(!loop) return;
for( var i = 0; i < TOTAL_FRAMES; i++ )
for( var j = 0, m = ds_list_size(topoList); j < m; j++ ) {
var node = topoList[| j];
if(is_instanceof(node, Node_VFX_Renderer_Output) ||
is_instanceof(node, Node_VFX_Renderer)) continue;
node.update(i);
}
for( var i = 0, n = ds_list_size(nodes); i < n; i++ ) {
var node = nodes[| i];
if(!is_instanceof(node, Node_VFX_Spawner_Base)) continue;
node.seed = node.getInputData(32);
}
}
static update = function() {
if(CURRENT_FRAME == 0) {
NodeListSort(topoList, nodes);
reset();
}
}
static ononDoubleClick = function(panel) { #region
preview_node = noone;
for( var i = 0, n = ds_list_size(nodes); i < n; i++ ) {
var node = nodes[| i];
if(is_instanceof(node, Node_VFX_Renderer_Output) ||
is_instanceof(node, Node_VFX_Renderer)) {
preview_node = node;
break;
}
}
} #endregion
getPreviewingNode = function() { return preview_node; }
} }

View file

@ -29,7 +29,7 @@ function Node_VFX_Override(_x, _y, _group = noone) : Node(_x, _y, _group) constr
outputs[| 0] = nodeValue("Particles", self, JUNCTION_CONNECT.output, VALUE_TYPE.particle, -1 ); outputs[| 0] = nodeValue("Particles", self, JUNCTION_CONNECT.output, VALUE_TYPE.particle, -1 );
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var parts = getInputData(0); var parts = getInputData(0);
if(!is_array(parts)) return; if(!is_array(parts)) return;
@ -73,4 +73,6 @@ function Node_VFX_Override(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var bbox = drawGetBbox(xx, yy, _s); var bbox = drawGetBbox(xx, yy, _s);
draw_sprite_fit(node_draw_icon, 0, bbox.xc, bbox.yc, bbox.w, bbox.h); draw_sprite_fit(node_draw_icon, 0, bbox.xc, bbox.yc, bbox.w, bbox.h);
} }
getPreviewingNode = VFX_PREVIEW_NODE;
} }

View file

@ -34,7 +34,7 @@ function Node_VFX_Renderer(_x, _y, _group = noone) : Node(_x, _y, _group) constr
static onInspector2Update = function() { clearCache(); } static onInspector2Update = function() { clearCache(); }
static refreshDynamicInput = function() { static refreshDynamicInput = function() { #region
var _l = ds_list_create(); var _l = ds_list_create();
for( var i = 0; i < ds_list_size(inputs); i++ ) { for( var i = 0; i < ds_list_size(inputs); i++ ) {
if(i < input_fix_len || inputs[| i].value_from) if(i < input_fix_len || inputs[| i].value_from)
@ -50,24 +50,27 @@ function Node_VFX_Renderer(_x, _y, _group = noone) : Node(_x, _y, _group) constr
inputs = _l; inputs = _l;
createNewInput(); createNewInput();
} } #endregion
static onValueFromUpdate = function(index) { static onValueFromUpdate = function(index) { #region
if(index < input_fix_len) return; if(index < input_fix_len) return;
if(LOADING || APPENDING) return; if(LOADING || APPENDING) return;
refreshDynamicInput(); refreshDynamicInput();
} } #endregion
static step = function() { static step = function() { #region
var _dim = getInputData(0); var _dim = getInputData(0);
var _outSurf = outputs[| 0].getValue(); var _outSurf = outputs[| 0].getValue();
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth()); _outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
outputs[| 0].setValue(_outSurf); outputs[| 0].setValue(_outSurf);
}
static update = function(_time = PROJECT.animator.current_frame) { if(previewing && is_instanceof(group, Node_VFX_Group))
group.preview_node = self;
} #endregion
static update = function(_time = CURRENT_FRAME) { #region
if(!PROJECT.animator.is_playing) { if(!PROJECT.animator.is_playing) {
recoverCache(); recoverCache();
return; return;
@ -112,5 +115,7 @@ function Node_VFX_Renderer(_x, _y, _group = noone) : Node(_x, _y, _group) constr
surface_reset_shader(); surface_reset_shader();
cacheCurrentFrame(_outSurf); cacheCurrentFrame(_outSurf);
} } #endregion
getPreviewingNode = VFX_PREVIEW_NODE;
} }

View file

@ -0,0 +1,165 @@
function Node_VFX_Renderer_Output(_x, _y, _group = noone) : Node_Group_Output(_x, _y, _group) constructor {
name = "Renderer";
color = COLORS.node_blend_vfx;
icon = THEME.vfx;
use_cache = CACHE_USE.auto;
w = 128;
h = 128;
min_h = h;
previewable = true;
inputs[| 0] = nodeValue("Output dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF)
.setDisplay(VALUE_DISPLAY.vector);
inputs[| 1] = nodeValue("Round position", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true, "Round position to the closest integer value to avoid jittering.")
.rejectArray();
inputs[| 2] = nodeValue("Blend mode", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0 )
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Normal", "Alpha", "Additive" ])
.rejectArray();
setIsDynamicInput(1);
attribute_surface_depth();
attribute_interpolation();
insp2UpdateTooltip = "Clear cache";
insp2UpdateIcon = [ THEME.cache, 0, COLORS._main_icon ];
static onInspector2Update = function() { clearCache(); }
static createNewInput = function() { #region
var index = ds_list_size(inputs);
inputs[| index] = nodeValue("Particles", self, JUNCTION_CONNECT.input, VALUE_TYPE.particle, noone )
.setVisible(true, true);
} if(!LOADING && !APPENDING) createNewInput(); #endregion
static createOutput = function(override_order = true) { #region
if(group == noone) return;
if(!is_struct(group)) return;
if(override_order)
attributes.input_priority = ds_list_size(group.outputs);
if(!is_undefined(outParent))
ds_list_remove(group.outputs, outParent);
outParent = nodeValue("Rendered", group, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone)
.uncache()
.setVisible(true, true);
outParent.from = self;
ds_list_add(group.outputs, outParent);
group.setHeight();
group.sortIO();
} if(!LOADING && !APPENDING) createOutput(); #endregion
static refreshDynamicInput = function() { #region
var _l = ds_list_create();
for( var i = 0; i < ds_list_size(inputs); i++ ) {
if(i < input_fix_len || inputs[| i].value_from)
ds_list_add(_l, inputs[| i]);
else
delete inputs[| i];
}
for( var i = 0; i < ds_list_size(_l); i++ )
_l[| i].index = i;
ds_list_destroy(inputs);
inputs = _l;
createNewInput();
} #endregion
static onValueFromUpdate = function(index) { #region
if(index < input_fix_len) return;
if(LOADING || APPENDING) return;
refreshDynamicInput();
} #endregion
static step = function() { #region
var _dim = getInputData(0);
var _outSurf = outParent.getValue();
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
outParent.setValue(_outSurf);
if(previewing && is_instanceof(group, Node_VFX_Group))
group.preview_node = self;
} #endregion
static update = function(_time = CURRENT_FRAME) { #region
if(!is_instanceof(outParent, NodeValue)) return noone;
var _dim = inputs[| 0].getValue(_time);
var _exact = inputs[| 1].getValue(_time);
var _blend = inputs[| 2].getValue(_time);
var _outSurf = outParent.getValue();
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
outParent.setValue(_outSurf);
surface_set_shader(_outSurf);
shader_set_interpolation(_outSurf);
if(_blend == PARTICLE_BLEND_MODE.normal)
BLEND_NORMAL;
else if(_blend == PARTICLE_BLEND_MODE.alpha)
BLEND_ALPHA;
else if(_blend == PARTICLE_BLEND_MODE.additive)
BLEND_ADD;
var surf_w = surface_get_width_safe(_outSurf);
var surf_h = surface_get_height_safe(_outSurf);
for( var i = input_fix_len; i < ds_list_size(inputs) - 1; i++ ) {
var parts = inputs[| i].getValue(_time);
if(!is_array(parts) || array_length(parts) == 0) continue;
if(!is_array(parts[0])) parts = [ parts ];
//var drawnParts = 0;
for(var j = 0; j < array_length(parts); j++)
for(var k = 0; k < array_length(parts[j]); k++) {
if(!parts[j][k].active) continue;
//drawnParts++;
parts[j][k].draw(_exact, surf_w, surf_h);
}
//print($"Renderer input index {i}: {drawnParts} particles drawn.");
}
BLEND_NORMAL;
surface_reset_shader();
cacheCurrentFrame(_outSurf);
} #endregion
static recoverCache = function(frame = CURRENT_FRAME) { #region
if(!is_instanceof(outParent, NodeValue)) return false;
if(!cacheExist(frame)) return false;
var _s = cached_output[CURRENT_FRAME];
outParent.setValue(_s);
return true;
} #endregion
static getGraphPreviewSurface = function() { #region
if(!is_instanceof(outParent, NodeValue)) return noone;
return outParent.getValue();
} #endregion
static getPreviewValues = function() { #region
if(!is_instanceof(outParent, NodeValue)) return noone;
return outParent.getValue();
} #endregion
getPreviewingNode = VFX_PREVIEW_NODE;
}

View file

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

View file

@ -5,26 +5,24 @@ function Node_VFX_Spawner(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y
attributes.Output_pool = false; attributes.Output_pool = false;
inputs[| 21].setVisible(false, false);
inputs[| input_len + 0] = nodeValue("Spawn trigger", self, JUNCTION_CONNECT.input, VALUE_TYPE.node, false) inputs[| input_len + 0] = nodeValue("Spawn trigger", self, JUNCTION_CONNECT.input, VALUE_TYPE.node, false)
.setVisible(true, true); .setVisible(true, true);
inputs[| input_len + 1] = nodeValue("Step interval", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1, "How often the 'on step' event is triggered.\nWith 1 being trigger every frame, 2 means triggered once every 2 frames."); inputs[| input_len + 1] = nodeValue("Step interval", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1, "How often the 'on step' event is triggered.\nWith 1 being trigger every frame, 2 means triggered once every 2 frames.");
outputs[| 0] = nodeValue("Particles", self, JUNCTION_CONNECT.output, VALUE_TYPE.particle, [] ); outputs[| 0] = nodeValue("Particles", self, JUNCTION_CONNECT.output, VALUE_TYPE.particle, [] );
outputs[| 1] = nodeValue("On create", self, JUNCTION_CONNECT.output, VALUE_TYPE.node, noone ); outputs[| 1] = nodeValue("On create", self, JUNCTION_CONNECT.output, VALUE_TYPE.node, noone );
outputs[| 2] = nodeValue("On step", self, JUNCTION_CONNECT.output, VALUE_TYPE.node, noone ); outputs[| 2] = nodeValue("On step", self, JUNCTION_CONNECT.output, VALUE_TYPE.node, noone );
outputs[| 3] = nodeValue("On destroy", self, JUNCTION_CONNECT.output, VALUE_TYPE.node, noone ); outputs[| 3] = nodeValue("On destroy", self, JUNCTION_CONNECT.output, VALUE_TYPE.node, noone );
array_insert(input_display_list, 0, ["Trigger", true], input_len + 0, input_len + 1); array_insert(input_display_list, 0, ["Trigger", true], input_len + 0, input_len + 1);
UPDATE_PART_FORWARD UPDATE_PART_FORWARD
static onUpdate = function() { #region static onUpdate = function(frame = CURRENT_FRAME) { #region
RETURN_ON_REST runVFX(frame);
if(PROJECT.animator.current_frame == 0)
reset();
runVFX(PROJECT.animator.current_frame);
if(attributes.Output_pool) { if(attributes.Output_pool) {
outputs[| 0].setValue(parts); outputs[| 0].setValue(parts);
@ -52,7 +50,7 @@ function Node_VFX_Spawner(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y
for( var i = 0; i < ds_list_size(vt.value_to); i++ ) { for( var i = 0; i < ds_list_size(vt.value_to); i++ ) {
var _n = vt.value_to[| i]; var _n = vt.value_to[| i];
if(_n.value_from != vt) continue; if(_n.value_from != vt) continue;
_n.node.spawn(, pv); _n.node.spawn(part.frame, pv);
} }
} #endregion } #endregion
@ -65,7 +63,7 @@ function Node_VFX_Spawner(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y
for( var i = 0; i < ds_list_size(vt.value_to); i++ ) { for( var i = 0; i < ds_list_size(vt.value_to); i++ ) {
var _n = vt.value_to[| i]; var _n = vt.value_to[| i];
if(_n.value_from != vt) continue; if(_n.value_from != vt) continue;
_n.node.spawn(, pv); _n.node.spawn(part.frame, pv);
} }
} #endregion } #endregion
@ -78,7 +76,7 @@ function Node_VFX_Spawner(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y
for( var i = 0; i < ds_list_size(vt.value_to); i++ ) { for( var i = 0; i < ds_list_size(vt.value_to); i++ ) {
var _n = vt.value_to[| i]; var _n = vt.value_to[| i];
if(_n.value_from != vt) continue; if(_n.value_from != vt) continue;
_n.node.spawn(, pv); _n.node.spawn(part.frame, pv);
} }
} #endregion } #endregion
@ -100,4 +98,5 @@ function Node_VFX_Spawner(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y
draw_surface_align(spr, cx, cy, ss, fa_center, fa_center); draw_surface_align(spr, cx, cy, ss, fa_center, fa_center);
} #endregion } #endregion
getPreviewingNode = VFX_PREVIEW_NODE;
} }

View file

@ -44,7 +44,7 @@ function Node_VFX_Variable(_x, _y, _group = noone) : Node(_x, _y, _group) constr
.setDisplay(VALUE_DISPLAY.vector) .setDisplay(VALUE_DISPLAY.vector)
.setVisible(false); .setVisible(false);
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var parts = getInputData(0); var parts = getInputData(0);
if(!is_array(parts)) return; if(!is_array(parts)) return;
@ -75,4 +75,6 @@ function Node_VFX_Variable(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var bbox = drawGetBbox(xx, yy, _s); var bbox = drawGetBbox(xx, yy, _s);
draw_sprite_fit(node_draw_icon, 0, bbox.xc, bbox.yc, bbox.w, bbox.h); draw_sprite_fit(node_draw_icon, 0, bbox.xc, bbox.yc, bbox.w, bbox.h);
} }
getPreviewingNode = VFX_PREVIEW_NODE;
} }

View file

@ -26,7 +26,7 @@ function Node_Anim_Curve(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
static processData = function(_output, _data, _output_index, _array_index = 0) { static processData = function(_output, _data, _output_index, _array_index = 0) {
var curve = _data[0]; var curve = _data[0];
var time = _data[4]? PROJECT.animator.current_frame / (PROJECT.animator.frames_total - 1) : _data[1]; var time = _data[4]? CURRENT_FRAME / (TOTAL_FRAMES - 1) : _data[1];
var _min = _data[2]; var _min = _data[2];
var _max = _data[3]; var _max = _data[3];
var val = eval_curve_x(curve, time) * (_max - _min) + _min; var val = eval_curve_x(curve, time) * (_max - _min) + _min;

View file

@ -39,7 +39,7 @@ function Node_Animation_Control(_x, _y, _group = noone) : Node(_x, _y, _group) c
if(getInputData(5)) { if(getInputData(5)) {
var fr = getInputData(6); var fr = getInputData(6);
PROJECT.animator.setFrame(PROJECT.animator.current_frame + fr); PROJECT.animator.setFrame(CURRENT_FRAME + fr);
} }
} }

View file

@ -563,7 +563,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
} }
static update = function(frame = PROJECT.animator.current_frame) { #region static update = function(frame = CURRENT_FRAME) { #region
outputs[| 0].setValue(attributes.bones); outputs[| 0].setValue(attributes.bones);
} #endregion } #endregion

View file

@ -236,7 +236,7 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const
if(_boneCount != _b.childCount()) setBone(); if(_boneCount != _b.childCount()) setBone();
} #endregion } #endregion
static update = function(frame = PROJECT.animator.current_frame) { #region static update = function(frame = CURRENT_FRAME) { #region
var _b = getInputData(0); var _b = getInputData(0);
if(_b == noone) return; if(_b == noone) return;

View file

@ -146,7 +146,7 @@ function Node_Array(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
refreshDynamicInput(); refreshDynamicInput();
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var _typ = getType(); var _typ = getType();
outputs[| 0].setType(_typ); outputs[| 0].setType(_typ);

View file

@ -51,7 +51,7 @@ function Node_Array_Add(_x, _y, _group = noone) : Node(_x, _y, _group) construct
refreshDynamicInput(); refreshDynamicInput();
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var _arr = getInputData(0); var _arr = getInputData(0);
if(inputs[| 0].value_from == noone) { if(inputs[| 0].value_from == noone) {

View file

@ -31,7 +31,7 @@ function Node_Array_Composite(_x, _y, _group = noone) : Node(_x, _y, _group) con
}); });
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var _arr = getInputData(0); var _arr = getInputData(0);
var _ker = getInputData(1); var _ker = getInputData(1);

View file

@ -39,7 +39,7 @@ function Node_Array_Convolute(_x, _y, _group = noone) : Node(_x, _y, _group) con
}); });
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var _arr = getInputData(0); var _arr = getInputData(0);
var _ker = getInputData(1); var _ker = getInputData(1);

View file

@ -25,7 +25,7 @@ function Node_Array_Copy(_x, _y, _group = noone) : Node(_x, _y, _group) construc
outputs[| 0].setType(_typ); outputs[| 0].setType(_typ);
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var _arr = getInputData(0); var _arr = getInputData(0);
var _ind = getInputData(1); var _ind = getInputData(1);
var _siz = getInputData(2); var _siz = getInputData(2);

View file

@ -14,7 +14,7 @@ function Node_Array_CSV_Parse(_x, _y, _group = noone) : Node(_x, _y, _group) con
outputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0) outputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0)
.setArrayDepth(1); .setArrayDepth(1);
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var _str = getInputData(0); var _str = getInputData(0);
var _skp = getInputData(1); var _skp = getInputData(1);

View file

@ -15,7 +15,7 @@ function Node_Array_Find(_x, _y, _group = noone) : Node(_x, _y, _group) construc
outputs[| 0] = nodeValue("Index", self, JUNCTION_CONNECT.output, VALUE_TYPE.integer, 0); outputs[| 0] = nodeValue("Index", self, JUNCTION_CONNECT.output, VALUE_TYPE.integer, 0);
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var _arr = getInputData(0); var _arr = getInputData(0);
inputs[| 0].setType(VALUE_TYPE.any); inputs[| 0].setType(VALUE_TYPE.any);

View file

@ -54,7 +54,7 @@ function Node_Array_Get(_x, _y, _group = noone) : Node(_x, _y, _group) construct
return array_safe_get(_arr, index); return array_safe_get(_arr, index);
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var _arr = getInputData(0); var _arr = getInputData(0);
if(!is_array(_arr)) return; if(!is_array(_arr)) return;

View file

@ -19,7 +19,7 @@ function Node_Array_Insert(_x, _y, _group = noone) : Node(_x, _y, _group) constr
outputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0); outputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0);
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var _arr = getInputData(0); var _arr = getInputData(0);
inputs[| 0].setType(VALUE_TYPE.any); inputs[| 0].setType(VALUE_TYPE.any);

View file

@ -11,7 +11,7 @@ function Node_Array_Length(_x, _y, _group = noone) : Node(_x, _y, _group) constr
outputs[| 0] = nodeValue("Size", self, JUNCTION_CONNECT.output, VALUE_TYPE.integer, 0); outputs[| 0] = nodeValue("Size", self, JUNCTION_CONNECT.output, VALUE_TYPE.integer, 0);
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var _arr = getInputData(0); var _arr = getInputData(0);
inputs[| 0].setType(inputs[| 0].value_from == noone? VALUE_TYPE.any : inputs[| 0].value_from.type); inputs[| 0].setType(inputs[| 0].value_from == noone? VALUE_TYPE.any : inputs[| 0].value_from.type);

View file

@ -15,7 +15,7 @@ function Node_Array_Range(_x, _y, _group = noone) : Node(_x, _y, _group) constru
outputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, []); outputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, []);
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var st = getInputData(0); var st = getInputData(0);
var ed = getInputData(1); var ed = getInputData(1);
var step = getInputData(2); var step = getInputData(2);

View file

@ -42,7 +42,7 @@ function Node_Array_Remove(_x, _y, _group = noone) : Node(_x, _y, _group) constr
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var _arr = getInputData(0); var _arr = getInputData(0);
if(!is_array(_arr)) return; if(!is_array(_arr)) return;

View file

@ -11,7 +11,7 @@ function Node_Array_Reverse(_x, _y, _group = noone) : Node(_x, _y, _group) const
outputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0); outputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0);
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var _arr = getInputData(0); var _arr = getInputData(0);
inputs[| 0].setType(VALUE_TYPE.any); inputs[| 0].setType(VALUE_TYPE.any);

View file

@ -16,7 +16,7 @@ function Node_Array_Set(_x, _y, _group = noone) : Node(_x, _y, _group) construct
outputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0); outputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0);
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var _arr = getInputData(0); var _arr = getInputData(0);
inputs[| 0].setType(VALUE_TYPE.any); inputs[| 0].setType(VALUE_TYPE.any);

View file

@ -13,7 +13,7 @@ function Node_Array_Shift(_x, _y, _group = noone) : Node(_x, _y, _group) constru
outputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0); outputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0);
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var _arr = getInputData(0); var _arr = getInputData(0);
var _shf = getInputData(1); var _shf = getInputData(1);

View file

@ -12,7 +12,7 @@ function Node_Array_Shuffle(_x, _y, _group = noone) : Node(_x, _y, _group) const
outputs[| 0] = nodeValue("Shuffled array", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, []); outputs[| 0] = nodeValue("Shuffled array", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, []);
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var arr = getInputData(0); var arr = getInputData(0);
var sed = getInputData(1); var sed = getInputData(1);

View file

@ -18,7 +18,7 @@ function Node_Array_Sort(_x, _y, _group = noone) : Node(_x, _y, _group) construc
static sortAcs = function(v1, v2) { return v1[1] < v2[1]; } static sortAcs = function(v1, v2) { return v1[1] < v2[1]; }
static sortDes = function(v1, v2) { return v1[1] > v2[1]; } static sortDes = function(v1, v2) { return v1[1] > v2[1]; }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var arr = getInputData(0); var arr = getInputData(0);
var asc = getInputData(1); var asc = getInputData(1);

View file

@ -48,7 +48,7 @@ function Node_Array_Zip(_x, _y, _group = noone) : Node(_x, _y, _group) construct
refreshDynamicInput(); refreshDynamicInput();
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var _arr = getInputData(0); var _arr = getInputData(0);
if(inputs[| 0].value_from == noone) { if(inputs[| 0].value_from == noone) {

View file

@ -122,7 +122,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
var st = tag[? "Frame start"]; var st = tag[? "Frame start"];
var ed = tag[? "Frame end"]; var ed = tag[? "Frame end"];
var rn = ed - st + 1; var rn = ed - st + 1;
var progFr = safe_mod(PROJECT.animator.current_frame - _tag_delay, rn) + 1; var progFr = safe_mod(CURRENT_FRAME - _tag_delay, rn) + 1;
var prog = progFr / rn; var prog = progFr / rn;
var txt = ""; var txt = "";
@ -299,7 +299,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
} }
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var path = getInputData(0); var path = getInputData(0);
var current_tag = getInputData(2); var current_tag = getInputData(2);
if(path_current != path) updatePaths(path); if(path_current != path) updatePaths(path);
@ -316,7 +316,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
_tag_delay = 0; _tag_delay = 0;
for( var i = 0; i < ds_list_size(inputs[| 2].animator.values); i++ ) { for( var i = 0; i < ds_list_size(inputs[| 2].animator.values); i++ ) {
var kf = inputs[| 2].animator.values[| i]; var kf = inputs[| 2].animator.values[| i];
if(kf.time > PROJECT.animator.current_frame) break; if(kf.time > CURRENT_FRAME) break;
_tag_delay = kf.time; _tag_delay = kf.time;
} }
@ -333,7 +333,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
for( var i = 0, n = array_length(layers); i < n; i++ ) { for( var i = 0, n = array_length(layers); i < n; i++ ) {
layers[i].tag = tag; layers[i].tag = tag;
var cel = layers[i].getCel(PROJECT.animator.current_frame - _tag_delay); var cel = layers[i].getCel(CURRENT_FRAME - _tag_delay);
if(!cel) continue; if(!cel) continue;
if(!array_safe_get(vis, i, true)) continue; if(!array_safe_get(vis, i, true)) continue;

View file

@ -34,7 +34,7 @@ function Node_ASE_layer(_x, _y, _group = noone) : Node(_x, _y, _group) construct
} }
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var data = getInputData(0); var data = getInputData(0);
if(data == noone) return; if(data == noone) return;
@ -44,7 +44,7 @@ function Node_ASE_layer(_x, _y, _group = noone) : Node(_x, _y, _group) construct
} }
if(layer_object == noone) return; if(layer_object == noone) return;
var cel = layer_object.getCel(PROJECT.animator.current_frame - data._tag_delay); var cel = layer_object.getCel(CURRENT_FRAME - data._tag_delay);
var celDim = getInputData(1); var celDim = getInputData(1);
var ww = data.content[? "Width"]; var ww = data.content[? "Width"];

View file

@ -12,7 +12,7 @@ function Node_Atlas_Draw(_x, _y, _group = noone) : Node(_x, _y, _group) construc
attribute_interpolation(true); attribute_interpolation(true);
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var dim = getInputData(0); var dim = getInputData(0);
var atl = getInputData(1); var atl = getInputData(1);

View file

@ -25,7 +25,7 @@ function Node_Atlas_Get(_x, _y, _group = noone) : Node(_x, _y, _group) construct
outputs[| 5] = nodeValue("Alpha", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, []) outputs[| 5] = nodeValue("Alpha", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, [])
.setArrayDepth(1); .setArrayDepth(1);
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var atl = getInputData(0); var atl = getInputData(0);
if(atl == noone) return; if(atl == noone) return;

View file

@ -27,7 +27,7 @@ function Node_Atlas_Set(_x, _y, _group = noone) : Node(_x, _y, _group) construct
outputs[| 0] = nodeValue("Atlas", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); outputs[| 0] = nodeValue("Atlas", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var atl = getInputData(0); var atl = getInputData(0);
if(atl == noone) return; if(atl == noone) return;

View file

@ -46,7 +46,7 @@ function Node_Audio_Window(_x, _y, _group = noone) : Node(_x, _y, _group) constr
update_on_frame = _anim; update_on_frame = _anim;
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var _aud = getInputData(0); var _aud = getInputData(0);
if(!is_instanceof(_aud, audioObject)) return; if(!is_instanceof(_aud, audioObject)) return;

View file

@ -26,7 +26,7 @@ function Node_Cache(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
cache_result[cache_loading_progress] = true; cache_result[cache_loading_progress] = true;
cache_loading_progress++; cache_loading_progress++;
if(cache_loading_progress == PROJECT.animator.frames_total) { if(cache_loading_progress == TOTAL_FRAMES) {
cache_loading = false; cache_loading = false;
update(); update();
} }

View file

@ -49,13 +49,13 @@ function Node_Cache_Array(_x, _y, _group = noone) : Node(_x, _y, _group) constru
var stp = getInputData(3); var stp = getInputData(3);
if(str < 0) str = 1; if(str < 0) str = 1;
if(lst < 0) lst = PROJECT.animator.frames_total; if(lst < 0) lst = TOTAL_FRAMES;
str -= 1; str -= 1;
lst -= 1; lst -= 1;
if(PROJECT.animator.current_frame < str) return; if(CURRENT_FRAME < str) return;
if(PROJECT.animator.current_frame > lst) return; if(CURRENT_FRAME > lst) return;
if(lst > str && stp > 0) if(lst > str && stp > 0)
for( var i = str; i <= lst; i += stp ) { for( var i = str; i <= lst; i += stp ) {

View file

@ -990,10 +990,10 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
update_on_frame = fram > 1 && anim; update_on_frame = fram > 1 && anim;
if(update_on_frame) if(update_on_frame)
preview_index = safe_mod(PROJECT.animator.current_frame * anims, fram); preview_index = safe_mod(CURRENT_FRAME * anims, fram);
} #endregion } #endregion
static update = function(frame = PROJECT.animator.current_frame) { #region static update = function(frame = CURRENT_FRAME) { #region
var _dim = getInputData(0); var _dim = getInputData(0);
var _bg = getInputData(8); var _bg = getInputData(8);
var _bga = getInputData(9); var _bga = getInputData(9);
@ -1035,7 +1035,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
} }
if(_anim) { if(_anim) {
var _fr_index = safe_mod(PROJECT.animator.current_frame * _anims, _frames); var _fr_index = safe_mod(CURRENT_FRAME * _anims, _frames);
outputs[| 0].setValue(output_surface[_fr_index]); outputs[| 0].setValue(output_surface[_fr_index]);
} else } else
outputs[| 0].setValue(output_surface); outputs[| 0].setValue(output_surface);

View file

@ -156,12 +156,14 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { #region static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { #region
if(!draw_input_overlay) return; if(!draw_input_overlay) return;
for(var i = custom_input_index; i < ds_list_size(inputs); i++) { for(var i = custom_input_index; i < ds_list_size(inputs); i++) {
var _in = inputs[| i]; var _in = inputs[| i];
var _show = _in.from.getInputData(6); var _show = _in.from.getInputData(6);
if(!_show) continue; if(!_show) continue;
_in.drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny); var _hov = _in.drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
if(_hov != undefined) active &= !_hov;
} }
} #endregion } #endregion
@ -296,7 +298,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
static stepBegin = function() { #region static stepBegin = function() { #region
use_cache = CACHE_USE.none; use_cache = CACHE_USE.none;
array_safe_set(cache_result, PROJECT.animator.current_frame, true); array_safe_set(cache_result, CURRENT_FRAME, true);
var node_list = getNodeList(); var node_list = getNodeList();
for(var i = 0; i < ds_list_size(node_list); i++) { for(var i = 0; i < ds_list_size(node_list); i++) {
@ -305,8 +307,8 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
if(!_node.use_cache) continue; if(!_node.use_cache) continue;
use_cache = CACHE_USE.manual; use_cache = CACHE_USE.manual;
if(!array_safe_get(_node.cache_result, PROJECT.animator.current_frame)) if(!array_safe_get(_node.cache_result, CURRENT_FRAME))
array_safe_set(cache_result, PROJECT.animator.current_frame, false); array_safe_set(cache_result, CURRENT_FRAME, false);
} }
var out_surf = false; var out_surf = false;
@ -506,8 +508,12 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
static onDoubleClick = function(panel) { #region static onDoubleClick = function(panel) { #region
panel.addContext(self); panel.addContext(self);
if(ononDoubleClick != noone)
ononDoubleClick(panel);
} #endregion } #endregion
static ononDoubleClick = noone;
static getGraphPreviewSurface = function() { #region static getGraphPreviewSurface = function() { #region
var _output_junc = outputs[| preview_channel]; var _output_junc = outputs[| preview_channel];
for( var i = 0, n = ds_list_size(nodes); i < n; i++ ) { for( var i = 0, n = ds_list_size(nodes); i < n; i++ ) {

View file

@ -54,7 +54,7 @@ function Node_Compare(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
return 0; return 0;
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var mode = getInputData(0); var mode = getInputData(0);
var a = getInputData(1); var a = getInputData(1);
var b = getInputData(2); var b = getInputData(2);

View file

@ -51,7 +51,7 @@ function Node_Condition(_x, _y, _group = noone) : Node(_x, _y, _group) construct
inputs[| 8].setVisible(_mode == 2, _mode == 2); inputs[| 8].setVisible(_mode == 2, _mode == 2);
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var _true = getInputData(3); var _true = getInputData(3);
var _fals = getInputData(4); var _fals = getInputData(4);

View file

@ -27,13 +27,13 @@ function Node_Counter(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
} }
static processData = function(_output, _data, _output_index, _array_index = 0) { static processData = function(_output, _data, _output_index, _array_index = 0) {
var time = PROJECT.animator.current_frame; var time = CURRENT_FRAME;
var mode = _data[2]; var mode = _data[2];
var val = 0; var val = 0;
switch(mode) { switch(mode) {
case 0 : val = _data[0] + time * _data[1]; break; case 0 : val = _data[0] + time * _data[1]; break;
case 1 : val = time / (PROJECT.animator.frames_total - 1) * _data[1]; break; case 1 : val = time / (TOTAL_FRAMES - 1) * _data[1]; break;
} }
return val; return val;

View file

@ -100,7 +100,7 @@ function Node_CSV_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
update(); update();
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var path = getInputData(0); var path = getInputData(0);
if(path == "") return; if(path == "") return;
if(path_current != path) updatePaths(path); if(path_current != path) updatePaths(path);

View file

@ -48,7 +48,7 @@ function Node_CSV_File_Write(_x, _y, _group = noone) : Node(_x, _y, _group) cons
file_text_close(f); file_text_close(f);
} }
static update = function(frame = PROJECT.animator.current_frame) { writeFile(); } static update = function(frame = CURRENT_FRAME) { writeFile(); }
static onInspector1Update = function() { writeFile(); } static onInspector1Update = function() { writeFile(); }
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {

View file

@ -21,7 +21,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
ds_list_add(PANEL_GRAPH.getNodeList(_group), self); ds_list_add(PANEL_GRAPH.getNodeList(_group), self);
active_index = -1; active_index = -1;
active_range = [ 0, PROJECT.animator.frames_total - 1 ]; active_range = [ 0, TOTAL_FRAMES - 1 ];
#endregion #endregion
static resetInternalName = function() { #region static resetInternalName = function() { #region
@ -163,6 +163,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
preview_mx = 0; preview_mx = 0;
preview_my = 0; preview_my = 0;
getPreviewingNode = noone;
#endregion #endregion
#region ---- rendering ---- #region ---- rendering ----
@ -434,11 +436,11 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
return array_safe_get(inputs_data, index, def); return array_safe_get(inputs_data, index, def);
} #endregion } #endregion
static getInputs = function() { #region static getInputs = function(frame = CURRENT_FRAME) { #region
inputs_data = array_create(ds_list_size(inputs), undefined); inputs_data = array_create(ds_list_size(inputs), undefined);
for(var i = 0; i < ds_list_size(inputs); i++) for(var i = 0; i < ds_list_size(inputs); i++)
inputs_data[i] = inputs[| i].getValue(,,, false); inputs_data[i] = inputs[| i].getValue(frame,,, false);
} #endregion } #endregion
static forceUpdate = function() { #region static forceUpdate = function() { #region
@ -1187,26 +1189,26 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
} #endregion } #endregion
static cacheArrayCheck = function() { #region static cacheArrayCheck = function() { #region
if(array_length(cached_output) != PROJECT.animator.frames_total) if(array_length(cached_output) != TOTAL_FRAMES)
array_resize(cached_output, PROJECT.animator.frames_total); array_resize(cached_output, TOTAL_FRAMES);
if(array_length(cache_result) != PROJECT.animator.frames_total) if(array_length(cache_result) != TOTAL_FRAMES)
array_resize(cache_result, PROJECT.animator.frames_total); array_resize(cache_result, TOTAL_FRAMES);
} #endregion } #endregion
static cacheCurrentFrame = function(_frame) { #region static cacheCurrentFrame = function(_frame) { #region
cacheArrayCheck(); cacheArrayCheck();
if(PROJECT.animator.current_frame < 0) return; if(CURRENT_FRAME < 0) return;
if(PROJECT.animator.current_frame >= array_length(cached_output)) return; if(CURRENT_FRAME >= array_length(cached_output)) return;
surface_array_free(cached_output[PROJECT.animator.current_frame]); surface_array_free(cached_output[CURRENT_FRAME]);
cached_output[PROJECT.animator.current_frame] = surface_array_clone(_frame); cached_output[CURRENT_FRAME] = surface_array_clone(_frame);
array_safe_set(cache_result, PROJECT.animator.current_frame, true); array_safe_set(cache_result, CURRENT_FRAME, true);
return cached_output[PROJECT.animator.current_frame]; return cached_output[CURRENT_FRAME];
} #endregion } #endregion
static cacheExist = function(frame = PROJECT.animator.current_frame) { #region static cacheExist = function(frame = CURRENT_FRAME) { #region
if(frame < 0) return false; if(frame < 0) return false;
if(frame >= array_length(cached_output)) return false; if(frame >= array_length(cached_output)) return false;
@ -1217,7 +1219,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
return is_array(s) || surface_exists(s); return is_array(s) || surface_exists(s);
} #endregion } #endregion
static getCacheFrame = function(frame = PROJECT.animator.current_frame) { #region static getCacheFrame = function(frame = CURRENT_FRAME) { #region
if(frame < 0) return false; if(frame < 0) return false;
if(!cacheExist(frame)) return noone; if(!cacheExist(frame)) return noone;
@ -1225,10 +1227,10 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
return surf; return surf;
} #endregion } #endregion
static recoverCache = function(frame = PROJECT.animator.current_frame) { #region static recoverCache = function(frame = CURRENT_FRAME) { #region
if(!cacheExist(frame)) return false; if(!cacheExist(frame)) return false;
var _s = cached_output[PROJECT.animator.current_frame]; var _s = cached_output[CURRENT_FRAME];
outputs[| 0].setValue(_s); outputs[| 0].setValue(_s);
return true; return true;
@ -1241,8 +1243,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
if(!use_cache) return; if(!use_cache) return;
if(!isRenderActive()) return; if(!isRenderActive()) return;
if(array_length(cached_output) != PROJECT.animator.frames_total) if(array_length(cached_output) != TOTAL_FRAMES)
array_resize(cached_output, PROJECT.animator.frames_total); array_resize(cached_output, TOTAL_FRAMES);
for(var i = 0; i < array_length(cached_output); i++) { for(var i = 0; i < array_length(cached_output); i++) {
var _s = cached_output[i]; var _s = cached_output[i];
if(is_surface(_s)) if(is_surface(_s))
@ -1715,5 +1717,5 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
return surface_get_format(_s); return surface_get_format(_s);
} #endregion } #endregion
static toString = function() { return $"PixelComposerNode: {node_id}[{internalName}] {input_hash}"; } static toString = function() { return $"PixelComposerNode [{internalName}]: {node_id}"; }
} }

View file

@ -71,7 +71,7 @@ function Node_Display_Image(_x, _y, _group = noone) : Node(_x, _y, _group) const
return false; return false;
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var path = getInputData(0); var path = getInputData(0);
if(path == "") return; if(path == "") return;
if(path_current != path) updatePaths(path); if(path_current != path) updatePaths(path);

View file

@ -100,7 +100,7 @@ function Node_Dust(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1]); _outSurf = surface_verify(_outSurf, _dim[0], _dim[1]);
outputs[| 0].setValue(_outSurf); outputs[| 0].setValue(_outSurf);
if(PROJECT.animator.current_frame == 0) { if(CURRENT_FRAME == 0) {
dusts = [ new __Dust( 0, _dim[1] / 2 ) ]; dusts = [ new __Dust( 0, _dim[1] / 2 ) ];
} else { } else {
for( var i = 0, n = array_length(dusts); i < n; i++ ) for( var i = 0, n = array_length(dusts); i < n; i++ )

View file

@ -51,7 +51,7 @@ function Node_DynaSurf_In(_x, _y, _group = noone) : Node(_x, _y, _group) constru
} }
} #endregion } #endregion
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
if(is_undefined(inParent)) return; if(is_undefined(inParent)) return;
var _val = inParent.getValue(); var _val = inParent.getValue();

View file

@ -108,7 +108,7 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
inputs[| 11] = nodeValue("Sequence begin", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0); inputs[| 11] = nodeValue("Sequence begin", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0);
inputs[| 12] = nodeValue("Frame range", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [0, -1]) inputs[| 12] = nodeValue("Frame range", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [0, -1])
.setDisplay(VALUE_DISPLAY.slider_range, { range: [0, PROJECT.animator.frames_total, 1] }); .setDisplay(VALUE_DISPLAY.slider_range, { range: [0, TOTAL_FRAMES, 1] });
png_format = [ "INDEX4", "INDEX8", "Default (PNG32)" ]; png_format = [ "INDEX4", "INDEX8", "Default (PNG32)" ];
png_format_r = [ "PNG4", "PNG8" ]; png_format_r = [ "PNG4", "PNG8" ];
@ -369,12 +369,12 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
var float_str = string_digits(str); var float_str = string_digits(str);
if(float_str != "") { if(float_str != "") {
var float_val = string_digits(float_str); var float_val = string_digits(float_str);
var str_val = max(float_val - string_length(string(PROJECT.animator.current_frame + strt)), 0); var str_val = max(float_val - string_length(string(CURRENT_FRAME + strt)), 0);
repeat(str_val) repeat(str_val)
_txt += "0"; _txt += "0";
} }
_txt += string(PROJECT.animator.current_frame + strt); _txt += string(CURRENT_FRAME + strt);
if(_array) array_push(s, [ "f", _txt ]); if(_array) array_push(s, [ "f", _txt ]);
else s += _txt; else s += _txt;
res = true; res = true;
@ -510,10 +510,10 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
if(form >= 1) { if(form >= 1) {
var rng_s = rang[0]; var rng_s = rang[0];
var rng_e = rang[1] == -1? PROJECT.animator.frames_total : rang[1]; var rng_e = rang[1] == -1? TOTAL_FRAMES : rang[1];
if(PROJECT.animator.current_frame < rng_s) return; if(CURRENT_FRAME < rng_s) return;
if(PROJECT.animator.current_frame > rng_e) return; if(CURRENT_FRAME > rng_e) return;
} }
if(is_array(surf)) { if(is_array(surf)) {
@ -523,7 +523,7 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
if(!is_surface(_surf)) continue; if(!is_surface(_surf)) continue;
if(form == NODE_EXPORT_FORMAT.gif) { if(form == NODE_EXPORT_FORMAT.gif) {
p = directory + "/" + string(i) + "/" + string_lead_zero(PROJECT.animator.current_frame, 5) + ".png"; p = directory + "/" + string(i) + "/" + string_lead_zero(CURRENT_FRAME, 5) + ".png";
} else { } else {
if(is_array(path) && array_length(path) == array_length(surf)) if(is_array(path) && array_length(path) == array_length(surf))
p = pathString(path[ safe_mod(i, array_length(path)) ], i); p = pathString(path[ safe_mod(i, array_length(path)) ], i);
@ -546,7 +546,7 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
if(is_array(path)) p = path[0]; if(is_array(path)) p = path[0];
if(form == NODE_EXPORT_FORMAT.gif) if(form == NODE_EXPORT_FORMAT.gif)
p = directory + "/" + string_lead_zero(PROJECT.animator.current_frame, 5) + ".png"; p = directory + "/" + string_lead_zero(CURRENT_FRAME, 5) + ".png";
else else
p = pathString(p); p = pathString(p);
@ -596,7 +596,7 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
playing = true; playing = true;
played = 0; played = 0;
PROJECT.animator.real_frame = -1; PROJECT.animator.real_frame = -1;
PROJECT.animator.current_frame = -1; CURRENT_FRAME = -1;
PROJECT.animator.is_playing = true; PROJECT.animator.is_playing = true;
PROJECT.animator.rendering = true; PROJECT.animator.rendering = true;
@ -628,7 +628,7 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
inputs[| 8].setVisible(anim == 2); inputs[| 8].setVisible(anim == 2);
inputs[| 11].setVisible(anim == 1); inputs[| 11].setVisible(anim == 1);
inputs[| 12].setVisible(anim > 0); inputs[| 12].setVisible(anim > 0);
inputs[| 12].editWidget.maxx = PROJECT.animator.frames_total; inputs[| 12].editWidget.maxx = TOTAL_FRAMES;
inputs[| 13].setVisible(anim < 2); inputs[| 13].setVisible(anim < 2);
if(anim == NODE_EXPORT_FORMAT.gif) { if(anim == NODE_EXPORT_FORMAT.gif) {
@ -644,7 +644,7 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
outputs[| 0].visible = isInLoop(); outputs[| 0].visible = isInLoop();
} #endregion } #endregion
static update = function(frame = PROJECT.animator.current_frame) { #region static update = function(frame = CURRENT_FRAME) { #region
var anim = getInputData(3); var anim = getInputData(3);
if(anim == NODE_EXPORT_FORMAT.single) { if(anim == NODE_EXPORT_FORMAT.single) {
if(isInLoop()) export(); if(isInLoop()) export();
@ -656,12 +656,12 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
return; return;
} }
if(!PROJECT.animator.frame_progress || !playing || PROJECT.animator.current_frame <= -1) if(!PROJECT.animator.frame_progress || !playing || CURRENT_FRAME <= -1)
return; return;
export(); export();
if(PROJECT.animator.current_frame < PROJECT.animator.frames_total - 1) if(CURRENT_FRAME < TOTAL_FRAMES - 1)
return; return;
if(anim != NODE_EXPORT_FORMAT.gif) if(anim != NODE_EXPORT_FORMAT.gif)

View file

@ -15,7 +15,7 @@ function Node_Feedback_Input(_x, _y, _group = noone) : Node_Group_Input(_x, _y,
_node_output = vt; _node_output = vt;
} }
if(PROJECT.animator.current_frame > 0 && _node_output != noone && _node_output.node.cache_value != noone) //use cache from output if(CURRENT_FRAME > 0 && _node_output != noone && _node_output.node.cache_value != noone) //use cache from output
return [ _node_output.node.cache_value, inParent ]; return [ _node_output.node.cache_value, inParent ];
return outputs[| 0].getValueDefault(); return outputs[| 0].getValueDefault();

View file

@ -11,9 +11,9 @@ function Node_Feedback_Output(_x, _y, _group = noone) : Node_Group_Output(_x, _y
cache_value = -1; cache_value = -1;
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
if(inputs[| 0].value_from == noone) return; if(inputs[| 0].value_from == noone) return;
if(PROJECT.animator.current_frame == PROJECT.animator.frames_total - 1) { if(CURRENT_FRAME == TOTAL_FRAMES - 1) {
cache_value = noone; cache_value = noone;
return; return;
} }

View file

@ -54,7 +54,7 @@ function Node_Fluid_Add(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group) con
inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny); inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
} #endregion } #endregion
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var _dom = inputs[| 0].getValue(frame); var _dom = inputs[| 0].getValue(frame);
var _mat = inputs[| 1].getValue(frame); var _mat = inputs[| 1].getValue(frame);
var _pos = inputs[| 2].getValue(frame); var _pos = inputs[| 2].getValue(frame);

View file

@ -34,7 +34,7 @@ function Node_Fluid_Add_Collider(_x, _y, _group = noone) : Node_Fluid(_x, _y, _g
inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny); inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var _dom = inputs[| 0].getValue(frame); var _dom = inputs[| 0].getValue(frame);
var _mat = inputs[| 1].getValue(frame); var _mat = inputs[| 1].getValue(frame);
var _area = inputs[| 2].getValue(frame); var _area = inputs[| 2].getValue(frame);

View file

@ -39,7 +39,7 @@ function Node_Fluid_Apply_Velocity(_x, _y, _group = noone) : Node_Fluid(_x, _y,
inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny); inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var _dom = inputs[| 0].getValue(frame); var _dom = inputs[| 0].getValue(frame);
var _mat = inputs[| 1].getValue(frame); var _mat = inputs[| 1].getValue(frame);
var _pos = inputs[| 2].getValue(frame); var _pos = inputs[| 2].getValue(frame);

View file

@ -51,7 +51,7 @@ function Node_Fluid_Domain(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group)
domain = fd_rectangle_create(256, 256); domain = fd_rectangle_create(256, 256);
_dim_old = [0, 0]; _dim_old = [0, 0];
static update = function(frame = PROJECT.animator.current_frame) { #region static update = function(frame = CURRENT_FRAME) { #region
RETURN_ON_REST RETURN_ON_REST
var _dim = inputs[| 0].getValue(frame); var _dim = inputs[| 0].getValue(frame);
@ -67,7 +67,7 @@ function Node_Fluid_Domain(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group)
var vMac = inputs[| 10].getValue(frame); var vMac = inputs[| 10].getValue(frame);
var wrap = inputs[| 11].getValue(frame); var wrap = inputs[| 11].getValue(frame);
if(PROJECT.animator.current_frame == 0 || !is_surface(domain.sf_world)) { if(CURRENT_FRAME == 0 || !is_surface(domain.sf_world)) {
fd_rectangle_clear(domain); fd_rectangle_clear(domain);
fd_rectangle_destroy(domain); fd_rectangle_destroy(domain);
domain = fd_rectangle_create(_dim[0], _dim[1]); domain = fd_rectangle_create(_dim[0], _dim[1]);

View file

@ -41,7 +41,7 @@ function Node_Fluid_Render(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group)
} }
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
if(recoverCache() || !PROJECT.animator.is_playing) if(recoverCache() || !PROJECT.animator.is_playing)
return; return;

View file

@ -45,7 +45,7 @@ function Node_Fluid_Render_Output(_x, _y, _group = noone) : Node_Group_Output(_x
if(!is_undefined(outParent)) if(!is_undefined(outParent))
ds_list_remove(group.outputs, outParent); ds_list_remove(group.outputs, outParent);
outParent = nodeValue("Value", group, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone) outParent = nodeValue("Rendered", group, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone)
.uncache() .uncache()
.setVisible(true, true); .setVisible(true, true);
outParent.from = self; outParent.from = self;
@ -60,7 +60,7 @@ function Node_Fluid_Render_Output(_x, _y, _group = noone) : Node_Group_Output(_x
outParent.name = display_name; outParent.name = display_name;
} #endregion } #endregion
static update = function(frame = PROJECT.animator.current_frame) { #region static update = function(frame = CURRENT_FRAME) { #region
if(!is_instanceof(outParent, NodeValue)) return noone; if(!is_instanceof(outParent, NodeValue)) return noone;
var _dim = inputs[| 1].getValue(frame); var _dim = inputs[| 1].getValue(frame);
@ -94,11 +94,11 @@ function Node_Fluid_Render_Output(_x, _y, _group = noone) : Node_Group_Output(_x
cacheCurrentFrame(_outSurf); cacheCurrentFrame(_outSurf);
} #endregion } #endregion
static recoverCache = function(frame = PROJECT.animator.current_frame) { #region static recoverCache = function(frame = CURRENT_FRAME) { #region
if(!is_instanceof(outParent, NodeValue)) return false; if(!is_instanceof(outParent, NodeValue)) return false;
if(!cacheExist(frame)) return false; if(!cacheExist(frame)) return false;
var _s = cached_output[PROJECT.animator.current_frame]; var _s = cached_output[CURRENT_FRAME];
outParent.setValue(_s); outParent.setValue(_s);
return true; return true;

View file

@ -37,7 +37,7 @@ function Node_Fluid_Repulse(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group)
inputs[| 2].drawOverlay(active, px, py, _s, _mx, _my, _snx, _sny, 0, 1, THEME.anchor_scale_hori); inputs[| 2].drawOverlay(active, px, py, _s, _mx, _my, _snx, _sny, 0, 1, THEME.anchor_scale_hori);
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var _dom = inputs[| 0].getValue(frame); var _dom = inputs[| 0].getValue(frame);
var _pos = inputs[| 1].getValue(frame); var _pos = inputs[| 1].getValue(frame);
var _rad = inputs[| 2].getValue(frame); var _rad = inputs[| 2].getValue(frame);

View file

@ -81,7 +81,7 @@ function Node_Fluid_Group(_x, _y, _group = noone) : Node_Collection(_x, _y, _gro
var vMac = getInputData(10); var vMac = getInputData(10);
var wrap = getInputData(11); var wrap = getInputData(11);
if(PROJECT.animator.current_frame == 0 || !is_surface(domain.sf_world)) { if(CURRENT_FRAME == 0 || !is_surface(domain.sf_world)) {
fd_rectangle_clear(domain); fd_rectangle_clear(domain);
fd_rectangle_destroy(domain); fd_rectangle_destroy(domain);
domain = fd_rectangle_create(_dim[0], _dim[1]); domain = fd_rectangle_create(_dim[0], _dim[1]);

View file

@ -31,7 +31,7 @@ function Node_Fluid_Turbulence(_x, _y, _group = noone) : Node_Fluid(_x, _y, _gro
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny); inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var _dom = inputs[| 0].getValue(frame); var _dom = inputs[| 0].getValue(frame);
var _are = inputs[| 1].getValue(frame); var _are = inputs[| 1].getValue(frame);
var _str = inputs[| 2].getValue(frame); var _str = inputs[| 2].getValue(frame);
@ -57,11 +57,9 @@ function Node_Fluid_Turbulence(_x, _y, _group = noone) : Node_Fluid(_x, _y, _gro
shader_reset(); shader_reset();
surface_reset_target(); surface_reset_target();
with(_dom) { fd_rectangle_set_target(_dom, _mod? FD_TARGET_TYPE.ADD_VELOCITY : FD_TARGET_TYPE.REPLACE_VELOCITY);
fd_rectangle_set_target(id, _mod? FD_TARGET_TYPE.ADD_VELOCITY : FD_TARGET_TYPE.REPLACE_VELOCITY); draw_surface_safe(vSurface, 0, 0);
draw_surface_safe(vSurface, 0, 0); fd_rectangle_reset_target(_dom);
fd_rectangle_reset_target(id);
}
surface_free(vSurface); surface_free(vSurface);
} }

View file

@ -17,7 +17,7 @@ function Node_Fluid_Update(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group)
outputs[| 0] = nodeValue("Fluid Domain", self, JUNCTION_CONNECT.output, VALUE_TYPE.fdomain, noone); outputs[| 0] = nodeValue("Fluid Domain", self, JUNCTION_CONNECT.output, VALUE_TYPE.fdomain, noone);
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
if(!PROJECT.animator.is_playing) return; if(!PROJECT.animator.is_playing) return;
var _dom = inputs[| 0].getValue(frame); var _dom = inputs[| 0].getValue(frame);

View file

@ -41,7 +41,7 @@ function Node_Fluid_Vortex(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group)
inputs[| 2].drawOverlay(active, px, py, _s, _mx, _my, _snx, _sny, 0, 1, THEME.anchor_scale_hori); inputs[| 2].drawOverlay(active, px, py, _s, _mx, _my, _snx, _sny, 0, 1, THEME.anchor_scale_hori);
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var _dom = inputs[| 0].getValue(frame); var _dom = inputs[| 0].getValue(frame);
var _pos = inputs[| 1].getValue(frame); var _pos = inputs[| 1].getValue(frame);
var _rad = inputs[| 2].getValue(frame); var _rad = inputs[| 2].getValue(frame);

View file

@ -135,7 +135,7 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { #region static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { #region
if(inParent.isArray()) return; if(inParent.isArray()) return;
inParent.drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny); return inParent.drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
} #endregion } #endregion
static onValueUpdate = function(index = 0) { #region static onValueUpdate = function(index = 0) { #region
@ -358,7 +358,7 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
PATCH_STATIC PATCH_STATIC
static update = function(frame = PROJECT.animator.current_frame) { #region static update = function(frame = CURRENT_FRAME) { #region
if(is_undefined(inParent)) return; if(is_undefined(inParent)) return;
} #endregion } #endregion

View file

@ -92,6 +92,7 @@ function __generate_node_data() { #region
for( var i = 0, n = array_length(_keys); i < n; i++ ) { for( var i = 0, n = array_length(_keys); i < n; i++ ) {
var _group = _json[$ _keys[i]]; var _group = _json[$ _keys[i]];
if(!struct_has(_rel, _keys[i])) if(!struct_has(_rel, _keys[i]))
_rel[$ _keys[i]] = { relations : {} }; _rel[$ _keys[i]] = { relations : {} };
var _Vgroup = _rel[$ _keys[i]].relations; var _Vgroup = _rel[$ _keys[i]].relations;
@ -105,6 +106,13 @@ function __generate_node_data() { #region
array_append(_Vgroup[$ _k], _group.relations[$ _types[j]]); array_append(_Vgroup[$ _k], _group.relations[$ _types[j]]);
} }
break; break;
case "contextNode" :
var _nodes = variable_struct_get_names(_group.relations);
for( var j = 0, m = array_length(_nodes); j < m; j++ ) {
if(!struct_has(_Vgroup, _nodes[j])) _Vgroup[$ _nodes[j]] = [];
array_append(_Vgroup[$ _nodes[j]], _group.relations[$ _nodes[j]]);
}
break;
} }
} }
} }

View file

@ -91,7 +91,7 @@ function Node_Image(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
update(); update();
} }
static update = function(frame = PROJECT.animator.current_frame) { static update = function(frame = CURRENT_FRAME) {
var path = getInputData(0); var path = getInputData(0);
var pad = getInputData(1); var pad = getInputData(1);
if(path == "") return; if(path == "") return;

View file

@ -59,7 +59,7 @@ function Node_Image_Animated(_x, _y, _group = noone) : Node(_x, _y, _group) cons
inputs[| 5] = nodeValue("Set animation length to match", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0) inputs[| 5] = nodeValue("Set animation length to match", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0)
.setDisplay(VALUE_DISPLAY.button, { name: "Match length", onClick: function() { .setDisplay(VALUE_DISPLAY.button, { name: "Match length", onClick: function() {
if(array_length(spr) == 0) return; if(array_length(spr) == 0) return;
PROJECT.animator.frames_total = array_length(spr); TOTAL_FRAMES = array_length(spr);
} }); } });
inputs[| 6] = nodeValue("Custom frame order", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false); inputs[| 6] = nodeValue("Custom frame order", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
@ -149,7 +149,7 @@ function Node_Image_Animated(_x, _y, _group = noone) : Node(_x, _y, _group) cons
inputs[| 4].setVisible(!_cus && !str); inputs[| 4].setVisible(!_cus && !str);
} #endregion } #endregion
static update = function(frame = PROJECT.animator.current_frame) { #region static update = function(frame = CURRENT_FRAME) { #region
var path = getInputData(0); var path = getInputData(0);
if(path == "") return; if(path == "") return;
if(is_array(path) && !array_equals(path, path_loaded)) if(is_array(path) && !array_equals(path, path_loaded))
@ -161,9 +161,9 @@ function Node_Image_Animated(_x, _y, _group = noone) : Node(_x, _y, _group) cons
var _cus = getInputData(6); var _cus = getInputData(6);
var _str = getInputData(2); var _str = getInputData(2);
var _end = getInputData(4); var _end = getInputData(4);
var _spd = _str? (PROJECT.animator.frames_total + 1) / array_length(spr) : 1 / getInputData(3); var _spd = _str? (TOTAL_FRAMES + 1) / array_length(spr) : 1 / getInputData(3);
if(_spd == 0) _spd = 1; if(_spd == 0) _spd = 1;
var _frame = _cus? getInputData(7) : floor(PROJECT.animator.current_frame / _spd); var _frame = _cus? getInputData(7) : floor(CURRENT_FRAME / _spd);
var _len = array_length(spr); var _len = array_length(spr);
var _drw = true; var _drw = true;

View file

@ -35,7 +35,7 @@ function Node_Image_gif(_x, _y, _group = noone) : Node(_x, _y, _group) construct
.setDisplay(VALUE_DISPLAY.button, { name: "Match length", onClick: function() { .setDisplay(VALUE_DISPLAY.button, { name: "Match length", onClick: function() {
if(!spr) return; if(!spr) return;
if(!sprite_exists(spr)) return; if(!sprite_exists(spr)) return;
PROJECT.animator.frames_total = sprite_get_number(spr); TOTAL_FRAMES = sprite_get_number(spr);
PROJECT.animator.framerate = 12; PROJECT.animator.framerate = 12;
} }); } });
@ -138,7 +138,7 @@ function Node_Image_gif(_x, _y, _group = noone) : Node(_x, _y, _group) construct
} }
} #endregion } #endregion
static update = function(frame = PROJECT.animator.current_frame) { #region static update = function(frame = CURRENT_FRAME) { #region
var path = getInputData(0); var path = getInputData(0);
if(path == "") return; if(path == "") return;
if(path_current != path) updatePaths(path); if(path_current != path) updatePaths(path);
@ -176,7 +176,7 @@ function Node_Image_gif(_x, _y, _group = noone) : Node(_x, _y, _group) construct
var _strt = getInputData(4); var _strt = getInputData(4);
var _cust = getInputData(5); var _cust = getInputData(5);
var _spd = getInputData(7); var _spd = getInputData(7);
var _frm = _cust? getInputData(6) : PROJECT.animator.current_frame * _spd - _strt; var _frm = _cust? getInputData(6) : CURRENT_FRAME * _spd - _strt;
var _len = sprite_get_number(spr); var _len = sprite_get_number(spr);
var _drw = true; var _drw = true;

Some files were not shown because too many files have changed in this diff Show more