Greasepencil Nudge Frames

I’ve just written a small add-on to adjust the duration of grease pencil frames. It combines into 1 keypress the 4 or 5 different steps usually needed to change the exposure of a keyframe.

It applies to every unlocked layers and is based on the current position of the playhead:

  • Press D to shorten keyframe by 1 frame
  • Press F to extend by 1 frame

That’s useful when one wants to add extra keyframes between existing ones. See instructions and download here:

I already knew a bit of Python and I decided to learn how to write an add-on after seeing this question and this proposal. The code is basically the add-on tutorial with some minor modifications. It needs improvements and I will post some questions in Python Support shortly, but even tho it’s a bit rough, it does the job.

2 Likes

wow, I really love this addon!! ~ and I’m surprised that not many others have commented on it, since it’s so perfect to use and the manual way to move keys around is so tedious. There was another addon that did similar things made by Okuma, but the UI didn’t seem to work for me and the creator has mentioned that they wanted to focus on other things in their short free time.

Do you have any interest in expanding the functionality at all? Coming from TV Paint, there’s a nice widget that essentially says "take all selected frames, and set their length to ‘x’ "
Screenshot 2020-12-30 190828

I really that wish I knew some python to do this myself, but I’d be really grateful if you’d like to chat more about it, or if you could point me in the right direction on where to start going about it myself.

regardless, thanks a bunch for making this! it’s a huge time saver and I hope more people get turned on to this thread.

1 Like

well thanks, until now I wasn’t sure anyone other than me ever used it :slight_smile:
Had a look at the Okuma thread and his addon seems very involved and cool, shame it’s not updated anymore. But yeah, it does take time.

In terms of improving my super basic addon, I thought that keeping the user’s selection (or more precisely restoring the selection) was a must, but never got round to implement it. Do you think it would be useful?

The TvPaint idea you brought up sounds good but just thinking about it quickly I can see situations where it would break, or at least where decisions have to be made as to how it should behave. And to be fair, that’s what most of my addon’s code is. The actual moving of the keyframes is only 3 lines of code. What takes time is testing then realizing that sometimes moving the keyframes does things you don’t want (like overwriting some keyframes on an other layer) and then writing a bunch of code to make sure it doesn’t happen. That and fixing bugs, like right now if you try to shorten a frame when one unlocked layer doesn’t have any frame on it yet, it crashes (cos it doesn’t find any frame to shorten). I will try to fix that, but then again it’s not just about stopping the bug, but asking “What should it do instead?” Nothing or ignore a layer? What if there’s only empty layers? How do I let the user know what’s happening? etc…

Anyways, all this to say I love the idea and would personally use it if it existed, but I don’t think I have the knowledge to do it. I might give it a go at some point but can’t promise anything. I’ll give you a shout if I do, as it would be useful to get some testing feedback.

If you fancy learning some python, I can warmly recommend it, it’s a very cool language. But integrating things into Blender can be a bit complex (which is why I’ve mostly just reused the addon example).

Regarding your thought on “restoring the selection” – as I’ve been testing your addon more, I actually think that the selection aspect works well, especially since it doesn’t require any tedious selecting to make it work, that’s really what can slow things down. As an artist, I prefer the way it operates now by highlighting the ones that it’s moving around, and then I can toggle the playbar around while shifting the timings in a natural way. Anyway, I think the way it currently works is good, and adding something to ‘restore a selection’ would kinda get in the way of an artist’s flow, since I’m using it without selecting any specific key to begin with.

I’m off for a few days on break and am attempting to create some macros that I’ve used before in other software, stuff like the TV Paint one that I showed earlier. Also, a slightly more automated Nulls and camera to AE workflow, but kinda just building on what’s already out there and simplifying clicks. But I’m brand new to python…Regardless, my end goal is to have a small set of tools that take the best parts of other workflows and put them in blender, and your little addon is at the top of this list! thanks again :grinning:

Thanks a lot for the feedback about selection. I had a hunch that it was useful to see which frames moved but wasn’t sure. Removed that from my todo list :slight_smile:

I fixed the bug I’d mentioned. Doing so I remembered that I’d disabled the shortcut when more than one objects was selected cos it was bugging out if the other object wasn’t a GP object. But I’m thinking now that I could possibly do checks and only enable them when the selection only contains GP objects. Gonna try to add that next.

Good luck with toolset, let us know when it’s done, I could do with a simpler workflow :smiley_cat:

1 Like