Grid Sage Forums

Grid Sage Forums

  • November 22, 2024, 03:27:57 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

LINKS: Website | Steam | Wiki

Author Topic: Multi layer copy/cut/paste [2.0 backlog]  (Read 4294 times)

gumix

  • Cyborg
  • ***
  • Posts: 134
    • View Profile
Multi layer copy/cut/paste [2.0 backlog]
« on: May 14, 2020, 02:11:11 AM »

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).


Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4477
    • View Profile
    • Cogmind
Re: Multi layer copy/cut/paste [2.0 backlog]
« Reply #1 on: May 14, 2020, 09:44:03 PM »

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!
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

gumix

  • Cyborg
  • ***
  • Posts: 134
    • View Profile
Re: Multi layer copy/cut/paste [2.0 backlog]
« Reply #2 on: May 15, 2020, 05:30:33 AM »

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. ;)
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4477
    • View Profile
    • Cogmind
Re: Multi layer copy/cut/paste [2.0 backlog]
« Reply #3 on: May 15, 2020, 06:33:52 AM »

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...
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

gumix

  • Cyborg
  • ***
  • Posts: 134
    • View Profile
Re: Multi layer copy/cut/paste [2.0 backlog]
« Reply #4 on: May 15, 2020, 08:53:28 AM »

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

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4477
    • View Profile
    • Cogmind
Re: Multi layer copy/cut/paste [2.0 backlog]
« Reply #5 on: May 15, 2020, 05:16:53 PM »

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:
Code: [Select]
* 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 ;)
« Last Edit: August 02, 2020, 07:59:07 PM by Kyzrati »
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

gumix

  • Cyborg
  • ***
  • Posts: 134
    • View Profile
Re: Multi layer copy/cut/paste [2.0 backlog]
« Reply #6 on: May 16, 2020, 05:54:07 AM »

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?
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4477
    • View Profile
    • Cogmind
Re: Multi layer copy/cut/paste [2.0 backlog]
« Reply #7 on: May 16, 2020, 06:34:36 AM »

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
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

gumix

  • Cyborg
  • ***
  • Posts: 134
    • View Profile
Re: Multi layer copy/cut/paste [2.0 backlog]
« Reply #8 on: May 16, 2020, 06:36:13 AM »

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 ;)
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4477
    • View Profile
    • Cogmind
Re: Multi layer copy/cut/paste [2.0 backlog]
« Reply #9 on: May 16, 2020, 07:08:00 AM »

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

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.
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4477
    • View Profile
    • Cogmind
Re: Multi layer copy/cut/paste [2.0 backlog]
« Reply #10 on: July 03, 2020, 04:07:05 PM »

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)
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

gumix

  • Cyborg
  • ***
  • Posts: 134
    • View Profile
Re: Multi layer copy/cut/paste [2.0 backlog]
« Reply #11 on: July 04, 2020, 09:19:39 AM »

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. :)
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4477
    • View Profile
    • Cogmind
Re: Multi layer copy/cut/paste [2.0 backlog]
« Reply #12 on: July 04, 2020, 03:51:47 PM »

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!
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon