View Full Version : Lscript Question: Adaptive sampling

04-01-2009, 06:36 PM

I was attempting to write a simple script that, among other things, turned on Adaptive sampling.
So far, I'm only able to toggle it on and off with CommandInput("AdaptiveSampling 1");
(the number doesn't seem to matter)
I'm new to lscripting, but I was hoping there was a way to check IF this is not on, THEN turn it on. Is there a common way to deal with all toggle switches like this?
Thank you in advance!


04-01-2009, 08:43 PM
Looks like there is no way to get the current value. This isn't unusual (as you seem to have noticed) - that there is no getter, and that the setter is a toggle rather than a setter that takes a boolean argument (for on/off). I haven't got a clue why someone thought toggles was a good idea, especially with no getter. It means you'll always be toggling blindly, compared to a setter that takes a boolean were you would atleast know what you'd end up with. They must've generated the code automatically or something, because it just seems incredible that someone clever enough to implement a scripting language wouldn't see the faults of such an implementation.

So... you will have to save a scene copy and parse the scene file to get the value. By saving a scene copy you will not alter the save state flag or what scene Save/Save As is pointing to. So it can be done transparently, without the user knowing.

04-01-2009, 09:17 PM
I had a search in the sdk docs aswell. They have added alot more getters for render options in the 9.5 version of lscript, but unfortunately I couldn't find the same vigorous work applied to the camera object agent.

Also like to thank you for making me browse the release notes, because I found an answer to a recent issue I was having when browsing them! I would never had found it otherwise! (plugins worked on some systems, but not others)

04-02-2009, 11:43 AM
Thank you for the reply and for confirming the issue. It's frustrating, but at least I won't spend more time looking for something that can't be found.