Skip to content

refactor: make code for importing image sequence more readable - #3503

Merged
ice0 merged 1 commit into
synfig:masterfrom
rodolforg:fix-image-seq-no-dup-2
Mar 16, 2025
Merged

ice0 merged 1 commit into
synfig:masterfrom
rodolforg:fix-image-seq-no-dup-2

Conversation

@rodolforg

@rodolforg rodolforg commented Mar 4, 2025 •

Copy link
Copy Markdown
Contributor

the main change is how we loop to detect consecutive duplicated images.

However, the idea is still the same:

  1. create an animated valuenode to "layer_name" parameter of a (future) layer Switch
  2. add each imported image to current canvas
  3. check if it is duplicated (equal to previous image)
    3.1. If so, add it to a future remove layer action
    3.2. Otherwise add a new waypoint in the "layer_name" valuenode
  4. delete the duplicated layers (if it is supposed to do so)
  5. add an action to encapsulate the non-deleted import layers to a new switch layer
  6. convert/link the layer_name parameter to the animated valuenode

the main change is how we loop to detect consecutive duplicated images.

However, the idea is still the same:
1. create an animated valuenode to "layer_name" parameter of a (future) layer Switch
2. add each imported image to current canvas
3. check if it is duplicated (equal to previous image)
 3.1. If so, add it to a future remove layer action
 3.2. Otherwise add a new waypoint in the "layer_name" valuenode
4. delete the duplicated layers (if it is supposed to do so)
5. add an action to encapsulate the non-deleted import layers to a new switch layer
6. convert/link the layer_name parameter to the animated valuenode
@github-actions

github-actions Bot commented Mar 4, 2025

Copy link
Copy Markdown

Thank you for contributing!
Below is how your contribution will appear in Synfig's release notes. Review it and improve your pull request's title and description so that your contribution is clear. You can add images, videos, and anything else you want. Have fun!

♻️ Code Refactoring

  • Make code for importing image sequence more readable

    The main change is how we loop to detect consecutive duplicated images.

    However, the idea is still the same:

    1. create an animated valuenode to "layer_name" parameter of a (future) layer Switch
    2. add each imported image to current canvas
    3. check if it is duplicated (equal to previous image) 3.1. If so, add it to a future remove layer action 3.2. Otherwise add a new waypoint in the "layer_name" valuenode
    4. delete the duplicated layers (if it is supposed to do so)
    5. add an action to encapsulate the non-deleted import layers to a new switch layer
    6. convert/link the layer_name parameter to the animated valuenode

@github-actions

github-actions Bot commented Mar 4, 2025

Copy link
Copy Markdown

Thank you for attempting to improve your contribution description!
Below is how your updated contribution will appear in Synfig's release notes. Review it and make further improvements until you're satisfied!

♻️ Code Refactoring

  • Make code for importing image sequence more readable

    The main change is how we loop to detect consecutive duplicated images.

    However, the idea is still the same:

    1. create an animated valuenode to "layer_name" parameter of a (future) layer Switch
    2. add each imported image to current canvas
    3. check if it is duplicated (equal to previous image)
      3.1. If so, add it to a future remove layer action
      3.2. Otherwise add a new waypoint in the "layer_name" valuenode
    4. delete the duplicated layers (if it is supposed to do so)
    5. add an action to encapsulate the non-deleted import layers to a new switch layer
    6. convert/link the layer_name parameter to the animated valuenode

@ice0
ice0 merged commit bf4d38c into synfig:master Mar 16, 2025
@ice0

ice0 commented Mar 16, 2025

Copy link
Copy Markdown
Collaborator

Merged. Thank you!

@rodolforg
rodolforg deleted the fix-image-seq-no-dup-2 branch March 16, 2025 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants