Scripting UI - PushH, PushV - Don't need to be "balance

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
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Scripting UI - PushH, PushV - Don't need to be "balance

Post by heyvern »

It would appear that PushH() and PushV() don't need corresponding Pop()s.

Is this correct?

Too many Pops crash... I can understand that one.

So, a Push and a Pop create a "unit", but a Push doesn't have to be closed with a Pop...

Losing my mind in the indented formatting. I don't quit... remember... which Pushes I closed with a Pop.... so... AAAHHHHHHGGGGG!

;)

-vern
User avatar
Rasheed
Posts: 2008
Joined: Tue May 17, 2005 8:30 am
Location: The Netherlands

Post by Rasheed »

Push and Pop are so-called stack operations. AS reserves space for this in computer memory. However, if there are no more items on the stack, and you perform a pop operation, you will get an illegal memory call (caused by a stack underrun), because you refer to a part of memory which wasn't reserved for AS.

The operating system senses this, throws an exception (in Mac OS X: EXC_BAD_ACCESS), and halts the offending program (AS), which equals a program crash.
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

I figured it out!

Check out this thread for my upcoming new copy/paste bones scripts (still a work in progress):

http://www.lostmarble.com/forum/viewtopic.php?t=7842

Took me a while to get the hang of it. Very tricky stuff.

Image

TextLists are great. I just wish they had similar properties as menus. It would make it a lot easier. Almost the same but not quite. Have to build custom code to handle "true" and "false" and rebuild the lists.

I finally figured out the power of the UTILITIES SCRIPTS!!! Wooohooo! Built a function that assembles the TextLists from the bone list. just like BuildBoneMenu. Works like a charm.

-vern
User avatar
Rasheed
Posts: 2008
Joined: Tue May 17, 2005 8:30 am
Location: The Netherlands

Post by Rasheed »

Yes, utility scripts are so powerful, because they are available all the time.

BTW It would be nice if there were an easy mechanism available to install scripts, so non-programmers can take advantage of new scripts as well.

Perhaps a script to install other scripts?
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Rasheed wrote:BTW It would be nice if there were an easy mechanism available to install scripts...
Hmm... I don't know but... dragging a file to a folder doesn't seem like rocket science to me... I've done this myself several times so I may be biased.

;)

I suppose it could be done with some kind of installation script using a zip application or Stuffit. Something that simple couldn't be too hard.

-vern
User avatar
Rasheed
Posts: 2008
Joined: Tue May 17, 2005 8:30 am
Location: The Netherlands

Post by Rasheed »

You'd be surprised how many people don't know where their applications are located, and even that there is such a thing as a specific application location on a harddrive.

The distributions of Anime Studio and Anime Studio Pro for both Mac OS X and Windows come with an installer, that looks (or should look) for the installation directory of the main application, that could be anywhere on the system (even on an external drive, a network attached drive, thumb drive¹, virtual drive, etc.). AFAIK The Linux distribution even hasn't an installer, so it has to be installed manually, which is far from user-friendly.

So this isn't as trivial as you think it is.
________

¹See this screenshot:
Image
There was an error during the installation (because it expected a harddrive), but Anime Studio Pro just launched and seems to work as usual. I guess this also applies to NAS drives.
Post Reply