Smoothing?

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
super8mm
Posts: 340
Joined: Sun Oct 12, 2008 11:22 pm

Smoothing?

Post by super8mm »

Is there a smooth arcing of points script?

Where points can be selected and then the action causes all the points to have equal distance between them and every point between two others is averaged.
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

Where points can be selected and then the action causes all the points to have equal distance between them and every point between two others is averaged.
I barely remember something written previously. A deep search in the Scripting forum might give you the answer.

Anyway, try to recreate the script manually and you'll find that the curvatures need to be adapted to fit the original curve. That lead into a multisolution problem... eventually without solution... unless you add more points...
Image

-G
User avatar
super8mm
Posts: 340
Joined: Sun Oct 12, 2008 11:22 pm

Post by super8mm »

I'm checking the manual...
Instead of writing your program to a file, you may run the stand-alone interpreter in interactive mode. If you call Lua without any arguments, you will get its prompt:

Lua 5.0 Copyright (C) 1994-2003 Tecgraf, PUC-Rio
>
Is that what it means to do it manually? How do you do that?


It's only when I'm in the passion of creating that I wish I could have tool to express myself faster and better. I'm willing to make a lua script, I know action scripts from flash and Java.

I would need a noob level hello world type tutorial to learn:

Scripting syntax
Selecting a point
Getting a numeric value of a point
Assign a numeric value to a point
Move a point
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

I mean, BEFORE write an script or ask someone write an script, try to proof that it can be really possible to do with the current geometry tools. The example I gave you tries to show that with only three points is very difficult to average the position of the points in a curve without modify the curve's shape, even changing the curvature of the points.
Also think that a script is just an automation of a task, that should have to have an unique solution (as many equations as variables) and not a intelligent system unless you program it carefully.

For a totally noob lua programmer I recommend to read the LM first post about scripting and the lua manual for lua standard reference. In any case you should have an initial idea of coding in any structured language to dare with the coding of a script for Anime Studio.
For now, the best way to create new tools and menu commands is to start with one that comes with Moho and modify it to fit your needs.
-G
User avatar
super8mm
Posts: 340
Joined: Sun Oct 12, 2008 11:22 pm

Post by super8mm »

Yeah! I see what you mean. That was educational.

OK! So the easiest solution would be a 5 point half circle tool where all the points would be on the circle.
Post Reply