image sequence script

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

Moderators: Víctor Paredes, Belgarath, slowtiger

janimatic
Posts: 136
Joined: Fri Mar 25, 2005 3:22 pm
Contact:

Post by janimatic »

hey!

thank you for the feedbacks!

> ok the file ordering could be usefull;

> i was also thinking of a name filtering feature :
using *.ai to import ai files only,
scene1* to import files from scene 1 only etc...


Also i added my custom illustrator actions here :
http://animatic.no-ip.com/pub/dev/moho/moho_export.aia

> convert strokes to shapes whene necessary
> add point, simplify (keeping curve), re-add points
> export selection as version 8 (usefull to export layers to moho compatible .ai)

The resulting ai files (one per layer) could be imported by my script, let's think about how to keep layers ordering
(numbering file should do it : i think the files are imported in alphabetical order..it depends on system command)

Any other request?
Toontoonz
Posts: 763
Joined: Fri Mar 25, 2005 12:28 pm

Post by Toontoonz »

Wow! :!: Regarding the Illustrator Actions! Wow! :!:
I am impressed. Those are real time savers. :D
Toontoonz
Posts: 763
Joined: Fri Mar 25, 2005 12:28 pm

Post by Toontoonz »

I have yet to try the others Moho scripts you listed above, I will try them tomorrow. They sound like real time savers.
User avatar
7feet
Posts: 840
Joined: Tue Aug 03, 2004 9:45 pm
Location: L.I., New Yawk.
Contact:

Post by 7feet »

Very cool. About how I was going to try and find the initial directory, but then I hit a wall trying to hack together the whole dll thing. The temp batchscript thing is brilliant. A few bits n tweaks-

Made a little function to search back through the strings, little easier to slap in all over the place. Threw it in a few places, particularly on the check for the extension to keep you from possibly pulling a part out of the middle of the path and making Moho maybe try to import an invalid file. Better for error checking, I think.

On the batch file creation for Windows, you had the "change drive" command after the "CD" command", so it might get wierd. I fixed that and threw in a couple of other things like .OBJ import and video.

Oh, yeah, I also forced the filename extensions to lowercase just in case there were some capitals in there (picky, picky Lua), put in an OS check that I think should work, and made it name the Group Layer after the folder you are loading from. Hope you don't mind, here's what I whipped up. Cool stuff, I probably never would have thought to do it like that. Now if you throw in the options and filters it'll really cover it.
janimatic
Posts: 136
Joined: Fri Mar 25, 2005 3:22 pm
Contact:

Post by janimatic »

hey 7feet!

that sounds great!
the web server says i am not authorized to see the file though...
I agree, we should start to write modular and reusable code, and put it in separate files (searchBackward etc...)
I should try the dll thing one of this days (but then i would have to compil my c++ code on 3 os and that s...)
ty very much , your contribution is very helpfull as always!

regards

julien
User avatar
7feet
Posts: 840
Joined: Tue Aug 03, 2004 9:45 pm
Location: L.I., New Yawk.
Contact:

Post by 7feet »

Oops, forgot to set the permissions on that one. Fixed, you should see it now. A general library of handy functions would be good.
janimatic
Posts: 136
Joined: Fri Mar 25, 2005 3:22 pm
Contact:

Post by janimatic »

aw i am still unauthorized..
i even created an account on your server but it didn't fix it...
User avatar
7feet
Posts: 840
Joined: Tue Aug 03, 2004 9:45 pm
Location: L.I., New Yawk.
Contact:

Post by 7feet »

Alternate file that hopefully is accesible
http://www.sharemation.com/MoreMohoC/js ... ctoryb.lua
janimatic
Posts: 136
Joined: Fri Mar 25, 2005 3:22 pm
Contact:

Post by janimatic »

well Brian,

here is your version accessible worldwide :
http://animatic.no-ip.com/pub/dev/moho/ ... ctoryb.lua
I hope u don't mind me putting it online

best regards
User avatar
Hiddicop
Posts: 250
Joined: Sun Nov 07, 2004 7:18 am
Location: Sweden

Post by Hiddicop »

Well, both 7feets links work for me. Great script!
User avatar
7feet
Posts: 840
Joined: Tue Aug 03, 2004 9:45 pm
Location: L.I., New Yawk.
Contact:

Post by 7feet »

Not at all. Anything I put up here is stright up open source and do what you want with it unless I say really specifically otherwise. If I could work out an interpreter for 3d motion capture data I might hold on to that, since I figure that would be some actual work. But otherwise, go nuts.
User avatar
7feet
Posts: 840
Joined: Tue Aug 03, 2004 9:45 pm
Location: L.I., New Yawk.
Contact:

Post by 7feet »

One more time - I couldn't stop messing with it. Did some stuff. Made up a couple of files for global libraries (one me, one you, janimatic). both are in the file.

http://www.sharemation.com/Moho/Example ... w-libs.zip

the sf_utility.lua and the js_utility files go in the [Moho Installation Directory]>Scripts>Utility folder. I tried to throw everything that would be generally useful into the utility libraries. Put in checks for whether or not to keep the file extension as part of the layer names (this often bugs me) for the different layer types. Also the code for file filtering is there. They both just need some UI setup (don't have the energy). Tried something new for the file extension checking. Also put in:

Code: Select all

moho.document:PrepUndo(moho.layer)
moho.document:SetDirty()
'cause otherwise Moho would let you close the project, or open a new one, withour asking you is you wanted to save, which was inconsistent.

That was fun. Can't check anything on the *nix/OSX stuff. Also made up a function that'll just pull the sub-directories into a list (in case you want to fish through a whole tree. In the lib, not the main script.
janimatic
Posts: 136
Joined: Fri Mar 25, 2005 3:22 pm
Contact:

Post by janimatic »

hey Brian!

very cool the code is getting always shorter !
I still don't have the time to contribute right now (making dvd's)
Your server works now for me
User avatar
rylleman
Posts: 750
Joined: Tue Feb 15, 2005 8:22 am
Location: sweden
Contact:

Post by rylleman »

the Import Library script doesn't support the characters åäö in filenames, when importing such files there's an replacement image-icon instead. I can't change them through "image settings>source image" either.
When importing the usual way they work fine.
If it's an easy thing to add support for those characters in the script I would be grateful for an fix, else, no need to bother, I'll just have to avoid those letters.
janimatic
Posts: 136
Joined: Fri Mar 25, 2005 3:22 pm
Contact:

Post by janimatic »

i am sorry,

but i don't think we are acting on character strings.
If unicode is not supported in lua, just don't use it please...

best regards

julien
Post Reply