. ok, it works - once.
. i created a simple module, with a load button (loadImg) and a text entry area for the full path to the image directory (loadPath)
. my goal is to load banks 7 and 8 with up to 31 images from the directory specified.
. in Init() i import os, and set defaults for 'loadImg' and 'imgPath'
. in MessageEvent() i have the following :
Code: Select all
if msg == 'loadImgs' :
if param['value'] :
# change debug to 1 to print info...
debug = 1
imgCount = 0
if debug : print "looking for directory :", loadPath
if os.path.isdir(loadPath) :
for fn in os.listdir(loadPath):
if imgCount < 32 :
loadData = (96 + imgCount),loadPath+"/"+fn
if debug : print "Found Image : ", loadData
modul8.setValue('direct_media_change',loadData,0)
imgCount+=1
elif msg == 'loadPath' :
loadPath = str(param['text'])
. so, it checks if the path is a directory and then loads up to 31 images from it.
. the first time i run the module (click my load button) - the images are loaded correctly in the correct positions
. if i change to another directory, and click load, only the first image in that directory is loaded, although the print statements show that it sees all the files.
. if i change to a third directory, all the images from the second directory get loaded into the media window and subsequently disappear!
. if i click load again (attempting to load the third directory) the images thumbnails load in (but all have the red dot on them) and disappear right away.
. if i re-compile and run the module, it exhibits the same 'briefly show the last requested images and then they disappear' behavior
. is modul8 caching some of the data? a bug? if i quit modul8 and restart it, it will work once, but then not load anything else.
. anyone have any ideas what's causing this?
. thanks!
-james