Onlayer with a variable?
Posted: Tue Jan 03, 2017 6:47 am
What I'd like to do is set a variable, and then show/hide images using that variable.
The above code does not work, says that the layer Var doesn't exist, so the straightforward method doesn't work, but is there some way that I can do this, or am I forced to put if/then chains on each time I show/hide it so that it activates a different "show" or "hide" command with the right layer?
Code: Select all
config.layers = [ 'master', 'MyUniqueLayer2', 'MyUniqueLayer1', 'transient', 'screens', 'overlay' ]
default Var = "MyUniqueLayer1"
if X:
$ Var = "MyUniqueLayer1"
else:
$ Var = "MyUniqueLayer2"
show MyImage onlayer Var