Lighting changes setColor()

i’ve been using setColor for some of my models because i do not know how to texture them in blender. Whenever I use any of the lighting, specifically directional or point lighting, my colors become completely changed. I don’t modify any of the lights’ colors or temperatures. For example, my floor goes from green to red. Is there any fix for this?

Do your models perhaps have materials attached?

If I recall correctly, materials don’t show up without lights–and thus wouldn’t be apparent until a light was applied. However, when a light is applied, the material might show through instead of the assigned colour, resulting in the effect that you’re seeing.

I honestly don’t know, I know one of my models don’t have any materials attached to it since it was a simple model that I created as a floor in blender with no textures or anything else. For some of my models it does work so I think I will just only apply light to the models it does work with instead of the whole scene.

If that works for you, then fair enough.

However, I do fear that you might find yourself with an object that you want to have be lit, and that shows this problem. As a result, I do feel that it might be worth figuring this out, so that you can fix it and go forward with your models working as you intend.

1 Like

I understand that you can’t apply textures, and want to use colors. I am glad that you found a solution, though it will be complicated if you want multiple colors on an object. For that you need textures. If you can’t figure it out in blender, just use setTexture. You can also use textures with one color (e.g. red) (Though it takes more memory). And set the texture. You can do so if you have problems with setColor. Yet still, if different parts of the model have different textures you will need blender or you can use a complicated NodePath search in the model or make separate models and set textures individually, reparenting them to a common node. If this sounds to complicated, I will make a texturing tutorial.

1 Like

I think I should be good, all of my models are really basic and the ones that I needed textures for work well with the setTexture() method. Thank you!

1 Like