magnet line width

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

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
Víctor Paredes
Site Admin
Posts: 5661
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Post by Víctor Paredes »

http://www.mediafire.com/?wjzkz35oyyn
here is it. but I think it needs some improvement. width should variate in relation to the center of the magnet scope. for example, a point which be just in the center should increase 100%, one in the middle 50% and one out of the scope 0%. that would be great.
Current magnet increase 100% all the width of the points inside the scope.

edit:
the magnet make exactly what I want if you move up and down... I forgot it :oops:
User avatar
BA
Posts: 196
Joined: Tue Mar 08, 2005 7:28 pm
Location: Griddleville
Contact:

Post by BA »

thank you!!!!

but it doesn't seem to be quite working properly... i can't change the size of the magnet.

does this work with moho 5.4? or does it have to be anime studio?
Create cartoon characters and comics in minutes: www.bitstrips.com
User avatar
Víctor Paredes
Site Admin
Posts: 5661
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Post by Víctor Paredes »

uhm, in windows AS 5.6 it works fine, but I remember it was written in moho days. I don't know how to help you :(
Dodgy
Posts: 207
Joined: Sat Jan 13, 2007 8:01 pm
Location: Sydney
Contact:

Post by Dodgy »

Hi all,

I made a few changes to this script to make it easier to use (for me at least!).
This new version has up increasing the line width with falloff, (going down to increase a value doesn't make sense to me), and if you press shift and drag, that changes the magnet radius.
It can be found here:
http://www.mikegreen.name/Files/rl_magneto_linea.zip
User avatar
synthsin75
Posts: 9973
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

Nice mod Dodgy. Works great.

Might I suggest naming it with a unique prefix. Like:'mg_magneto_linea'. I know it may not seem like a huge mod, but it helps keep the scripts separate. I usually do this because I don't assume my mods are going to immediately replace the modded tool. Just makes it easier to try it out I figure.

Although I've already replaced the other tool with yours. :wink:
Dodgy
Posts: 207
Joined: Sat Jan 13, 2007 8:01 pm
Location: Sydney
Contact:

Post by Dodgy »

LOL It was more of a modesty thing. I only added a little thing to it, so I figured I shouldn't change the tool name. I do wonder if I should change it so if you have points selected already, it only affects those points, not make a new selection, or just grab the points on the line closest to it, as I imagine you only want to adjust one line width at a time...What do you think?
User avatar
synthsin75
Posts: 9973
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

Well since the original writer of this script is no longer around, I think any further development of it should reference the new developer, in case people want to make suggestions or ask questions. Just to be practical. We can always use all the scripters we can get, so modesty shmodesty.

I actually really like that shift key to change the radius. I wouldn't mind seeing that on other tools. Not necessarily radius, but for a key number input.

:wink:
Dodgy
Posts: 207
Joined: Sat Jan 13, 2007 8:01 pm
Location: Sydney
Contact:

Post by Dodgy »

Okay well I did some more rewriting, and renamed it as suggested. It now has a toggle which will restrict the width adjustment to the curve(s) of the closest point to the cursor, which should make it much more useful IMHO. Hope you like.
User avatar
synthsin75
Posts: 9973
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

Awaiting a link to it, MG.
Dodgy
Posts: 207
Joined: Sat Jan 13, 2007 8:01 pm
Location: Sydney
Contact:

Post by Dodgy »

Doh, it's on the bottom of my plugins page, at www.mikegreen.name
User avatar
rylleman
Posts: 750
Joined: Tue Feb 15, 2005 5:22 pm
Location: sweden
Contact:

Post by rylleman »

Thank's!
A good addition to this script.

One thing I have wanted to add to it but never had the time to do is a simple point translate mode (invoked by alt perhaps).
As it is now you have to switch to the translate point tool to position the points when changing their width. Just alt-clicking and dragging would speed up working with this tool tremendously.
So, if anyone else feels this would be a good idea, please add it, I won't get around to it in quite a while.
User avatar
toonertime
Posts: 595
Joined: Tue Feb 27, 2007 8:34 am
Location: ST. LOUIS

dumbo

Post by toonertime »

a sort of newby inquiry:

I downloaded your line magnet script
and notice in the text file it says
provide Moho with the name of
the script.

How is this done?
I guess if you could simply walk me through
the steps of installing the script, I will pay
you on Wednesday for a hamburger on
Monday!
User avatar
rylleman
Posts: 750
Joined: Tue Feb 15, 2005 5:22 pm
Location: sweden
Contact:

Re: dumbo

Post by rylleman »

toonertime wrote:...I downloaded your line magnet script
and notice in the text file it says
provide Moho with the name of
the script.

How is this done?
I guess if you could simply walk me through
the steps of installing the script...
That line is just for the script to tell AnimeStudio what it is called, nothing you as a user should worry about.

To install just copy all files in the zip to your AnimeStudio install folder/scripts/tools and reload AS. (ctrl+F5 or restart) and you should see the new tool at the bottom of your tool panel.
User avatar
synthsin75
Posts: 9973
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

One thing I have wanted to add to it but never had the time to do is a simple point translate mode (invoked by alt perhaps).
Rylleman,

That's a pretty easy fix, so I'll just tell ya real quick, since it depends on which point translate tool you want it to reference (LM or FA). Under the magnet line tool's "OnMouseDown" function you'd add this:

Code: Select all

if (keyEvent.altKey) then
    LM_TranslatePoints:OnMouseDown(moho, mouseEvent)
end
If you want to use Fazek's, you'd just use the OnMouseDown from his tool. You just have to make sure the tool you add this to doesn't already have an OnMouseDown ALT key function.

Hope that helps. :wink:
Post Reply