Background Image Script?

 From:  FDP
6162.7 In reply to 6162.6 
Hi Michael & Brian,
Sorry for the delay in my response. I was originally thinking that there would be a single background image, and the script would merely control what file it actually pointed to.

The method Michael proposed of having it load a new image into a new background (with identical coordinates) and then hiding the previous version would probably work as well, but I could see having to manage hundreds of images getting a bit unpleasant from a user perspective, for example if the user wanted to hide the background, they might be forced to scroll through a list of hundreds of images.

What might be nice would be the ability to move in either direction with the background image, or even specify a frame number.

this is what I was thinking, in horribly written very general psuedocode:

background_file = userinput
background_filename = (background_file[0 to -5 characters])
background_frame = integer(background_file[-5 characters])
background_ext = extension
Z_increment = float(userinput)
Z_current = 0.0 (optionally let user set this)

increment function:
if userinput_frame_increment_command{
select curves with name("Unnammed")
selected curves new name = background_filename + background_frame
Z_current = Background_frame * Z_increment
selected curves.move(z) = Z_current
background_frame++
background_file = background_filename + background_frame + background_ext
reload background (error condition if no file found: optionally increment up to 5 times to search for missing frames, give user the option to search forward a given number of frames or end script)
}

decrement function:
if userinput_frame_decrement_command{
select curves with name("Unnammed")
selected curves new name = background_filename + background_frame
Z_current = background_frame * Z_increment
selected curves.move(z) = Z_current
background_frame--
background_file = background_filename + background_frame + background_ext
reload background (error condition if no file found: optionally increment up to 5 times to search for missing frames, give user the option to search forward a given number of frames or end script)
}

frame select function:
if userinput_frame_select_command{
frameseek= userinput_frame_number
select curves with name("Unnammed")
selected curves new name = background_filename + background_frame
Z_current = Background_frame * Z_increment
selected curves.move(z) = Z_current
background_frame = frameseek
background_file = background_filename + background_frame + background_ext
reload background (error condition if no file found: ask user to re-input or to cancel script)
}


Thanks,
FDP

Edit: Sorry, I am in kind of a rush and realized there were some errors. I've fixed it up a little, but I'm sure it is still a bit broken. Hope it helps to communicate my thoughts!

EDITED: 10 Sep 2013 by FDP