Three 'How do I...?' with user scripts

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

Moderators: Víctor Paredes, Belgarath, slowtiger

arfa
Posts: 244
Joined: Tue Dec 23, 2008 8:15 pm
Location: New Zealand

Post by arfa »

Its an exciting start to the day. No time just now for testing but I will carry the buzz - and the gratitude - with delight.

Many thanks for that synthsin - very much appreciated.

. arfa
arfa
Posts: 244
Joined: Tue Dec 23, 2008 8:15 pm
Location: New Zealand

Post by arfa »

Wellllllllllllllll, you done it good.! This warrants a hotkey (not sure if I can do that?). I don't use the safe-zone guides so:

ctrl + F - fantastic, fabulous, facile, free... fank you ferry much

oops? A bit more poking about...
I was curious about layer-ordering keys being shifted.
So, click on a group folder:
set GUI: frame 258 - shift 10 - all layers > lua console =
shift_layer_keyframes:419 attempt to index global 'CC_SAVE_LAYER_ANIMATION' (a nil value)
So i added that - restart
then: lua:403 'CC_SAVE_MOHO_TEMPLATE'
So i added that - restart
then: lua:403 attempt to call method 'SaveBool' (a nil value).

On a layer-by-layer basis it seems to have no problem, just 'starting with selected' or 'all layers.' I am not sure when I would use 'starting with selected'?

One little thought pops in. Is it possible to have the GUI load the current timeline pointer position? One of those geek-tweak thoughts :]

So, food for thought but, for me, no dampening of enthusiasm.

thanks again - arfa
User avatar
synthsin75
Posts: 10280
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

Damnit! These Macton scripts really are a mess. As far as I can tell those MOHO_TEMPLATE errors should only occur if there is a switch layer in the layers you are trying to shift. It's making a call to another Macton script which I didn't even have installed. But that didn't matter, there are obvious errors in that other script.

This is because the switch keys are actually the names of the layers, so they're different from most keyframes.

Also there's no shifting layer order keys. I've been working to read them from the file format directly, because there is no script access to them. Even once I read them, there's no writing new ones by script (until MC adds this to the scripting interface).

Eventually I guess I'll have to break down and rework all the Macton scripts.

But then they'll all be mine, Muahahahahaha. :twisted:
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

There is a wealth of information in those Macton scripts but there are a lot of errors as well. Some of it is a bit over the top. I think what they were doing was trying to come up with a complete total all encompassing solution for handling the accessing, copying and saving of key frames. Many of their scripts do this sort of thing. They put in everything and the kitchen sink. It's HUGE and kind of tricky to see what's going on.

One specific nugget of code that I have "borrowed" from their scripts is the pop up window display formating. They did a really good job of "automating" it somewhat using functions to build the display. Instead of everything spread out over the pop up window creation they use a function to "build" it. The function is somewhat easier to read and more flexible. It takes some figuring out though. ;)

Normally you would have to do all the pops and pushes around the actual code defining the window elements. They create that code for those elements and then just send it as argument variables to the function. So all the "pops" and "push" are more compact. This also allows you to expand or change the layout a... uh... tiny bit easier (not much ;) ).

-vern
arfa
Posts: 244
Joined: Tue Dec 23, 2008 8:15 pm
Location: New Zealand

Post by arfa »

Yes, there is clean code and there is mess - I produce a certain amount of each.

There was indeed a switch layer in the group.

I have a working solution with my PHP (which I pretty much have running all the time) so no worries there. Still, it would be nice to have a (simple?), layer by layer empty-key-insertion -- ESPecially if it could be hotkeyed.! Just position the pointer and key-press - voila.! It sounds so easy when you say it with a Rench accent.

So, don't sweat it synthsin.
Still, I know how taunting unresolved code can be.

thanks again - arfa
User avatar
synthsin75
Posts: 10280
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

The more I look at them the more I know I'll end up fixing them. At least one of these shows its age as it says that some things aren't available in the, then, Moho API even though they are now. So these are definitely needing updating.

Also, if I'm not mistaken, some of the code could be done easier. :wink: :roll:
Post Reply