Ttanasart-pt / Pixel-Composer

Node base VFX editor for pixel art.
MIT License
754 stars 33 forks source link

[BUG] Sprite Node Refresh #10

Closed babyblueboxers closed 1 year ago

babyblueboxers commented 1 year ago

Log message

Not applicable as no crash occurs.

Describe the bug

Vector Split node not updating after Render Sprite Sheet node updates. The inspector shows the correct height and width of the new sheet, but it does not visually update in the graph, nor does it pass the new values to child nodes such as a Vector2. Subsequent nodes also do not receive the new updated values. One must disconnect and reconnect the Vector Split node to refresh it's values.

To Reproduce

Steps to reproduce the behavior:

  1. Create a Render Sprite Sheet node and feed it a Sprite Array, Packing type: Grid.
  2. Execute the Sprite Sheet node.
  3. Connect it to a Vector Split node.
  4. Connect the Vector Split node's outputs to a Vector2 Node.
  5. Observe that the values in the Vector Split and Vector2 Nodes are correct.
  6. Swap out the sprite array for another, or modify your existing sprite set so that the eventual size of the sheet would be different.
  7. Execute the Sprite Sheet node.
  8. Observe that the Vector Split and subsequent Vector2 node remain visually unchanged.
  9. Observe that the Vector Split is reporting the correct values in the inspector despite displaying incorrectly in the grid.
  10. Observe that the Vector2 child node does not contain the correct values.

Expected behavior

When the Sprite Sheet node is updated the Vector Split node should update it's values to reflect the new height and width of the Sprite Sheet and pass those new values to it's children. A downstream refresh, basically.

System

babyblueboxers commented 1 year ago

Update

Looks like the Render Sprite Sheet node isn't triggering a refresh of any of it's downstream nodes automatically, so this isn't just a Vector Split problem as originally suspected. For example, if you connect a Composite node to the Sprite Sheet node, change the inputs, and refresh the Sprite Sheet node, the Composite node does not re-render.

Pressing F5 does re-render all the nodes however. Is this an intended feature and not a bug? I feel like after re-rendering a particular node like the Sprite Sheet it should cascade updates down it's chain of dependents.

Ttanasart-pt commented 1 year ago

It's an intended feature, as nodes that require manual execution (the one with s_refresh_16 icon) are generally slow and can lag, cause problems to the playback.

However, I agree that if you manually execute the node, then it should trigger all the nodes after too. I'll investigate this in the next update. Thank you!