mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-01-12 23:37:10 +01:00
Update subgraph rendering for loop, collection
This commit is contained in:
parent
8e9b2b61dc
commit
8e0d66afd3
8 changed files with 24 additions and 19 deletions
|
@ -65,7 +65,7 @@ function Node_3D(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constr
|
||||||
D3D_GLOBAL_PREVIEW.camera.resetCamera();
|
D3D_GLOBAL_PREVIEW.camera.resetCamera();
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static postUpdate = function() { refreshPreview(); }
|
static postProcess = function() { refreshPreview(); }
|
||||||
|
|
||||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover = false, _focus = false) { #region
|
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover = false, _focus = false) { #region
|
||||||
if(!is_surface(mesh_prev_surface)) return;
|
if(!is_surface(mesh_prev_surface)) return;
|
||||||
|
|
|
@ -50,6 +50,7 @@ function Node_Iterator(_x, _y, _group = noone) : Node_Collection(_x, _y, _group)
|
||||||
LOG_IF(global.FLAG.render == 1, "[outputNextNode] Get next node from Loop output");
|
LOG_IF(global.FLAG.render == 1, "[outputNextNode] Get next node from Loop output");
|
||||||
|
|
||||||
var _nodes = [];
|
var _nodes = [];
|
||||||
|
|
||||||
for( var i = 0; i < ds_list_size(nodes); i++ ) { // check if every node is updated
|
for( var i = 0; i < ds_list_size(nodes); i++ ) { // check if every node is updated
|
||||||
if(!nodes[| i].rendered) {
|
if(!nodes[| i].rendered) {
|
||||||
LOG_IF(global.FLAG.render == 1, $"Skipped due to node {nodes[| i].internalName} not rendered.");
|
LOG_IF(global.FLAG.render == 1, $"Skipped due to node {nodes[| i].internalName} not rendered.");
|
||||||
|
|
|
@ -89,7 +89,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
input_dummy = nodeValue("Add to group", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, 0);
|
input_dummy = nodeValue("Add to group", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, 0);
|
||||||
draw_dummy = false;
|
draw_dummy = false;
|
||||||
|
|
||||||
input_dummy.onSetFrom = function(juncFrom) {
|
input_dummy.onSetFrom = function(juncFrom) { #region
|
||||||
ds_list_remove(juncFrom.value_to, input_dummy);
|
ds_list_remove(juncFrom.value_to, input_dummy);
|
||||||
input_dummy.value_from = noone;
|
input_dummy.value_from = noone;
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
input.inParent.setFrom(juncFrom);
|
input.inParent.setFrom(juncFrom);
|
||||||
|
|
||||||
if(onNewInputFromGraph != noone) onNewInputFromGraph(juncFrom);
|
if(onNewInputFromGraph != noone) onNewInputFromGraph(juncFrom);
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
onNewInputFromGraph = noone;
|
onNewInputFromGraph = noone;
|
||||||
|
|
||||||
|
@ -292,6 +292,15 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
LOG_BLOCK_END();
|
LOG_BLOCK_END();
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
|
static isActiveDynamic = function(frame = CURRENT_FRAME) { #region
|
||||||
|
if(update_on_frame) return true;
|
||||||
|
|
||||||
|
for( var i = 0, n = ds_list_size(inputs); i < n; i++ )
|
||||||
|
if(inputs[| i].isActiveDynamic(frame) || !inputs[| i].from.rendered) return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
} #endregion
|
||||||
|
|
||||||
static exitGroup = function() {}
|
static exitGroup = function() {}
|
||||||
|
|
||||||
static add = function(_node) { #region
|
static add = function(_node) { #region
|
||||||
|
@ -345,8 +354,6 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
|
|
||||||
static onStep = function() {}
|
static onStep = function() {}
|
||||||
|
|
||||||
PATCH_STATIC
|
|
||||||
|
|
||||||
static onPreDraw = function(_x, _y, _s, _iny, _outy) { #region
|
static onPreDraw = function(_x, _y, _s, _iny, _outy) { #region
|
||||||
var xx = x * _s + _x;
|
var xx = x * _s + _x;
|
||||||
var yy = y * _s + _y;
|
var yy = y * _s + _y;
|
||||||
|
|
|
@ -526,7 +526,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
||||||
doUpdate();
|
doUpdate();
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static postupdate = function(frame = CURRENT_FRAME) {}
|
static postUpdate = function(frame = CURRENT_FRAME) {}
|
||||||
|
|
||||||
static doUpdate = function(frame = CURRENT_FRAME) { #region
|
static doUpdate = function(frame = CURRENT_FRAME) { #region
|
||||||
if(PROJECT.safeMode) return;
|
if(PROJECT.safeMode) return;
|
||||||
|
@ -559,7 +559,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
postupdate(frame);
|
postUpdate(frame);
|
||||||
cached_manual = false;
|
cached_manual = false;
|
||||||
|
|
||||||
if(!use_cache && PROJECT.onion_skin.enabled) {
|
if(!use_cache && PROJECT.onion_skin.enabled) {
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
name = "Group Output";
|
name = "Group Output";
|
||||||
destroy_when_upgroup = true;
|
|
||||||
color = COLORS.node_blend_collection;
|
color = COLORS.node_blend_collection;
|
||||||
previewable = false;
|
previewable = false;
|
||||||
|
|
||||||
|
destroy_when_upgroup = true;
|
||||||
|
|
||||||
attributes.input_priority = 0;
|
attributes.input_priority = 0;
|
||||||
if(!CLONING && !LOADING && !APPENDING && group != noone) attributes.input_priority = group.getOutputFreeOrder();
|
if(!CLONING && !LOADING && !APPENDING && group != noone) attributes.input_priority = group.getOutputFreeOrder();
|
||||||
|
|
||||||
|
@ -140,10 +141,4 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
static onLoadGroup = function() { #region
|
static onLoadGroup = function() { #region
|
||||||
if(group == noone) nodeDelete(self);
|
if(group == noone) nodeDelete(self);
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
//static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region
|
|
||||||
// var bbox = drawGetBbox(xx, yy, _s);
|
|
||||||
// draw_set_text(f_h5, fa_center, fa_center, c_white);
|
|
||||||
// draw_text(bbox.xc, bbox.yc, attributes.input_priority);
|
|
||||||
//} #endregion
|
|
||||||
}
|
}
|
|
@ -330,10 +330,10 @@ function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
||||||
else processOutput();
|
else processOutput();
|
||||||
processData_postbatch();
|
processData_postbatch();
|
||||||
|
|
||||||
postUpdate();
|
postProcess();
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static postUpdate = function() {}
|
static postProcess = function() {}
|
||||||
|
|
||||||
static processSerialize = function(_map) { #region
|
static processSerialize = function(_map) { #region
|
||||||
_map.array_process = attributes.array_process;
|
_map.array_process = attributes.array_process;
|
||||||
|
|
|
@ -70,7 +70,7 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group)
|
||||||
update_on_frame = grup == 0;
|
update_on_frame = grup == 0;
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static postupdate = function(frame = CURRENT_FRAME) {
|
static postProcess = function(frame = CURRENT_FRAME) {
|
||||||
if(LAST_FRAME) array_remove(RENDERING, node_id);
|
if(LAST_FRAME) array_remove(RENDERING, node_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -140,7 +140,9 @@ function __nodeIsRenderLeaf(_node) { #region
|
||||||
if(!_node.attributes.update_graph) { LOG_IF(global.FLAG.render == 1, $"Skip non-auto update [{_node.internalName}]"); return false; }
|
if(!_node.attributes.update_graph) { LOG_IF(global.FLAG.render == 1, $"Skip non-auto update [{_node.internalName}]"); return false; }
|
||||||
|
|
||||||
if(_node.passiveDynamic) { _node.forwardPassiveDynamic(); LOG_IF(global.FLAG.render == 1, $"Skip passive dynamic [{_node.internalName}]"); return false; }
|
if(_node.passiveDynamic) { _node.forwardPassiveDynamic(); LOG_IF(global.FLAG.render == 1, $"Skip passive dynamic [{_node.internalName}]"); return false; }
|
||||||
if(_node.rendered && !_node.isActiveDynamic()) { LOG_IF(global.FLAG.render == 1, $"Skip rendered static [{_node.internalName}]"); return false; }
|
|
||||||
|
if((_node.rendered || (is_instanceof(_node, Node_Collection) && !_node.managedRenderOrder)) && !_node.isActiveDynamic())
|
||||||
|
{ LOG_IF(global.FLAG.render == 1, $"Skip rendered static [{_node.internalName}]"); return false; }
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
Loading…
Reference in a new issue