Pixel-Composer/scripts/node_timeline_preview/node_timeline_preview.gml
2023-10-02 13:57:44 +07:00

23 lines
640 B
Plaintext

function Node_Timeline_Preview(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
name = "Timeline";
use_cache = true;
color = COLORS.node_blend_number;
w = 96;
PANEL_ANIMATION.timeline_preview = self;
inputs[| 0] = nodeValue("Surface", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
static update = function(frame = PROJECT.animator.current_frame) {
var _inSurf = getInputData(0);
if(_inSurf == 0) return;
if(is_array(_inSurf)) {
if(surface_exists(_inSurf[preview_index]))
cacheCurrentFrame(_inSurf[preview_index]);
} else if(surface_exists(_inSurf))
cacheCurrentFrame(_inSurf);
}
}