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:
Diffstat (limited to 'source/blender/makesrna/intern/rna_lamp.c')
-rw-r--r--source/blender/makesrna/intern/rna_lamp.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c
index 81c26af189d..6140a34b271 100644
--- a/source/blender/makesrna/intern/rna_lamp.c
+++ b/source/blender/makesrna/intern/rna_lamp.c
@@ -94,7 +94,7 @@ static int rna_use_shadow_get(PointerRNA *ptr)
Lamp *la = (Lamp *)ptr->data;
if (la->type == LA_SPOT) {
- return (la->mode & LA_SHAD_BUF) != 0;
+ return (la->mode & (LA_SHAD_BUF | LA_SHAD_RAY)) != 0;
}
else {
return (la->mode & LA_SHAD_RAY) != 0;
@@ -104,14 +104,10 @@ static int rna_use_shadow_get(PointerRNA *ptr)
static void rna_use_shadow_set(PointerRNA *ptr, int value)
{
Lamp *la = (Lamp *)ptr->data;
+ la->mode &= ~(LA_SHAD_BUF | LA_SHAD_RAY);
if (value) {
- if (la->type == LA_SPOT)
- la->mode |= LA_SHAD_BUF;
- else
- la->mode |= LA_SHAD_RAY;
+ la->mode |= LA_SHAD_RAY;
}
- else
- la->mode &= ~(LA_SHAD_BUF | LA_SHAD_RAY);
}
static StructRNA *rna_Lamp_refine(struct PointerRNA *ptr)
@@ -829,6 +825,12 @@ static void rna_def_sun_lamp(BlenderRNA *brna)
RNA_def_property_ui_range(prop, 0.001, 100.0, 2, 1);
RNA_def_property_ui_text(prop, "Frustum Size", "Size of the frustum used for creating the shadow map");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
+
+ prop = RNA_def_property(srna, "show_shadow_box", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SHOW_SHADOW_BOX);
+ RNA_def_property_ui_text(prop, "Show Shadow Box",
+ "Draw a box in 3D view to visualize which objects are contained in it");
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
}
static void rna_def_hemi_lamp(BlenderRNA *brna)