Results 1 to 10 of 19

Thread: Script to video file?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2011
    Location
    Berkeley, CA
    Posts
    8

    another way

    Hi everyone. I just wanted to chime in here and let everyone know about another technique available for 'converting' ARP paintings to movies.
    I started experimenting with the scripting features and came up with various ways to tweak existing scripts to my tastes. One of the things I developed was a way to add commands to an existing recorded script to export file sequences.
    Here are the important points:

    1. I wanted to write a cross-platform script (I am usually only on OSX) to do a few things, including removing binary data from arscripts, but also (and this is really the main subject here) adding a png export every time an arscript does a StrokeEvent, and at the end of the script. Originally I wanted to use a shell script for this, but had too many problems with the arscript UTF-16 files (and this wouldn't be a cross-platform solution anyway), so I asked my friend for python help (I'm less knowledgeable in python than other languages). He accommodated (he's a hero). Everything I've done since then has been hacked from his original python script.
    2. Let me clarify: I am using python to automate the process of making new 'tweaked' versions of existing arscripts.
    3. If given an export (via arscript) specifying an existing file name, ARP will automatically save a numbered file in sequence, which makes my task much easier (I simply have to use the same export line over and over and ARP does the rest to save out a numbered sequence). Convenient (and surprising).
    4. The python script simply replaces all instances of "<StrokeEvent>" with that line plus an export line before it (using "\r\n" in the string for Windows newlines is important here). In other words:
      Code:
      "<StrokeEvent>\r\n"
      is replaced with
      Code:
      "Wait: 21.082s    EvType: Command    CommandID: ExportLayer    Idx: -1    Channels: NO    Path: \"path/to/my1.png\"\r\n<StrokeEvent>\r\n"
      . It also adds one more export line at the end of the arscript.
    5. Because the exports happen only before each StrokeEvent, full movement of each stroke is NOT reproduced. I'm hoping to find a solution to this problem, but so far I've found that one needs to keep the export command outside of the StrokeEvent block, which is why this is a limitation. Only strokes are reproduced, not movement within strokes.
    6. Still, even with this limitation, the results are pretty nice (depending on the character of the painting), and what's good is that everything is exactly the correct resolution of the original painting (it IS the original painting, split into various slices of time, as it were). I work in After Effects mostly, and I can take the file sequences into AE and alter them nicely, even doing some 'timewarping' to change the rate and do semi-intelligent in-betweening. Quicktime will also allow you to import file sequences then export as a movie.
    7. I'd love to be able to share these scripts with all of you, BUT I just have way too much going on with various jobs/careers/etc., and this makes it tough to take the time to make everything cross-platform, error-free, etc. However, I'd be happy, until I can find that time, to do quick conversions for anyone who asks (that takes about two seconds). The conversions I can do are: removing binary data; making 'overlapping' scripts (scripts that play over the existing painting); and making file sequence-saving scripts. I'd also be happy to answer any questions.
    8. All of this is pretty easy to do with a text editor, as mentioned elsewhere on the forum. The file seq. saving is just a little more complex, but still easy. All you need is a good text editor with a find/replace-all to do the text replacement I mentioned above.
    9. My scripts (which I also have 'wrapped' in file-droppable AppleScript apps) are non-destructive; they never overwrite a script, and I suggest you work the same way, of course.
    10. For those of you perplexed by the "\r\n" stuff above, this is simply the way to make sure a (python) script recognizes the Windows-specific line ending in such a file as an arscript. If working with a text editor in Windows, you should be able to copy the line with the newline and paste into the find/replace fields, but some text editors treat this stuff differently and have special 'grep' or 'regular expressions' features for this kind of thing (or have difficulty entering line returns in find/replace dialogs). As mentioned elsewhere on the forum, I use jEdit (cross-platform, free) and TextWrangler (OSX-only, free).

    Well, I hope you've enjoyed my little rant. Any suggestions, ideas, etc. are welcome.
    Last edited by crgreen; 09-07-2011 at 06:42 AM.

  2. #2
    Join Date
    Oct 2011
    Posts
    16
    Could you please share a sample file? it sounds interesting, Im using OS X too and I would like to lean.


    Quote Originally Posted by crgreen View Post
    Hi everyone. I just wanted to chime in here and let everyone know about another technique available for 'converting' ARP paintings to movies.
    I started experimenting with the scripting features and came up with various ways to tweak existing scripts to my tastes. One of the things I developed was a way to add commands to an existing recorded script to export file sequences.
    Here are the important points:

    1. I wanted to write a cross-platform script (I am usually only on OSX) to do a few things, including removing binary data from arscripts, but also (and this is really the main subject here) adding a png export every time an arscript does a StrokeEvent, and at the end of the script. Originally I wanted to use a shell script for this, but had too many problems with the arscript UTF-16 files (and this wouldn't be a cross-platform solution anyway), so I asked my friend for python help (I'm less knowledgeable in python than other languages). He accommodated (he's a hero). Everything I've done since then has been hacked from his original python script.
    2. Let me clarify: I am using python to automate the process of making new 'tweaked' versions of existing arscripts.
    3. If given an export (via arscript) specifying an existing file name, ARP will automatically save a numbered file in sequence, which makes my task much easier (I simply have to use the same export line over and over and ARP does the rest to save out a numbered sequence). Convenient (and surprising).
    4. The python script simply replaces all instances of "<StrokeEvent>" with that line plus an export line before it (using "\r\n" in the string for Windows newlines is important here). In other words:
      Code:
      "<StrokeEvent>\r\n"
      is replaced with
      Code:
      "Wait: 21.082s    EvType: Command    CommandID: ExportLayer    Idx: -1    Channels: NO    Path: \"path/to/my1.png\"\r\n<StrokeEvent>\r\n"
      . It also adds one more export line at the end of the arscript.
    5. Because the exports happen only before each StrokeEvent, full movement of each stroke is NOT reproduced. I'm hoping to find a solution to this problem, but so far I've found that one needs to keep the export command outside of the StrokeEvent block, which is why this is a limitation. Only strokes are reproduced, not movement within strokes.
    6. Still, even with this limitation, the results are pretty nice (depending on the character of the painting), and what's good is that everything is exactly the correct resolution of the original painting (it IS the original painting, split into various slices of time, as it were). I work in After Effects mostly, and I can take the file sequences into AE and alter them nicely, even doing some 'timewarping' to change the rate and do semi-intelligent in-betweening. Quicktime will also allow you to import file sequences then export as a movie.
    7. I'd love to be able to share these scripts with all of you, BUT I just have way too much going on with various jobs/careers/etc., and this makes it tough to take the time to make everything cross-platform, error-free, etc. However, I'd be happy, until I can find that time, to do quick conversions for anyone who asks (that takes about two seconds). The conversions I can do are: removing binary data; making 'overlapping' scripts (scripts that play over the existing painting); and making file sequence-saving scripts. I'd also be happy to answer any questions.
    8. All of this is pretty easy to do with a text editor, as mentioned elsewhere on the forum. The file seq. saving is just a little more complex, but still easy. All you need is a good text editor with a find/replace-all to do the text replacement I mentioned above.
    9. My scripts (which I also have 'wrapped' in file-droppable AppleScript apps) are non-destructive; they never overwrite a script, and I suggest you work the same way, of course.
    10. For those of you perplexed by the "\r\n" stuff above, this is simply the way to make sure a (python) script recognizes the Windows-specific line ending in such a file as an arscript. If working with a text editor in Windows, you should be able to copy the line with the newline and paste into the find/replace fields, but some text editors treat this stuff differently and have special 'grep' or 'regular expressions' features for this kind of thing (or have difficulty entering line returns in find/replace dialogs). As mentioned elsewhere on the forum, I use jEdit (cross-platform, free) and TextWrangler (OSX-only, free).

    Well, I hope you've enjoyed my little rant. Any suggestions, ideas, etc. are welcome.

  3. #3
    Join Date
    Aug 2014
    Posts
    18
    I would love to be able to output scripts to file sequences, that would be a huge feature request. Here is my current problem:

    I have 4k artrage files but I can't screen capture more than the resolution of my monitors, so any camtasia recording would be reduced in quality. Simple snapshots during script playback wouldn't be too hard to do - we don't need full video codec support or anything!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •