Do you have a light in the scene? Materials describe how light behaves when it hits the surface of an object; if you don’t have a light applied, the material won’t take effect.
D’oh! no i haven’t any lights.
I baked my textures on blender already and my scene looks pretty enlightened, so i though like default camera there would be a default light on Panda.
I’ll try that with lights.
By the way i have an issue on transparent materials loaded from blender. they are transparent but they have a thin white line around them like: or
This is a classic alpha blending issue. You have to tell Panda which transparency mode to use. You can use setTransparency(MAlpha) for simple transparency, MBinary for perfect transparency without semitransparency, MDual for a smarter version of MAlpha, or MMultisample for alpha-to-coverage transparency.
This is equivalent to switching to the “Blender Game” mode at the top bar in Blender, going to your material settings, and changing “Alpha Blend” under “Game Settings”.
I’ve added a point light beside the ambient light but still there is no visible highlight?!
For transparency, where i should use set_transparency() method?
I’ve tried on self.render.set_transparency() and self.model.set_transparency()(which is my loaded scene from blender) with MAlpha or MDual, but there is no change. so should it be set on every object in the scene separately?
I’m guessing there is already a transparency attribute set in the .egg file; to override it, add an override number as second argument to setPriority, ie. setTransparency(MDual, 1). Or just edit the .egg file to change the setting, or change it in Blender.
But after i set material this way the picked.get_material() returns previously set mat while before it returned None.
Anyway is there any sample of modifying material on loaded external model? maybe there is something wrong with my egg file.