Roll drawings macro

Share your custom panels, brushes, papers... (you need to be registered to read posts in this section)
User avatar
tigerknight
Posts: 15
Joined: 09 Apr 2008, 14:13
Location: San Francisco -- Hong Kong

Roll drawings macro

Post by tigerknight »

Hi all,

I'm still transitioning from traditional pencil-on-paper animation to TVPA. One thing that bugged me was that I did not have an easy way to 'roll' my drawings. For a while, I held down the right-mouse-button (on the stylus) and dragged across the timeline to 'roll'... but that was using my drawing hand. I wanted my non-drawing-hand to do this. Instead of purchasing a PowerMate or ShuttlePro, I decided to see if my (somewhat primitive) programming skills can tackle the problem first. The result is this macro 'roll.ahk'.

Very simply, the macro allows me to hold down a keyboard key to 'roll' back or forward a number of drawings. When I release the key, it 'snaps' back to the original drawing.

Code: Select all

+--------+--------+--------+--------+
| Q      | W      | E      | R      |
| roll   | roll   | roll   | roll   |
| <<-- 2 | <- 1   | 1 ->   | 2 -->> |
+--------+--------+--------+--------+
| A      | S      | D      | F      |
| prev   | prev   | next   | next   |
| cell   | frame  | frame  | cell   |
+--------+--------+--------+--------+
I'm right-handed, so I assigned the left keys on the keyboard. On a QWERTY keyboard, that's QWER. I'm actually on a Dvorak keyboard so it's ',.P. Anyway, you will probably need to modify the macro to your needs because everyone assigns keyboard shortcuts differently.

How to get this to work:
1. You must have AutoHotkey installed. It's Windows only, sorry Mac users :(
2. You also need the Instance Panel.
3. Download the 'roll.ahk' file and save it somewhere. In TVPA's directory, on your desktop, whatever.
4. You must assign the following shortcut keys in TVPA (I've put my example in brackets):
- Instance panel: PrevCel [A]
- Instance panel: NextCel [F]
5. Make sure [Q] [W] [E] [R] are not assigned in TVPA.
6. Open 'roll.ahk' in Notepad (it's a text file) and edit the sections (they have been commented for guidance):
- If you're using TVPA 8, remove the first ; from the line 6 and add a ; in front of line 7.
- You can set a custom flip speed on line 10. It's in milliseconds... so if you want to flip at 12 fps, then type in 83 (1000/12). Otherwise, default is 10 fps.
- For lines 13-37, enter your custom shortcut keys here, in case they're different from mine. Lines that have 'hotkey' refer to [Q] [W] [E] [R], PrevCel and NextCel are [A] and [F] respectively.
7. Save, then exit Notepad.
8. Double-click on the 'roll.ahk' file. Assuming you have set up AutoHotkey and associated .ahk files with it, it will run. It will put a green 'H' icon in the system tray. (You can stop the macro by right-clicking on this icon and selecting Exit.)
9. Start TVPA. Make some drawings... and try out the keys. Hold down [Q]... and it rolls back 2 drawings. You can even draw on the frame while it's held down! Release [Q]... and boing! it snaps back to your original frame. Want to roll forward 3 drawings? Hold down [E] and then [R] together!

Note -- I've only tested this on TVPA Standard 8.6.4 and 9.0.5 on WinXP Pro SP3 English. I'm not sure if it'll work on TVPA Pro because it may have a different 'ahk_class' name.

Disclaimer -- this macro is quite rough around the edges. There's no error-catching, GUI, kitchen sink, etc., and I won't be held responsible if it breaks your stuff, yadda yadda yadda. I made it for my own use and am releasing it in case anyone else finds it useful. If you can improve the macro, please share it in this thread!

Cheers! 8)
Attachments
roll.zip
AHK roll drawings 1.00.20090227
(1 KiB) Downloaded 352 times
User avatar
Paul Fierlinger
Posts: 8100
Joined: 03 May 2008, 12:05
Location: Pennsylvania USA
Contact:

Re: Roll drawings macro

Post by Paul Fierlinger »

I use the Flip button on the Project panel. In case you haven't noticed , in the Preview Settings Panel you can set the length of the flipping to your current need.
Paul
http://www.slocumfilm.com
Desktop PC Win10-Pro -64 bit OS; 32.0 GB RAM
Processor: i7-2600 CPU@3.40GHz
AMD FirePro V7900; Intuos4 Wacom tablet
User avatar
tigerknight
Posts: 15
Joined: 09 Apr 2008, 14:13
Location: San Francisco -- Hong Kong

Re: Roll drawings macro

Post by tigerknight »

Yes, but it's a different function.. not what I was looking for. With the 'flip book', the animation plays repeatedly and doesn't let you 'pause' on a specific frame. Nor does it let you draw on that specific frame.

Hence this macro... :wink:
User avatar
Paul Fierlinger
Posts: 8100
Joined: 03 May 2008, 12:05
Location: Pennsylvania USA
Contact:

Re: Roll drawings macro

Post by Paul Fierlinger »

For that I scrub the cursor with my stylus on the project panel. To each his own... I have yet to meet two people who draw and use TVP exactly the same way, actually not even close to the same way, which says a lot for TVP. I hope you'll like paperless animation. It's like discovering the Kindle after almost 3/4 of a century of reading books.
Paul
http://www.slocumfilm.com
Desktop PC Win10-Pro -64 bit OS; 32.0 GB RAM
Processor: i7-2600 CPU@3.40GHz
AMD FirePro V7900; Intuos4 Wacom tablet
oliveuk
Posts: 153
Joined: 01 Jan 2007, 15:38
Location: London
Contact:

Re: Roll drawings macro

Post by oliveuk »

I would love to see a video of the script in action....
User avatar
tigerknight
Posts: 15
Joined: 09 Apr 2008, 14:13
Location: San Francisco -- Hong Kong

Re: Roll drawings macro

Post by tigerknight »

Okay, here's a very simple demo (no sound -- captions only)
Image
(edit: updated link)
Last edited by tigerknight on 20 Jun 2012, 03:00, edited 1 time in total.
oliveuk
Posts: 153
Joined: 01 Jan 2007, 15:38
Location: London
Contact:

Re: Roll drawings macro

Post by oliveuk »

I am not a traditional 2d animator but that sounds very usefull. Nice
User avatar
elmisilhumano
Posts: 1104
Joined: 28 Aug 2006, 20:41
Location: Finland
Contact:

Re: Roll drawings macro

Post by elmisilhumano »

Is it possibe to make this work for mac users?

M.
Mikko Vormala
User avatar
Gravin
Posts: 38
Joined: 19 Feb 2009, 01:13

Re: Roll drawings macro

Post by Gravin »

This is very intersting!

I'm very new to TVPaint and I'm looking at the scripting and action functions to see if this might be a function that could be easily integrated into the programs native tongue without relying on outside applications like the hotkey program. It seems like it would be a simple matter of instructing the program to move "x" number of frames or cells in one direction, but it would have to be smart enough to snap back to the original location. Does anyone know if TVPaint can be instructed to perform an inverse action after a key release or if key releases can be used in the scripting language to pass further instructions?

I'm not really a programmer by any means but I think that I could make a useful script if I could instruct tvpaint to move forward by pressing a key and then snap back when releasing the key. That would make it possible to kind of roll the frames by hand by pressing and releasing 4 keys:


~Curt
User avatar
tigerknight
Posts: 15
Joined: 09 Apr 2008, 14:13
Location: San Francisco -- Hong Kong

Re: Roll drawings macro

Post by tigerknight »

@elmisilhumano
It appears there's an effort to port AutoHotkey to the Mac (http://www.autohotkey.com/forum/topic34421.html), but it's not complete yet. I'm sure there are other keyboard macro/automator programs on the Mac, but I'm not familar with that platform. :?

@Curt
Yeah, I've thought about your method too, but I've yet to figure out a way to do that. Seems like a function that's more native to the PowerMates. I don't know how to script within TVP... yet.
lemec made something similar here... not sure how he did it (http://www.tvpaint.com/forum/viewtopic.php?f=26&t=2481), and here's a demo of it (http://video.google.com/videoplay?docid ... 3449&hl=en) (from this thread)

On a similar note, does anyone know whether there's a TVP scripting instruction manual? Or just some tutorials even?
Rik Jurriaans
Posts: 33
Joined: 16 Mar 2009, 13:48
Location: Amsterdam

Re: Roll drawings macro

Post by Rik Jurriaans »

Hi,

If i download eny of the downloads on the forum winzip wont open it, it says that it is damaged or something,
but if i download a non zip file from this website it works


Rik
Im sorry for the bad spelling.
User avatar
Fabrice
Posts: 10077
Joined: 17 Jul 2007, 15:00
Contact:

Re: Roll drawings macro

Post by Fabrice »

Hi Rik,

We are trying to fix the issue. Sorry for the trouble.
Fabrice Debarge
User avatar
Gravin
Posts: 38
Joined: 19 Feb 2009, 01:13

Re: Roll drawings macro

Post by Gravin »

@tigerknight,

Yeah I sent Lemec a PM asking if I could buy a copy but he has yet to get back to me... Hopefully he's just too busy... and not unconscious and nude in his shower after falling and taking a sever blow to the head :cry:

In any case, I think I might find something more like your script more useful since its more instantaneous. I've been selecting the range of images I want to flip to gain more control over the flipbook function but it is a little less intuitive or tactile then it could be with a four button flip setup.

Oh yeah and there is some instruction on George scripting in the pdf manual available here in the downloads section. I took a look at it but I'm afraid that I'm probably going to have to get a hold of the SDK before I can figure out what does what and how to setup the proper commands... doesn't look much more difficult then Applescript, and I can poke my way through that usually :wink:

~Curt
User avatar
tigerknight
Posts: 15
Joined: 09 Apr 2008, 14:13
Location: San Francisco -- Hong Kong

Re: Roll drawings macro

Post by tigerknight »

I guess the forum is still having problems with attachments.

In the meantime, here are alternative download links for the macro:
http://cid-aa3a7cd89c853a69.skydrive.li ... qwerty.ahk
http://cid-aa3a7cd89c853a69.skydrive.li ... dvorak.ahk
User avatar
Fabrice
Posts: 10077
Joined: 17 Jul 2007, 15:00
Contact:

Re: Roll drawings macro

Post by Fabrice »

tigerknight wrote:I guess the forum is still having problems with attachments.

In the meantime, here are alternative download links for the macro:
http://cid-aa3a7cd89c853a69.skydrive.li ... qwerty.ahk
http://cid-aa3a7cd89c853a69.skydrive.li ... dvorak.ahk
I thought it was fixed. We will hae to run some other tests ... :?
Fabrice Debarge
Post Reply