. ok, for the curious, this is my solution
. in Init()
import os
. then i have a button that grabs the current preview and runs saveLiteToImage()
. variable previously set:
capturePath = '/Users/anomad/Desktop/collage' -- this mirrors the save preview files location in preferences
workMedia = 2 -- the media id i'm going to load this into (bank 1, top row, 3rd from left)
currentWork = 4 -- the clip layer i want the image to show up in. the user is manipulating layer 3. (layers 1 and 2 will have how to and other prompts being displayed)
Code: Select all
def saveLiveToImage() :
modul8.setValue('direct_snapshot_mainOutput',1,0)
if os.path.isdir(capturePath) :
for fn in os.listdir(capturePath):
myFN = capturePath+"/"+fn
print myFN
loadVal = workMedia,myFN
modul8.setValue('direct_media_change',loadVal,currentWork)
modul8.setValue('ctrl_layer_media',workMedia,currentWork)
. so, i loop through the directory to get the last item (sorted by name, i'm guessing) - then i load that into the media set and reset currentWork layer to the new media
. it works. sort of... to make the program interesting, i'm allowing the user to rotate, scale and move the pieces.
. to scale the pieces - i first set 'ctrl_layer_scale_factorUniform' to 4. then, the module changes 'ctrl_layer_scale_uniform' to change the size
. and this causes some interesting behaviour
. here is a screen cap of before i capture the preview and save it as a .png
. looks good, so i call my routine above, it saves it into the next layer and shows me the exact same image, in the same location.
. this is video image on layer 3 (scale_uniformFactor=4), still image i just captured on layer4 (scale_uniformFacor=2)
. the capture appears to be smaller....
. and continual saving of the image w/o moving the top layer produces a getting smaller effect
. is this expected behaviour ? or is modul8 not taking into account a layer might be zoomed when it captures the preview?
-james
(a nomad. )[