is it possible to disable light shadows via python?

is it possible to disable light shadows via python? Or… if they have a energy value of 0 is it automatic?
I found one setting via the glsl shader settings, but could not get it to work…because I’m a big dummy :slight_smile:

The easiest way is to have two separate lamps, one without shadow and the other with “only shadow” checked, you can then turn off the shadow_lamp.energy with python when you don’t need the shadow

Alternatively you can check light’s shadow property “this layer only”, isolated layer will illuminate only the object in that layer, then in python you can move the light.layer around when you want to disable the shadow for certain object

I am already adjusting the energy…and I think more objects in a scene is probably not a good practice to get into…when you can do the same thing with one object.

so to be clear I did see this yesterday before posting, but I am a little confused on how to use it…and I assume it affects the entire scene…

bge.render.setGLSLMaterialSetting(setting, enable)# like setting (shadow,False)

I assumed
scene.bge.render.setGLSLMaterialSetting(shadow, False)

is this correct?

if its

“bge.render.setGLSLMaterialSetting(setting, enable)”

then its probably not a scene attribute, so not scene.bge…

You may want to look at how to read the API

Have a look in the console to find what errors are happening - python is quite good at telling you what is going wrong.

Hint: if it starts with “bge.logic” or “bge.render” then you can import bge, and just run the command.

@leralass: that is an example…if it were scene, I imagine it would disable all shadows. This was my mistake for just typing it without thinking about what I was typing…you were in the right mindset to correct me.

@sdfgeof: I do not get an error…I have been working on other things today, but I will look again at this later. I assumed I cold run the method/function because of that exact reasoning…it is part of bge…like If I wrote a script called…‘superscript’ with built in functions…
I could call superscript.function() as long as I included it :slight_smile: but we both know this :slight_smile: I admit I have coding experience, but I am also an idiot :slight_smile:

I have also already seen your post :slight_smile: I still find the api difficult to navigate…in most cases I want some specific function or command…but until you know the api…you cannot type a search for it. It just takes time…I’m getting familiar with it…I have a harder time with python in general…I make a lot of ‘c’ mistakes still…hell, I even throw in a semicolon from time to time…my finger just loves to hit that button on the keyboard…habbits.