MegaMagnet

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

MegaMagnet

Post by 7feet »

So, in accord with a request and all the rest of the stuff I've found interesting to do...

MegaMagnet

Basically a mod of the magnet, but.

1. You can select the points you want to work with. If you have previously selected points in another tool, that's fine. If you click the "Only Selected" checkbox, that's what you get. The tool will only work on those points. <ALT> click to select new points.<CTRL> <ALT> click to deselect all points, and go back to normal. You can also use <SHIFT><ALT> to add new points to the ones already selected.

2. I hooked up the Magnet Strength part of the script that LM had in there, but hadn't finished. Musta left it for someone like me, so I dropped it in. With the "Use Strength" checked, the amount the points move drops the farther from the center of the circle you are. If you are using the Magnet strength I also swapped to a blue circle to show you roughly where the circle of influence is. It's an ugly bit o' code, so if you use radical changes on the numbers it may not represent whats gonna move so well, but it'll give you a decent rough idea. It's not that far off.

3. The Magnet Strength you can think about as somewhat like the bone strength. Give it a range, and it'll have some influence over all the points in that range (or the selected ones, if you're going that way)

4. The influence determines how far the mouse will move a point, if it's caught inside the Magnets sphere of influence. Subtle or harsh, I think they're both useful.

Separate tool, unzip it in your Moho\Scripts\Tool directory.

Anybody else gonna try this stuff? In the fine tradition of Monty Python, "I wans't expecting..." to be the de-facto official scriptwriter here. Hey, it's cool and all, but don't any of ya got some skills? Anyway, I hope you like this one, I think its a good bit for tweaking drawings, and I could see it handy for some good ol' stretch n' squish animation, especially the Magnet Strength part.

The thought just popped into my head that something similar that worked on the length of all the bones in a layer inside this kinda sphere of influence might be good. Yeah, extend the basic IK setup, yeah. Hmmmm.

Chime in on the scriptng, Yo. I'll put up a nice organized list of the scripts I've done in 2-3 days on my site for download. 'Til then, I don' mind the requests at all. Some help wouldn't suck, though.

--Brian

EDIT- Sorry, It seems I got over my bandwidth limit on that account. This one is fixed, but everything else probably isn't. I'll tune it all up after work. I need to get some proper webspace.
Last edited by 7feet on Fri Dec 03, 2004 1:34 pm, edited 3 times in total.
User avatar
Rai López
Posts: 2238
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

...AAAAGHH!!! I CAN'T WAIT to run your script, but the link doesn't work!! And I can't dounload :cry: Well, THANKS, I Still Waiting...
User avatar
AcouSvnt
Posts: 190
Joined: Wed Aug 04, 2004 4:14 am
Location: Rochester, NY
Contact:

Post by AcouSvnt »

Sorry, Brian, you've been nominated "script guy".

I don't know why I haven't started on that end yet; possibly because I have to go through that uncomfortable initial stage of having no idea what I'm doing wrong, etc. Also because I'm looking into some other things that don't necessarily involve (or not yet anyway) Lua scripting in Moho:

1.) a more advanced auto lip sync method that uses FFT analysis to determine lip/teeth/tongue data. At least lip and teeth, anyway; the tongue might be too difficult.

2.) a way to turn a whole video (in my case from a series of bitmaps) into a single vector "filmstrip" that you could import and and move upwards to create the effect that you're actually watching it. This is where I'm running into the glitch with the EPS files.
-Keith
User avatar
Rai López
Posts: 2238
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

VIVA!! :D The link works now! Uf... I still cannot wait to try it! When I can do it, I'll said you something about, at the moment: THANKS AGAIN!!
User avatar
bupaje
Posts: 1175
Joined: Fri Nov 12, 2004 5:44 pm
Location: California
Contact:

Post by bupaje »

Wow I'd vote you MVP if I wasn't afraid of alienating all the other helpful folks, but you definetly get five stars. :)

As for script writing I'd like to learn but I'm so easily distracted I'm going to wait until I get some more of the animation and stuff under my belt or I'll zoom off on a tangent and takes me weeks to get back on track.

If Lostmarble can't host the scripts and you need some bandwidth I may be able to help. I have a site to set up and have paid for a decent amount of monthly bandwidth but haven't gotten the time to finish it with my new 'work all day' schedule. I don't imagine text files will put any strain on it.
User avatar
AcouSvnt
Posts: 190
Joined: Wed Aug 04, 2004 4:14 am
Location: Rochester, NY
Contact:

Post by AcouSvnt »

I think a good thing to keep in mind is, if we want to start forcing ourselves to learn, we've got at least one person here who's been through it enough times that he can probably help us if we get stuck. The only way to get started is to just start!
-Keith
Tburlingame2003
Posts: 14
Joined: Thu Aug 05, 2004 7:38 pm
Location: S. California
Contact:

Mega tool idea for new version

Post by Tburlingame2003 »

Could megamagnet be modified to move saved selections according to there stacking layer with varying force. This would allow perspective movement on a single layer.
i.e: selections
1
2
3
4
Magnet influence:
1 1
2 or 2
3 3
4 4
based on stacking order.
Pretty please, I'll be your art slave. I do music too!
Toddio
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

Don't really need any slaves at the moment (maybe an elf or 2 would be okay) but that sounds like it would be pretty simple. It's on the list. Seems to be getting to be a long list for this tool just recently, but I think this one should be cake.
User avatar
Lost Marble
Site Admin
Posts: 2347
Joined: Tue Aug 03, 2004 6:02 pm
Location: Scotts Valley, California, USA
Contact:

Post by Lost Marble »

I'd be happy to host Brian's scripts on lostmarble.com. Brian, whenever you're ready, just email me the latest version of your scripts and I'll put them up.
Tburlingame2003
Posts: 14
Joined: Thu Aug 05, 2004 7:38 pm
Location: S. California
Contact:

Thankz in advance

Post by Tburlingame2003 »

The tool is way cool already especially the selected box. But the perspective simulator would be gret. I'm a little big for an elf but I do most everything graphic and sonic in nature if you have a request for an item ask.
(currently converting guitar to midi and running it through a soft synth)
Thanks
Toddio
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

LM - I Never know which one is really the latest, as I tend to mess with them all as I go, but generally the last one I posted is the last one I'm happy with. I remember that you had offered that before. I thought at the time it would be kinda cool to have the collection on my site (maybe with a lil' paypal donate button?) but really, I'm having trouble getting around to it. So (I give my full permission to you) collect them and just put 'em up on the main site. A compendium would be cool. I was putting together a page with all the stuff, a description, and a link to the post where the, err, instructions are. But feel free to have at it. Otherwise, if that's the needed way, I'll email 'em.

ANd don' worry none, Tb, I'll get to it. Gimme a sec.
User avatar
Rai López
Posts: 2238
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

Lost Marble wrote:I'd be happy to host Brian's scripts on lostmarble.com
...And with this, the Lost Marble site it'd be a little MORE animated! :roll: ...VIVA!!! :D :D :D
User avatar
Lost Marble
Site Admin
Posts: 2347
Joined: Tue Aug 03, 2004 6:02 pm
Location: Scotts Valley, California, USA
Contact:

Post by Lost Marble »

Sorry, but I don't think I can collect them. You've produced a lot of great scripts, but they're kind of scattered around the forum. If someone has the inclination to collect Brian's scripts, I'll post them all together, but I'm not up for a scavenger hunt right now.
macton
Posts: 93
Joined: Thu Aug 18, 2005 6:29 am
Location: San Diego

Post by macton »

I created a new version of 7feet's MegaMagnet tool.

Now:

* "Only Selected" ON will only attract selected points
* "Only Selected" OFF will select points within the radius with the mouse is clicked.
* "By Center" will attract the points uniformly from their center. The "By Center" feature is so you can attract shapes as a whole without distortion.
* "Strength" is the amount the magnet attracts. This has been simplified from 7feet's version (You don't need to deal with Strength and Influence seperately)
* Negative values for "Strength" repel points.

See (under Extras):
http://www.lostmarble.com/forum/viewtop ... highlight=
Post Reply