Please send suggestions for my scriptwriting

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

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
Fazek
Posts: 246
Joined: Thu Apr 13, 2006 1:37 pm
Location: Hungary
Contact:

Post by Fazek »

I uploaded a modified version. I have no experience with others' tools, I found only the HV_UniversalPointTool and sf_UniversalLayerTool. The UniversalPointTool is extremely useful as I see, everyone loves it and perhaps I will try to make something similar. But I want to make something what is at least looks like a conventional toolset: separated selection, moving, rotation, scaling etc. But these tools would have "shortcuts" to other functions, so an expert could rotate or add points with the moving tool, etc.

For a beginner (like I was two weeks ago) a tool what is working similar to other programs' functions and reacts as the user logically expects, is very important - nobody likes to read manuals. And all of the extra functions must be natural and visible. For example, if you add a button or checkbox for a function at the top line, the user will know the function exists and will search for a keystroke or mouse action to use it easier.

A designing notice: I am using the Linux version. In Linux, traditionally the Alt key with pressed mouse button is a window manager function to move a window on the screen, so it is useless for any functions in any X11-based program (however, some but not all window managers can be configured to other buttons). But it is working usually if someone presses Alt AFTER the mouse button and it can be used together with another modifier key (Alt + Ctrl is also a window manager favourite, so Alt + Shift is safe only). So I will avoid using the Alt key as much as possible, and Alt will result the same function regardless of the combination with other modifiers.

If there are other special problems under the other operating systems (specially I have no information about Mac at all) please notice.
- - - Fazek
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

The HV_UniversalPointTool is mine (heyvern). It is basically a modified version of the one that 7feet did a while ago called sf_UniversalPointTool...

I have since discovered mine has a bunch of problems... mostly related to me being a horrible LUA programmer. ;)

It has too many "make dirty" references... so it messes up the undo... basically every dang thing you do is part of the undo... I really need to fix that... it probably slows things down too.

There is also some god almighty looping in there that slows it down on really big selections... I really need to fix that as well... if you have a HUGE selection and drag it... there is a noticeable pause before things start moving.

What you've done is fantastic... but as it was when I switched to using my own universal select tool... it took a while to make the transition. You don't know how useful something can be untill you force yourself to use it ON PURPOSE ALL THE TIME. (I actually change my tool key selection and order thingy so the "new" stuff is at the top and the key commands default to those... this forces me to use them without thinking or deciding which one to use.)

7feet also made the observation that there just aren't enough modifier keys to put everything you want in there. I really wanted to put the shift constraint back in mine... uh... ran out of keys though. And as of now, can't use the right click for anything.

I am keeping your new gizmo loaded up. I really like it. It really depends on what I am doing at a particular time that determines which tool I use. I may use yours if I need to make a bunch of point tweaks and change colors and shapes. Or maybe if there is a really confusing bunch of splines a certain tool is better suited to select those items. If I am just drawing intensely I just use the regular add point tool... it works best for that.

Keep up the great work. It is appreciated.

-Vern
User avatar
Fazek
Posts: 246
Joined: Thu Apr 13, 2006 1:37 pm
Location: Hungary
Contact:

Post by Fazek »

I don't know yet how my tools works on large amounts of data. I think one problem is that lua is an interpreter language and it is relatively slow, so "brute force" algorythms are not working. However, I think some tricks could help:

- try to minimize the time in cycles. Put the local variable declarations outside of the cycles and use variables only if a thing is referenced at least twice.

- try to find better algorythms. For example, if you see the FloodSelection function in my utility/fa_sharedutils.lua (shortly: it selects the smallest closed curve around the clicked point), it has a problem that its working time increases exponentially with the number of curve "segment" nodes. It slows down easily, so I restricted the number of iterations to 200. Above the limit, the function is not working. I am thinking on a better solution, but...

- the final key is in the hands of LM: they should add new speed-up functions, written in C (for example: mesh:SelectedPoint(id), similar to mesh:Point(id)). There are a lot of problems when calculating bone positions. Maybe if there would be two vector variables for the bone's two end... Always needed! And my FloodSelection could be incredible fast with a pixel-based FloodFill(screenPt) function...
- - - Fazek
User avatar
Fazek
Posts: 246
Joined: Thu Apr 13, 2006 1:37 pm
Location: Hungary
Contact:

Post by Fazek »

About the FloodSelection, I found some tricks to lower the number of checked variations (you can try it with my Create Shape tool). Now I am not sure it is working in every situations...

(Added 02/05/2006) Now I made a more tricky version of FloodSelection. And you can set how deeply (ie. long running time) you want to check the curves.

Another thing I am thinking is to add bones support to the Translate, Rotate and Scale tools. This means I try to manipulate the bones just like the points. Anyone thinks this would be useful?

(Added 02/05/2006) Translate and Rotate is ready now.
Last edited by Fazek on Tue May 02, 2006 7:46 am, edited 1 time in total.
- - - Fazek
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

For me having vector and bone selection/editing in one tool would not good. Just me. Only me... this is just my opinion.

A couple of reasons why...

I have found that the more things I can "accidentally" move around... the more likely I will. Using the point selection tool is hard enough grabbing only what I want... add in moving or selecting a bone with that... Yikes! ;)

Also... I tend to do things in "sessions"... I am not likely to need to move bones with the same tool I edit vectors with. In fact... never hardly. If I am doing bones... that's it... just bones. If I am drawing... just drawing. I don't switch back and forth.

If I could move and select EVERYTHING with that one tool... I probably would end up selecting a bone when I meant to select a point... or visa versa.

These are just my preferences.

-Vern
User avatar
Rai López
Posts: 2228
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

heyvern wrote:If I could move and select EVERYTHING with that one tool... I probably would end up selecting a bone when I meant to select a point... or visa versa.
But I think this rarely could happen actually cause the most general and usual bones and points tasks are related with the current layer that you have selected at the moment (plus I think that it's perfectly resolved in the Fazek's GREAT Select Points tool! :D), so I wouldn't worry too much about this :)

And Fazek (HI!), although I must confess that I'm usually a little reticent to get myself to use other important tools that LM provides (maybe for future updates or support issues plus avoid fill my interface with repeated tools), your proporsal is something that I always have wanted cause I have the thought that (in occasions) Moho wants to be SO easy and simple that finally it not be so much... I mean, I always have worked very nice with it, cause basically it's the same since I knew it and never have minded, but recently (in example) I show it to a friend that knows a lot about this kind of things and I remember his first words was: But What's this! (in Spanish) I don't know what to do with all that tools! And well, seems that they afraid to him a little at first when maybe it could be easily avoided treating to follow the line (or similar way) of more standard program tools...

Well, as I said I LIKE the way Moho tools in essence, but dislike (a little) how I must be changing tools continuously to realize recurring tasks that really could be made easily with the same tool and Grafic view interaction helpers, well, it's my opinion and here is it :) ...CIAO & THANKS!


EDIT: ...ARGH! I almost forgot there are new tools added for FUN! :D THANK YOU for that too!!!
Last edited by Rai López on Fri Apr 28, 2006 5:35 pm, edited 1 time in total.
User avatar
Rai López
Posts: 2228
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

BTW... really is there no way to can remove the original LM tools to works only with yours? If I delete/remove the LM_select_points tool I obtain the follow error in the Lua Console window:

cannot read C:\Archivos de programa\Moho\scripts\tool\lm_select_points.lua: No such file or directory

I suppose I understand now what were you talking about the hardcoded script names issue... although I thought that the "fa_sharedutils.lua" file w(c)[/size]ould be useful to avoid this situation... :(


EDIT1: Hmmm... I've renamed your tool with the same name as the original and the error has disappeared, but well... Now I wonder if this is the best way to resolve the problem... :roll: , is it?

EDIT2: Hmmm2... Definitely it seems like a NOT very good idea :P :(
Last edited by Rai López on Fri Apr 28, 2006 6:07 pm, edited 2 times in total.
User avatar
jorgy
Posts: 779
Joined: Sun Sep 05, 2004 8:01 pm
Location: Colorado, USA

Post by jorgy »

Fazek wrote:Another thing I am thinking is to add bones support to the Translate, Rotate and Scale tools. This means I try to manipulate the bones just like the points. Anyone thinks this would be useful?
I think I agree with heyvern that adding it to the vector tool would make it more easy to mess things up. I would prefer a separate tool, but that's my my opinion.

jorgy
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Hah!

Of course! What was I thinking? You can't grab a bone on a vector layer...

Sorry for the confusion... lost my head there. Went a little mad.

-Vern
User avatar
Fazek
Posts: 246
Joined: Thu Apr 13, 2006 1:37 pm
Location: Hungary
Contact:

Post by Fazek »

To Ramón: You can remove the LM tools if you replace them into the scripts/utility folder. You can't remove most of the LM tools because other LM tools are referencing their functions and variables. In my version, I don't make any cross-reference between the tools, so you can use any of them separately. I put all common functions and variables into utility/fa_sharedutils.lua.

I made the modifications to use the Translate Points and Rotate Points tools with bones. It works only if you are on a bone layer, so it won't touch the parent bones on a vector layer (good news to Heyvern). It works really just like the moving of points, and I think it is not a replacement of the real bone tools, just a new and easy way to replace things - try it and you'll see.

As far as I see, I will not extend the Scale Points tool to bones, because scaling of bones is a strange thing in Moho (you cannot enlarge a character if you just scaling all of its bones) so this tool probably would be useless.

I added a new (non-LM) tool, Polygon, to draw regular polygons and stars.
- - - Fazek
User avatar
Fazek
Posts: 246
Joined: Thu Apr 13, 2006 1:37 pm
Location: Hungary
Contact:

Post by Fazek »

A new Exposure Sheet tool added!

You can edit Switch layers as exposure sheet (dopesheet) columns. A timeline key in a Switch layer is a simple character string, independently of the sub-layers' names. With this tool you can add, remove and modify these keys. You can list and edit up to three Switch Layers parallely. Another useful feature is that you can assign ANY names to the keys, what is very useful when you control something with the fake names in your program.
- - - Fazek
User avatar
rylleman
Posts: 750
Joined: Tue Feb 15, 2005 5:22 pm
Location: sweden
Contact:

Post by rylleman »

Fazek wrote:A new Exposure Sheet tool added!
That's a cool tool!, just tested it briefly and I think I will use it from time to time.
Do you think it would be possible to link the different colums?, (If you change a switch in colums 1, column 2 and 3 are also changed to the corresponding key).
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Fazek wrote:A new Exposure Sheet tool added!
Oh baby!

Kick me in the head and call me Nancy... this is cool as heck!

What really gets my juices flowing (creative juices) is seeing what you can do with scripting on a tool!!

My goodness... that looked like a ton of work. It would take me a week just to "over design" the layout of that window... forget what it actually does. Can't wait to start playing with it. I use switch layers up the wazoo ("wazoo" is a computer animation technical term)... this is great.

With Fazek around who needs Lost Marble wasting our time with silly updates and new features? ;)

p.s. His baby should be in high school by now right? Internet time? They age faster now don't they?

-Vern
User avatar
Fazek
Posts: 246
Joined: Thu Apr 13, 2006 1:37 pm
Location: Hungary
Contact:

Post by Fazek »

I found some mistakes in the code so please upgrade. The exposure sheet tool will get a second (third...) dialog window to handle layers generally. After that the tool name will be LayerCommander. New features:

- load and save the switch timeline keys in the usual format (I need test results on non-Linux systems!!!!)

- load image sequences into the switch layer

- rename images

- delete images (since in LUA you can't delete a layer, it puts them into a ((Trash)) group layer)
- - - Fazek
User avatar
BA
Posts: 196
Joined: Tue Mar 08, 2005 7:28 pm
Location: Griddleville
Contact:

Post by BA »

I installed the exposure sheet script but it doesn't seem to be doing anything. Am I missing something?
Create cartoon characters and comics in minutes: www.bitstrips.com
Post Reply