Background Image Script?

 From:  Michael Gibson
6162.13 In reply to 6162.11 
Hi FDP, I've attached an initial starting point - copy the attached IncrementImage.js file into the \commands folder inside of MoI's main installation folder. That will then make a new command named IncrementImage available. To trigger the command set up a keyboard shortcut for the command part of the shortcut key put in: IncrementImage (just plain IncrementImage, no "script:" prefix and no .js extension).

The command expects for there to be one already existing background image in the file. It will get the filename of that background image and split the name into pieces, increment the numeric piece and then set the new filename onto the image. Internally that causes a reload of the image and the image should update.

Note that currently it is assumed that the filenames have 5 numeric digits in them before the file extension part, and it's also assumed that all the images of the set have the same aspect ratio. The 3D-space image size stays the same during this reload and if the new images does not have the same pixel dimensions as the old one it will still be stretched to fit in the same area as the old one anyway.

One other note - when you're working on editing this command there is a setting that you should change first in moi.ini to prevent command files from being cached. Go to Options > General and push the "Edit .ini file" button. Then in the [UI] section of the .ini file set:
DisableFileCaching=y

By default MoI internally caches any command file that it reads off disk, which is annoying when you're making changes to them since it means you have to exit MoI and restart it to get the new script to be loaded. But if you set DisableFileCaching=y you can keep MoI open and it will reload the command file each time the command is launched instead.

- Michael

EDITED: 10 Sep 2013 by MICHAEL GIBSON

Attachments: