Main Menu

News:

LINKS: Website | Steam | Wiki

Multi layer copy/cut/paste [2.0 backlog]

Started by gumix, May 14, 2020, 02:11:11 AM

Previous topic - Next topic

gumix

The idea comes from the fact I'm in quite often need of rearranging multi layer sprites in my sprite sheets.
In example it could work by specifying a stack depth integer parameter, counting from active layer up (default 1).



Kyzrati

Yeah I've certainly needed this type of feature myself, too, since I work with a lot of multilayered images. I guess the main problem here is interface-related.

I think it'd probably work better counting down rather than up, since if you're copy-pasting the preview will want to prioritize the top layer. I'm not sure how feasible it is for the architecture, but it's certainly worth looking into!
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

gumix

Yes, you're right, counting down would be better.
Also as mouse clicks in UI are currently insensitive to shift key, you could use that to set copy/paste range of layers from active layer to shift+clicked one. Even if such state is not visualized in the UI I'd pray for such addon in 1.5 patch. ;)

Kyzrati

Heh, no need to wait for 1.5, I've already added this feature ;)

It's done and tested, I just need to finish adding the instructions to the manual, then create some kind of demo GIF to go with the patch (and build the actual patch for release, of course :P).

Took me all afternoon to finish, but worth it. Half that time was spent getting it to be compatible with the preview system, which was never meant to work with more than one layer at a time so it took a lot of consideration to figure out how best to include this so that you could see the results dynamically.

Will be out soonish, although it's already late tonight so I don't really have time to do the rest of the work now...
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

gumix

Wait, what? You are tireless, this is going to save me from hours of not so fun work.
Thank you.

Kyzrati

#5
Early birthday* present, gumix!

Multi-layer copy/cut/paste is now a thing!

Here's the new subsection I wrote for the manual to explain it:
Quote
Multi-layer Editing
---------------------
The copy/cut/paste tools in particular can work across multiple layers at once, simultaneously copying the same area from more than one layer. To get this effect, use 'd' to increment the amount of depth you want to manipulate. While the depth is greater than 1, additional layers below the current active layer will be included in each operation. For example, using a depth of 2 to copy an area from layer 4 will add that area from both layer 4 and 3 to the clipboard, and maintaining the same depth value while pasting to layer 2 will paste the layer 4 contents on layer 2, and layer 3 contents on layer 1.

Nothing will copy from intermediary hidden layers, and nothing can be cut from locked layers (though the copy portion of a cut operation will still work on that layer). Nothing will paste into intermediary hidden or locked layers, either.

Shift-d decrements the depth counter.

Relevant changelog entries:

* NEW: Added multi-layer support for Copy/Cut/Paste tools, use 'd' and Shift-d to adjust the desired operational depth
* NEW: Full layer copy (Ctrl-Shift-c) obeys current multi-layer copy depth setting as well




Hopefully this is what you need, and it works in a useful way for you. I did a huge range of tests with it interacting with different tools and settings, but let me know if something slipped by and there's weird behavior anywhere.

Get the latest patch here(edit: feature now included in all versions as of v1.50) (includes all previous 1.04 patch features).

Note that as per other patches since the last official release, this one needs to update your skins.xt file since a new entry was added there for another feature from an earlier patch.

*no I have no idea when your birthday is, but 1) you've gotta have one, and 2) random chance would suggest this is early, or even extremely early... or maybe even belated ;)
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

gumix

Description is really good, sounds like this is going to perfectly fit my needs, interaction with hidden and locked layers (I haven't considered them previously) make a great final touch to this feature. Sure, I'll let you know if something goes strangely. Thanks!

Btw, where those trees come from?

Kyzrati

Yeah I hadn't originally thought about the hidden/locked layers thing at first, either. Ended up coming across that while thinking of what could go wrong, and had to edge in considerations for those cases as well :P (this is the first time you can selectively edit multiple layers, after all, and theoretically might want to skip and intermediate layer...)

The tree was just a random doodle specifically to demo this feature, didn't come from anywhere besides my weird head :P
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

gumix

Just checked it out, works really great!
Btw, this is not related to multi layer feature but to full canvas copy (ctrl+shift+c).
I've noticed that if current paste mode is in x/y-flipping mode, copying full canvas copies flipped image.
One can find it useful, but I think it wasn't intended ;)

Kyzrati

Excellent, glad to hear it's working for you.

Quote from: gumix on May 16, 2020, 06:36:13 AM
Btw, this is not related to multi layer feature but to full canvas copy (ctrl+shift+c).
I've noticed that if current paste mode is in x/y-flipping mode, copying full canvas copies flipped image.
One can find it useful, but I think it wasn't intended ;)
Whaa?! Yeah that doesn't sound intended, I guess that's some sort of bug (bug-feature? :P) I'll have to look into another time. I'm surprised that happens since they don't seem related, but whatever if it's happening it's happening somehow... Noted.
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

Kyzrati

So I was just looking into this and apparently I'd just forgotten, but this is actually an intended behavior :P

It's going to stay that way, too--the main reasoning is that cycling through paste modes naturally has to automatically flip the clipboard to match, so the initial clipboard state for any copy performed (whether layer-wide or even just a regular copy tool action) will reflect whatever the current paste state is! (Otherwise they'd be desynced from the start and that would make no sense xD)
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

gumix

Ok, thank you for explanations. Whatever logic was behind, I'm happy with it as it is as instant preview makes it clear what's gonna happen on LMB click. :)

Kyzrati

Exactly, it needs to be able to match whatever the preview will show via the paste tool, otherwise there would be a problem :P

We could have it completely override the current paste mode by resetting that tool (this is what I realized would have to change to address the behavior), but that would actually end up being really annoying!
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon