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
Rai López
Posts: 2228
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

Fazek wrote:MPlayer has a remote-control mode when the user or a "frontend" program can control the playback with string commands, through a standard input "pipe".
:!: :?: :!: I wonder if some multi track audio app could be controled too by Moho in a similar (or best) way to get something like audio mixing features during playback for the program... uf, if possible, it'd be really nice :)
Last edited by Rai López on Thu Jun 15, 2006 11:12 am, edited 1 time in total.
User avatar
ulrik
Posts: 1087
Joined: Thu Aug 11, 2005 10:32 pm
Location: Stockholm Sweden
Contact:

Post by ulrik »

Fazek wrote: 3. Your LUA does not support the io.popen() command. In this case, I can change it to an os.execute("mplayer <tempfile") style command. But I hope the popen works. If I have more information how to invoke MPlayer on the different platforms, I can make an intelligent solution.
Hi Fazek!

This is what I get when running the Mplayer script: 718 'popen' not supported.

I'm running on osx 10.4.6

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

Post by Fazek »

I uploaded the newest version. The os.execute() style invoking of MPlayer is in it, and working fine under Linux. It is a bit tricky because you must create a fifo file with the

mknod filename p
-- ADDED: instead you can use (works both on Linux and OS X):

mkfifo filename

command and you must specify this file in the MPlayer Options dialog. I don't know how this will be with OS X, but I hope it is Unix-like enough to be able to create a fifo file (ADDED: YES). But Windows... I think there is no fifo (perhaps a regular file could work same?) and I don't know how to invoke a command in a separated thread. I still hope that popen() is working on the Windows version...

Answering to Ramón:

The Create Shape tool can select the nearest closed curve around the clicked point. It is just like the flood fill (bucket fill) function in some painter programs. The Max search depth is there because the calculation time increases exponentially when you click on a complex, grid-like mesh. The lower value is safe so your computer won't freeze if you paint such a mesh - simply not selects. But if you really want to select in a complex mesh, you can increase this value easily.

I moved it from the toolbar to a dialog window with a more detailed description. And I added a warning message for the failed search. You can download the new file.
Last edited by Fazek on Fri Jun 16, 2006 8:45 am, edited 3 times in total.
- - - Fazek
User avatar
Rai López
Posts: 2228
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

...I'm going to try it right now! THANK YOU! :D
Last edited by Rai López on Wed Jun 21, 2006 10:51 am, edited 1 time in total.
User avatar
Fazek
Posts: 246
Joined: Thu Apr 13, 2006 1:37 pm
Location: Hungary
Contact:

Post by Fazek »

Well, I checked the MPlayer Windows version and there are several problems so I think it is not possible to use this under Windows yet.

1. The precompiled MPlayer version for Windows (MPF) is highly truncated so it seems no slave mode and no -audiofile option etc. Maybe other versions are better?

2. The LUA version compiled into the Windows Moho 5.4 not supports io.popen(). There is no fifo file in Windows, so I can't use the os.execute() solution. I see in the newest lua source code that it is possible to compile the lua with io.popen() under Windows. So maybe the next version of Moho will support this.

However, my program works under Windows and I wrote the Windows-specific parts properly, so If somebody has any solution to the problems above, please tell me.

I know that maybe other programs can be used together with Moho this way. That's why I think this search for the solution is important.

ADDED: Moho 5.4 currently using the LUA 5.0.2 version. Upgrading to LUA 5.1 would solve these problems.
Last edited by Fazek on Tue Jun 20, 2006 10:34 am, edited 1 time in total.
- - - Fazek
User avatar
Fazek
Posts: 246
Joined: Thu Apr 13, 2006 1:37 pm
Location: Hungary
Contact:

Post by Fazek »

I added a version of the new Paint Bucket tool to my toolset. It closes the missing open curves. Its algorythm is very simple, but often fills when the original LM version fails (specially if loops are there on the outlines).
- - - Fazek
User avatar
Fazek
Posts: 246
Joined: Thu Apr 13, 2006 1:37 pm
Location: Hungary
Contact:

Post by Fazek »

Instancing vector layers is an old feature request. Now I found a solution with a layerscript. It is a bit uncomfortable because you must set it on both the source and on all of the copy layers. It is instancing only the actual positions of the mesh points. The bone transformations are applied, but the layer transformations are not. So if you want to create a drop shadow for your bone-animated character, this is a good solution, and you can do it if you distort the layer. It's on the download page.
- - - Fazek
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Fazek.

The meshinstance script zip file on your download page is linked to the mplayer zip file.

You may want to fix this... ;)

For those who desperately want this... I cheated and pasted the address into a browser window and typed in the correct name and was able to get the correct file to download...

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

Post by Rai López »

:shock: ...HAAANKS!!! :D :D :D This's something that I always have wanted/needed and I can't believe see it made :), really it can save my life in some specific character construction/animation aspects and many others that was a very difficult or even NO solution before... Definitely there is now much more real time liverty inside Moho and this is always like a good reason to celebrate! :D ...Now, if you don't mind, I'll continue investigating about it :) And well, as I still have said: ...THANK YOOOU!!!
User avatar
Fazek
Posts: 246
Joined: Thu Apr 13, 2006 1:37 pm
Location: Hungary
Contact:

Post by Fazek »

Not again! The same mistake... I must write a program to update the index.html.

I made a new version too, the old one's caching was wrong. As I see it is comfortable to set the layerscript to the source layer before duplicating it, because the duplicating copies the layerscript settings as well. Then you rename the new layer to NAME.dup. Maybe a menu script would be useful to duplicate and rename a layer this way.
- - - Fazek
User avatar
ulrik
Posts: 1087
Joined: Thu Aug 11, 2005 10:32 pm
Location: Stockholm Sweden
Contact:

Post by ulrik »

Thank you again Fazek for your scripting skills, I tried this new one and it seems to be working well.
:D
Toontoonz
Posts: 763
Joined: Fri Mar 25, 2005 9:28 pm

Post by Toontoonz »

Fazek - you are doing some very interesting scripting.

I downloaded the tools part and am trying them out.
Could you do me (and others, I am sure) a favor and explain the advantages of your tools over Moho´s versions?

Why should I have two versions of the Freehand, Create Shape, Scale Points, Paintbrush, etc, etc, tools on Moho?
What makes yours more advantageous to use over Moho´s tools?

Thanks
- that would really help a lot if you could compare tool-by-tool (Moho vs. Fazek) the differences and benefits of installing your tools.
User avatar
Fazek
Posts: 246
Joined: Thu Apr 13, 2006 1:37 pm
Location: Hungary
Contact:

Post by Fazek »

A short description added, see http://www.firkafilm.com/moho/tools.html. My tools have blue icons, so you can see which belongs to me and which belongs to LM. You can install my tools one-by-one, but there are cross-references between the LM's tools, so you cannot remove them, but you can try to move them into the scripts/utility folder. Also, you can edit the tool/_tool_list.txt file to place my tools into the place of LM's.
- - - Fazek
Toontoonz
Posts: 763
Joined: Fri Mar 25, 2005 9:28 pm

Post by Toontoonz »

Fazek - thanks for the details on each tool!

I am slowly starting to work with your tools and I noticed that they create a smoother workflow to create art with and then manipulate it.
Moho tools are so clumsy and awkward in the back and forth clicking of tools to do the simplest of things. (Sometimes I wonder if LM is stuck in the "that´s the way its always been done" bureaucratic mode of thinking and won´t change things.)

My other source of nerve irritation with Moho tools is the way one manipulates a line after it is drawn. I know (or assume) that the method of adjusting curves as in Freehand, Illustrator or any other vector drawing program is not possible in Moho, but isn´t there a better way to do it than what is now used?
In Moho a line curve is manipulated with a combination of:
the Translate tool,
the magnet tool,
the curvature tool,
and so on.
Why not one tool to do it all?
Toontoonz
Posts: 763
Joined: Fri Mar 25, 2005 9:28 pm

Post by Toontoonz »

Question/Request on the Translate Points tool:

Is it possible to make it so that one can select more than one point on a line with the Translate tool?
With the Translate tool it seems one can select either one point or all points in a line/shape. What if I want to select 2, 3 or different points? In other vector drawing programs one holds down the shift key and can select any combination of points (and on multiple shapes/lines).
Is this possible?
Other wise one has to switch tools, get the Select Points tool, select the points, then go back to the Tranlate points tool to move them. Back and forth, back and forth between tools.
Too much back and forth between tools is a very clumsy working method.
------------

UPDATE:
I just noticed the "Lasso" option at the top of the window for selecting multipled points. It works good - as long as one can lasso all the points one wants (!).

And the "Drag" option is nice - one does not have to select the point, just be near it to drag the point.

---------
I would recommend everyone to install the modified Moho tools Fazek has created. You will enjoy working with Moho much more.
Post Reply