Majik Primer: MoI's Lighting Options and You!

 From:  Michael Gibson
5222.9 In reply to 5222.8 
Hi Burr,

> Michael, is there a script option that can be tucked into those scripts Mike just made
> that would have them "toggle"... So a return to default?

Yup, that's possible, here's a script that will do that:

script: /* Toggle lighting options */ var settings = { lightingStyle: 'Default', specularHighlights: true, specularBrightness: 0.5, specularFocusSize: 0.5, metallicLighting: true, fixedLightPositions: false }; for ( var propname in settings ) { var val = ''; try { val = moi.command.getOption( 'ls_' + propname ); } catch(e) {} if ( val !== '' ) { moi.view[propname] = val; val = ''; } else { val = moi.view[propname]; moi.view[propname] = settings[propname]; } moi.command.setOption( 'ls_' + propname, val ); }


The settings come from the chunk that says: var settings = { lightingStyle: 'Default', specularHighlights: true, ... } To make a new batch of settings change just the value to the right of the : like if you want it to have no specular highlights make that part say specularHighlights: false

This will only toggle things within the same program session - don't exit MoI with it set to the alternate state or else that will get saved as your new default at exit time and so you won't be able to toggle it back to the old default when you launch next time.

- Michael