Skip to content

File corruption: Copy-paste layers with exported values from one file to another #1393

Closed

Description

@morevnaproject

There is a very common situation when user can get his file corrupted by simply copy-pasting layers from one file to another. This happens if layer contains exported values (note that bones are exported values too!).

Steps to reproduce this situation:

  1. Launch Synfig and create new file.
  2. Create a simple Circle Layer.
  3. Select Circle Layer, right-click its Radius parameter and select "Export".
  4. Enter name for exported value, i.e. "test". Click Export.
  5. Save file as "file1.sifz"
  6. Hit Ctl+C to copy circle layer to clipboard.
  7. Create a new file in other tab.
  8. Hit Ctrl+V to paste circle from clipboard. Circle will appear on workspace. Notice, that layer is copied, but it is still references exported value from "file1.sifz"
  9. Save file as "file2.sifz"
  10. Quit Synfig.
  11. Now remove (or rename) "file1.sifz".
  12. Launch Synfig and try to open "file2.sifz".
  13. Error:
    screenshot_001

@rodolforg @ice0 @FirasH I think this is a top-priority issue to solve for next stable release (1.4.1 or 1.6.0).

What should be done here:

  1. Change how Synfig deal with pasting layers when layer has exported values.
  2. Change how Synfig handles situations with broken links to exported values in external documents.

Activity

  1. morevnaproject commented on Apr 30, 2020

    @morevnaproject
    MemberAuthor

    Broken files reported by users regularly.
    Examples: #786, #1387

  2. morevnaproject commented on Apr 30, 2020

    @morevnaproject
    MemberAuthor
    1. Change how Synfig deal with pasting layers when layer has exported values.
    2. Change how Synfig handles situations with broken links to exported values in external documents.

    I think (1) should be a scope of this issue. (2) should be submitted a separate issue.

  3. morevnaproject commented on Apr 30, 2020

    @morevnaproject
    MemberAuthor
    1. Change how Synfig deal with pasting layers when layer has exported values.

    Here is my proposal for solving this - https://synfig-docs-dev.readthedocs.io/en/latest/projects/copy-paste-exported-values.html

  4. added this to the v1.6.0 milestone on Apr 30, 2020
  5. Gilraiser commented on May 21, 2020

    @Gilraiser

    Hello, I would like to show you an error that has to do with the topic. Here I present a video and two example files of how bones made are corrupted when copied to another file.

    Original file:
    example-01.sif.zip

    Copied file:
    example-02.sifz.zip

    Video with the demonstration:
    https://www.youtube.com/watch?v=aTBuhxQpS1c&feature=youtu.be

    I hope the information is useful. Thank you

  6. rodolforg commented on May 22, 2020

    @rodolforg
    Contributor

    @Gilraiser Sadly a long-time known issue #453
    I'm trying to investigate it, but I'm confuse how skeletons work in Synfig ;)

  7. Gilraiser commented on May 22, 2020

    @Gilraiser

    I wish I could help more. I know it must be very complex. Thank you.

  8. morevnaproject commented on May 26, 2020

    @morevnaproject
    MemberAuthor

    I suggest to split this issue into multiple easy steps.

    1. When "paste" command is invoked - check if pasted data references any exported elements. If yes - then display warning message in console.
    2. Replace warning in console with a dialog box, which shows a message: "The pasted data contains layers, which still reference exported values from original files. That means your current file will depend on original file and might become unreadable if you delete original file. Do you still want to paste? [Yes] [No]"
    3. Improve warning dialog - display a list of exported values, which are referenced by pasted layers.

    I think those 3 steps are easy enough to start on gradually solving this issue. I can provide further steps later, if needed. ^__^

  9. self-assigned this
    on Mar 22, 2021
  10. rodolforg commented on Mar 28, 2021

    @rodolforg
    Contributor

    I started to work on this issue today, and then it raised me a doubt:
    What if an exported value node has links for other exported valuenodes.
    I just list the 'top' valuenode?

    Example: I have a skeleton layer and one of its bones is exported. The origin of this exported bone is exported too.
    When I copy'n paste this layer, I warn about the bone export only, or both valuenodes?

    @morevnaproject

  11. rodolforg commented on Mar 29, 2021

    @rodolforg
    Contributor

    The conflict is when there are two different types of valuenode, right? Like "Add" vs. "Scale"

  12. ice0 commented on Mar 30, 2021

    @ice0
    Collaborator

    @rodolforg Hi!
    @morevnaproject got sick, he will answer as soon as he gets better.

  13. 19 remaining items

  14. added a commit that references this issue on Nov 16, 2021
    238804f
  15. added a commit that references this issue on Dec 20, 2022
    b0cc4c8
  16. added 3 commits that reference this issue on Apr 17, 2023
    74d7940
    8508236
    671e3ff
  17. unpinned this issue on Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions