Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2010-02-13 16:49:27 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2010-02-13 16:49:27 +0300
commitd125f17db82ef8c6bbf069c780abf0f0b8b88968 (patch)
treeb3686b1ccd1efb3f0807e62e808be9927fcf9d10 /source/blender/makesrna/intern/rna_lamp.c
parent39c3ebdc910100a3194f62ac52af4e15a9422264 (diff)
Fix #19736: GLSL viewport materials are not updated on all changes.
Diffstat (limited to 'source/blender/makesrna/intern/rna_lamp.c')
-rw-r--r--source/blender/makesrna/intern/rna_lamp.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c
index 8a06b586802..f6197a8da15 100644
--- a/source/blender/makesrna/intern/rna_lamp.c
+++ b/source/blender/makesrna/intern/rna_lamp.c
@@ -107,7 +107,10 @@ static void rna_Lamp_update(Main *bmain, Scene *scene, PointerRNA *ptr)
Lamp *la= ptr->id.data;
DAG_id_flush_update(&la->id, 0);
- WM_main_add_notifier(NC_LAMP|ND_LIGHTING, la);
+ if(scene->gm.matmode == GAME_MAT_GLSL)
+ WM_main_add_notifier(NC_LAMP|ND_LIGHTING_DRAW, la);
+ else
+ WM_main_add_notifier(NC_LAMP|ND_LIGHTING, la);
}
static void rna_Lamp_draw_update(Main *bmain, Scene *scene, PointerRNA *ptr)
@@ -350,13 +353,13 @@ static void rna_def_lamp(BlenderRNA *brna)
prop= RNA_def_property(srna, "energy", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_range(prop, 0, 10.0, 10, 2);
RNA_def_property_ui_text(prop, "Energy", "Amount of light that the lamp emits");
- RNA_def_property_update(prop, 0, "rna_Lamp_update");
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Color", "Light color");
- RNA_def_property_update(prop, 0, "rna_Lamp_update");
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_LAYER);
@@ -417,13 +420,13 @@ static void rna_def_lamp_falloff(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "att1");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Linear Attenuation", "Linear distance attentuation");
- RNA_def_property_update(prop, 0, "rna_Lamp_update");
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "quadratic_attenuation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "att2");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Quadratic Attenuation", "Quadratic distance attentuation");
- RNA_def_property_update(prop, 0, "rna_Lamp_update");
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
}
static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area)