HartyBart opened this issue on Jul 19, 2020 · 6 posts
HartyBart posted Sun, 19 July 2020 at 9:41 PM
Thanks you so much, Structure, that's solved it. After a bit of rebuilding I now have a working script to turn off all lights except the currently selected one, do some useful things, then turn them all back on again.
I found, though, that at first I had 'invalid syntax' error on your 'Else:' — this was fixed by indenting all the way down the script. Below is a visual example of what I mean:
if test_for_light():
put the body of your script here
<- indent
<- indent
<- indent
<- indent
<- indent
<- indent
<- indent
<- indent
<- indent
else:
poser.DialogSimple.MessageBox("To run this script, please first select a light.")
In other words, the script has to have "a clear run" down the indents to get at the "else:" command. If not then it throws an 'invalid syntax' error. This should be useful to know for other beginners reading this in years to come.
Learn the Secrets of Poser 11 and Line-art Filters.