Proposal of change of behavior: Duplicating both Group and an inner layer

I’d like to propose a change of behavior on “Duplicate Layer” action. This action is available in Layers Panel, next to “Move Up” and “Move Down” buttons.

This action duplicates the selected layers, placing the new duplicates as siblings (and on top) of the each originally selected one.

There is a special case I want to handle differently of current behavior:

Let this be the composed scene of a synfig animation:
Captura de tela de 2021-02-18 23-11-57

User selects a Group Layer and (at least) one of its inner layers, as seen in picture below (group D2 and and layer Translate, that is ‘inside’ of D2):
Captura de tela de 2021-02-18 23-12-05

So, the user clicks on “Duplicate Layer” button, and this is the result: it duplicates the Group Layer and its contents as expected (we can see in picture below two Group at same hierarchy level, both named D2). But it also doubles the Translate in original D2 group. Check this picture:
Captura de tela de 2021-02-18 23-12-25

Although somehow logical, I don’t know if any user would expect it. And currently Synfig crashes (since 1.3.0 at least). Not immediately, but when the file is closed.

So, finally, my question is: is it OK to make Synfig Studio avoid the duplication of selected layers that are ‘inside’ already selected groups?

1 Like

I am OK with this. It does seem it can cause some confusion.

Personally, I would also apply this to regular ‘copy’ action. I can’t think of a situation where user may need to copy a group and a specific layer inside the said group.

2 Likes

Thank you for your opinion!

My intention is to unify the internal code of duplicate and paste actions. Logically, they are very similar; but they are written ‘twice’.

Actually, I already did it, but not pushed to Github. I’ll first fix everything I can on Duplicate Layer action.
Btw, the crash I mentioned doesn’t happen on paste action, because the pasted “Translated” layer isn’t place inside the group D2.

I hope I can finally fix the copy’n paste problem of skeleton layer later.

For now, however, I’m waiting for the green light for this modification I proposed (= more opinions). I don’t want to invoke issues and curses complaining about this change XD

1 Like

Shallow copy, Deep copy, Cloning?

Hi. Doing the same type of fix I did with Layer_Duplicate recently:
Looking for every valuenode (of every cloned layer) that refers to a bone that was cloned too, and then replace the bone reference with the its clone.

  • Agree with proposed behavior change
  • Disagree with it

0 voters

@Svarov @KonstantinDmitriev @ice0 @BobSynfig @Khemardi @ebarranko @Keyikedalube @Fadhilkwan etc :wink: