Jump to content

Automation of "Make a Wave with Paint.NET"


Recommended Posts

Hi there.

Inspired by this post I have made a complete automation of the Make a Wave with Paint.NET tutorial using the program AutoIt. Now, I know most of you will say that there is no point in this, a tutorial is for doing, not sitting back and watching it being done for you, for the record, I completely agree and that is not the purpose of this. The purpose is just sharing what I've created and maybe inspiring more things like this, that have a purpose.

Please note, you must temp. remove all Effect plugins to use this automation, or it will not work. Simply move them to another folder while you use the automation, not a big deal :cool:

Without farther ado (And frustration, and debugging, and wanting to hurt the computer :wink:) you can download it here.

Simply close everything and click the .exe, it will open Paint.NET for you! Don't open it before hand.

Also, I do not believe you need AutoIt installed to run the exe, but the script is the AutoIt file and it is just the same thing as the exe, with the exception it is used by AutoIt and you must have that installed on your computer to run the script file or edit it.

Well, tell me what you guys think!

:)

Edit:

Here is the code:

;Opens Paint.NET and waits unti; the window is active. 
;The Sleep() slows the automarion down so your computer can catch up.
Run("C:\Program Files\Paint.NET\PaintDotNet.exe")
WinWait("Un")
WinActivate("Un")
Sleep(100)
;
;Open the Canvas Size Diolog using Ctrl + Shift + R.
Send("^+R")
Sleep(100)
;
;Enter the canvas size wanted and close the duolog.
;WinWaitActive("Canvas Size")
Send("500")
Sleep(1000)
Send("{TAB}")
Sleep(1000)
Send("500")
Sleep(200)
Sleep(1000)
Send("{ENTER}")
Sleep(100)
;
;Navigate to the Clouds Effect and open the diolog.
Send("!c")
Sleep(100)
Send("{DOWN 4}")
Sleep(100)
Send("{ENTER}")
Sleep("100")
;
;Execute and render the Clouds Effect at default Values
Send("{ENTER}")
Sleep("100")
;
;Navigate to the Clouds Effect and open the diolog.
Send("!c")
Sleep(100)
Send("{DOWN 5}")
Sleep(100)
Send("{ENTER}")
Sleep("100")
;
;Execute the Clouds Effect setting the blending mode to difference.
Send("{TAB 5}")
Sleep(200)
Send("{DOWN 8}")
Sleep(100)
Send("{ENTER}")
Sleep(3000)
;
;Navigate to the Pencil Sketch Effect and open the diolog.
Send("!c")
Sleep(100)
Send("{DOWN 12}")
Sleep(100)
Send("{ENTER}")
Sleep("100")
;
;Set the pecial sketch attributes: Pencil tip Size and range, in that order.
Send("20")
Sleep(100)
Send("{TAB 3}")	
Sleep(1000)
Send("20")
Sleep(1000)
Send("{ENTER}")
Sleep(4000)
;
;Navigate to the Zoom Blur effect the open the dialog.
Sleep(1000)
Send("!c")
Sleep(100)
Send("{DOWN 2}")
Sleep(100)
Send("{Right}")
Sleep(100)
Send("{DOWN 5}")
Sleep(100)
Send("{ENTER}")
Sleep("100")
;
;Set the Zoom Blur to 100 and execute the Zoom Blur effect
Send("100")
Sleep(200)
Send("{ENTER}")
Sleep(4000)
;
;Navigate to the Twist Effect and open the dialog.
Sleep(1000)
Send("!c")
Sleep(100)
Send("{DOWN 3}")
Sleep(100)
Send("{RIGHT 1}")
Sleep(100)
Send("{DOWN 3}")
Sleep(100)
Send("{ENTER}")
Sleep("100")
;
;Execute the Twust Effect and set the attributes of the Twist Effect: Twisting Amount and quality.
Send("20")
Sleep(100)
Send("{TAB 3}")
Sleep(100)
Send("5")
Sleep(200)
Send("{ENTER}")
Sleep(4000)
;
;Duplicates the layer
Sleep(1000)
Send("^+D")
Sleep(100)
;
;Navigate to the Twist Effect and open the dialog.
Send("!c")
Sleep(100)
Send("{DOWN 3}")
Sleep(100)
Send("{RIGHT 1}")
Sleep(100)
Send("{DOWN 3}")
Sleep(100)
Send("{ENTER}")
Sleep("100")
;
;Execute the Twust Effect and set the attributes of the Twist Effect: Twisting Amount and quality.
Send("-40")
Sleep(100)
Send("{TAB 3}")
Send("5")
Sleep(200)
Send("{ENTER}")
Sleep(4000)
;
;Open layer properties
Sleep(1000)
Send("!l")
Sleep(300)
Send("{DOWN 9}")
Sleep(300)
Send("{ENTER}")
;
;Set the layer's blending mode
Send("{TAB 2}")
Sleep(200)
Send("{DOWN 10}")
Sleep(1000)
Send("{ENTER}")
Sleep(200)
;
;Flatten the image
Send("^+F")
;
;Make a dialog appear to show that the automation is complete
MsgBox(64, "Complete", "The automation of the Make a Wave with Paint.NET tutorial is now complete. You may color the final image any way you see fit. I suggest using the Curves adjustment found under the adjustment menu to do so. Paint.NET is copyright of Rick Brewster.")

"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former"

[ dA Paint.NET Chat :: Yata on dA ]

Link to post
Share on other sites

This can accualy be pretty cool. People should include these with their tutorials, incase somebody cant follow it, they can just download this. Ive been thinking that paint.net needed something like this, and untill that feature is built into it, this way will work just nice.

I'm still alive!

Link to post
Share on other sites

That's the problem I ran into as well. I thought about using the same script to temp. remove the plugins that weren't needed, but then again, I don't want to go messing around in someones drive.

I just ended up telling people to temp. remove the plugins so it does work correctly. I thought about that problem for a very long while and couldn't come to a conclusion.

Do you like the idea though? Regardless of that issue.

"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former"

[ dA Paint.NET Chat :: Yata on dA ]

Link to post
Share on other sites

The exercise these codes go through must be strenuous, because they sure seem to do a lot of sleeping!

v An excellent open–source strategy game—highly recommended.

 

"I wish I had never been born," she said. "What are we born for?"

"For infinite happiness," said the Spirit. "You can step out into it at any moment..."

Link to post
Share on other sites
The problem with a script like this is that if I have different plugins loaded, the "Down 3" lines won't work properly on my system.

I may have found the answer to the problem. There is a function in AutoIt that makes a new menu!

I found this in the AutoIt folder called AutoLib, it explains how it creates a new menu in Notepad.

#include 
#include 

Opt("MustDeclareVars", 1)

; ===============================================================================================================================
; Description ...: Have some fun with the Notepad menus
; Author ........: Paul Campbell (PaulIA)
; Notes .........:
; ===============================================================================================================================

; ===============================================================================================================================
; Global variables
; ===============================================================================================================================

Global $hWnd, $hMain, $hMenus[7]

; ===============================================================================================================================
; Main
; ===============================================================================================================================
Run("Notepad.exe")
_Lib_WinWaitActive("Untitled - Notepad")
$hWnd  = WinGetHandle("Untitled - Notepad")
if @Error then _Lib_ShowError("Unable to get Notepad window handle")
$hMain = _Menu_GetMenu($hWnd)
if $hMain = 0 then _Lib_ShowError("Unable to get Notepad menu handle")

AddNewMenu()
GetMenus()
ShowMenu($hMain, 0)

; ===============================================================================================================================
; Add a new menu to Notepad
; ===============================================================================================================================
Func AddNewMenu()
 Local $hTool, $hItem1

 $hItem1 = _Menu_CreateMenu()
 _Menu_InsertMenuItem($hItem1, 0, "SubItem &1", 0x1000)
 _Menu_InsertMenuItem($hItem1, 1, "SubItem &2", 0x1001)

 $hTool = _Menu_CreateMenu()
 _Menu_InsertMenuItem($hTool , 0, "Item &1"   , 0x2000, $hItem1)
 _Menu_InsertMenuItem($hTool , 1, "Item &2"   , 0x2001)
 _Menu_InsertMenuItem($hTool , 2, ""          ,      0)
 _Menu_InsertMenuItem($hTool , 3, "Item &3"   , 0x2002)
 _Menu_InsertMenuItem($hTool , 4, "Item &4"   , 0x2003)

 _Menu_InsertMenuItem($hMain , 6, "&Auto3Lib" ,      0, $hTool)
 _Menu_DrawMenuBar($hWnd)
EndFunc

; ===============================================================================================================================
; Load the top level menu handles
; ===============================================================================================================================
Func GetMenus()
 Local $iI

 for $iI = 0 to 6
   $hMenus[$iI] = _Menu_GetItemSubMenu($hMain, $iI)
 next
EndFunc

; ===============================================================================================================================
; Recursively show the names of the menu items
; ===============================================================================================================================
Func ShowMenu($hMenu, $iIndent)
 Local $iI, $sText, $hSubMenu

 for $iI = 0 to _Menu_GetItemCount($hMenu) - 1
   $sText = _Menu_GetItemText($hMenu, $iI)
   if $sText <> "" then
     _Lib_ConsoleWrite(_Str_Repeat(" ", $iIndent) & $sText)
     $hSubMenu = _Menu_GetItemSubMenu($hMenu, $iI)
     if $hSubMenu <> 0 then ShowMenu($hSubMenu, $iIndent + 2)
   endif
 next
EndFunc

I'm getting assistance from the AutoIt forum and I'll see what I can come up with!

@Helio: I know theres a lot of sleep() the reason for that is I added more as I went to make sure I did everything correctly, not to mention my computer isn't the quickest in the world.

"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former"

[ dA Paint.NET Chat :: Yata on dA ]

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...