ZBrushCentral

Scripting lights

Couple of questions about scripting lights:

I take it that the “Light Placement” variables are azimuthal angle (θ), and polar angle (φ)?
How can you determine if a light is on or not - in order to switch it off or on as needed?
I’m not sure of the correct syntax and can’t seem to find it in the docs - light enabled? light = true?
Are there 32 lights or just 8?

//get the number of lights [VarSet,numLights,[IGetMax, Light:Light Cap:LightIndex]] [NoteBar, numLights] // 32 lights

As recording a macro just comes up with “Light Switch” pressed/unpressed which doesn’t help?

Cheers

The Lights at the top of the Light palette are different from the LightCap lights. There are only 8 lights at the top, and presumably (as you discovered) a max of 32 for LightCap. For the Lights at the top you can find out if they are on or off by examining their state using their numerical ID.** These start at 1556 and go through to 1563, so try [IGet,1556] and see what you get… You’d then need to simulate a click on the light (using [IClick]) to turn it on or off.

(**You can get the ID for any interface items by examining the Preferences>Utilities>View Window Id slider, though many of the IDs for the Tool palette are not useful!)

For LightCap lights I presume you can access them by setting the slider but I’ve not experimented much with LightCaps so can’t suggest anything more! :slight_smile: