Anime Studio Forum

Bitmap drawing tool test

Anime Studio allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Fahim, Distinct Sun, selgin, Agent_Smith, slowtiger, Belgarath

Postby mykylr » Thu Dec 08, 2011 11:10 pm

Sounds like what I am looking for. Pity not possible for osx though.

Mike
mykylr
 
Posts: 57
Joined: Fri Nov 23, 2007 10:15 pm

Postby Rudiger » Sun Dec 11, 2011 4:30 am

mykylr wrote:Sounds like what I am looking for. Pity not possible for osx though.

Mike


Actually, that may no longer be the case with version 8.1! Unfortunately, I don't have a Mac to experiment with.

The first step would be to get the GD lua library working with a standalone version of Lua on your system. I couldn't find a precompiled version for OSX, but you can download the source package from here:
http://sourceforge.net/projects/lua-gd/ ... %205.1%29/

I believe OSX is a posix style OS, so it should be fairly straight forward.

The next test will be to copy the GD binaries to your AS folder and write a quick AS lua script with the line:
require "gd"

If that doesn't give an error, then it would be worth trying out PonySmasher's bitmap drawing script.

If anyone wants to donate to me an old MacBook, I would be happy to give it a try myself :).
Rudiger
 
Posts: 773
Joined: Sun Dec 18, 2005 2:25 am

Postby ulrik » Sun Dec 11, 2011 9:51 am

Rudiger wrote:
...... write a quick AS lua script with the line:
require "gd"
.

How would I do that, and where?
User avatar
ulrik
 
Posts: 1000
Joined: Thu Aug 11, 2005 10:32 pm
Location: Stockholm Sweden

Postby Rudiger » Sun Dec 11, 2011 2:50 pm

ulrik wrote:
Rudiger wrote:
...... write a quick AS lua script with the line:
require "gd"
.

How would I do that, and where?


Something like this:
Code: Select all
-- **************************************************
-- Provide Moho with the name of this script object
-- **************************************************

ScriptName = "RT_GDTest"

-- **************************************************
-- General information about this script
-- **************************************************

RT_GDTest = {}


function RT_GDTest:Name()
   return "GD Test Script"
end

function RT_GDTest:Version()
   return "0.1"
end

function RT_GDTest:Description()
   return "Quick test script for testing GD library"
end

function RT_GDTest:Creator()
   return "Rudiger"
end

function RT_GDTest:UILabel()
   return "RT: GD Test"
end

function RT_GDTest:LoadPrefs(prefs)
   
end

function RT_GDTest:SavePrefs(prefs)

end

function RT_GDTest:ResetPrefs()

end


-- **************************************************
-- Recurring values
-- **************************************************

-- **************************************************
-- The guts of this script
-- **************************************************
require "gd"

function RT_GDTest:Run(moho)

    -- If you are feeling adventurous, you could try out some gd functions here, eg
              
    local layer = moho.layer
    local layerImage, im
    if layer:LayerType() == MOHO.LT_IMAGE then
         layerImage = moho:LayerAsImage(layer):SourceImage()   
         im = gd.createFromPng(layerImage)
    end
end
Rudiger
 
Posts: 773
Joined: Sun Dec 18, 2005 2:25 am

Postby ulrik » Mon Dec 12, 2011 9:51 pm

Thank you Rudiger!
User avatar
ulrik
 
Posts: 1000
Joined: Thu Aug 11, 2005 10:32 pm
Location: Stockholm Sweden

Help Please

Postby 2dee » Fri Mar 02, 2012 12:30 pm

Hi Ponysmasher and All

Please could you tell me how to use the script; i have installed the files
into the main Anime Pro 8 folder but when i launch Anime Pro 8 i cannot see anything new or any new icons or toolbar.

I tried to create a new PNG layer from the layers menu but there is no entry in the menu to create one.

I have also loked in the Scripts menu for an entry but ther is nothing new in the menu since installing the files.

Maybe i am missing something here; or i am doing something wrong.

Please can you advise on how to use the tool; and where i can see the tool
in Anime Pro 8.

Many thanks.

2dee.
2dee
 
Posts: 3
Joined: Fri Mar 02, 2012 12:22 pm

Postby jhaustin1969 » Fri Mar 02, 2012 8:01 pm

There's a pretty comprehensive list of add-ons for Lua here:
http://lua-users.org/wiki/LibrariesAndBindings


I have added this link to the Anime Studio Toolbar & Website.

I'll keep my eye on this script too and may add that in the future.

Great work Ponysmasher!!

Thank you,
Joe
http://AnimeStudio.OurToolbar.com/ - Get The Anime Studio Toolbar
http://animestudio.potentialsunleashed.com/ - Or Bookmark The Anime Studio Link Collection Webpage.

Over 80 Links To Various Anime Studio Resources.
User avatar
jhaustin1969
 
Posts: 60
Joined: Thu Feb 16, 2012 9:47 pm
Location: Massachusetts

Postby dueyftw » Fri Mar 02, 2012 10:37 pm

2dee

Everything needs to be in its right place. Placing a tool script in main folder will not work.

Open the 'main' then look for 'scripts' you will see other folders. Tool, menu and utility. Now open the new script that you downloaded. The author will have put it in to a folder named tool, or menu. Drag the new tools into the proper folder.

If the new tool is an replacement with the same as an 'lm_' name, it is wise to make a copy placed out side the scripts folder. Just in case you don't like the new one.

Dale
User avatar
dueyftw
 
Posts: 1289
Joined: Thu Sep 14, 2006 10:32 am
Location: kingston NY

Postby jonbo » Fri Mar 02, 2012 10:53 pm

Hey Dale, this script is a little different. The contents of the zip needs to be extracted to the main folder as there are a couple of .dll files that need to be in the main folder. If the script is installed correctly the .lua will be placed into the script>tool folder and you should see a icon in the other section of the tool palette.
User avatar
jonbo
 
Posts: 896
Joined: Thu Apr 08, 2010 2:53 am

Postby dueyftw » Sat Mar 03, 2012 1:18 am

Ya, your right. I forgot about all the dll that need to be in the main folder.

Sorry.

Dale
User avatar
dueyftw
 
Posts: 1289
Joined: Thu Sep 14, 2006 10:32 am
Location: kingston NY

Still not showing for me

Postby 2dee » Wed Mar 07, 2012 2:01 pm

Hi All

Thanks for the reply, i had installed the lua script and dlls as per instructions but the tool icon still does not show any where?

Shouls i be doing something else for the tool to show on any of the tool bars?

Thanks for your help

2dee.
2dee
 
Posts: 3
Joined: Fri Mar 02, 2012 12:22 pm

Postby jonbo » Wed Mar 07, 2012 3:02 pm

Make sure these two things are installed in the correct place. This image shows where they should be.

Image
User avatar
jonbo
 
Posts: 896
Joined: Thu Apr 08, 2010 2:53 am

What Image?

Postby 2dee » Fri Mar 09, 2012 10:23 am

Hi jonbo

Thanks for your reply, i think an image you want me to look at is missing from your post?

"Make sure these two things are installed in the correct place. This image shows where they should be"

Cheers.

2dee
2dee
 
Posts: 3
Joined: Fri Mar 02, 2012 12:22 pm

Previous

Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest