Exemple #1
0
static void rna_def_sun_lamp(BlenderRNA *brna)
{
	StructRNA *srna;
	PropertyRNA *prop;

	srna = RNA_def_struct(brna, "SunLamp", "Lamp");
	RNA_def_struct_sdna(srna, "Lamp");
	RNA_def_struct_ui_text(srna, "Sun Lamp", "Constant direction parallel ray lamp");
	RNA_def_struct_ui_icon(srna, ICON_LAMP_SUN);

	rna_def_lamp_shadow(srna, 0, 0);

	/* sky */
	prop = RNA_def_property(srna, "sky", PROP_POINTER, PROP_NONE);
	RNA_def_property_flag(prop, PROP_NEVER_NULL);
	RNA_def_property_struct_type(prop, "LampSkySettings");
	RNA_def_property_pointer_funcs(prop, "rna_Lamp_sky_settings_get", NULL, NULL, NULL);
	RNA_def_property_ui_text(prop, "Sky Settings", "Sky related settings for sun lamps");

	rna_def_lamp_sky_settings(brna);

	/* BGE Only */
	prop = RNA_def_property(srna, "shadow_frustum_size", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "shadow_frustum_size");
	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");
}
Exemple #2
0
static void rna_def_sun_lamp(BlenderRNA *brna)
{
	StructRNA *srna;
	PropertyRNA *prop;

	srna = RNA_def_struct(brna, "SunLamp", "Lamp");
	RNA_def_struct_sdna(srna, "Lamp");
	RNA_def_struct_ui_text(srna, "Sun Lamp", "Constant direction parallel ray lamp");
	RNA_def_struct_ui_icon(srna, ICON_LAMP_SUN);

	rna_def_lamp_shadow(srna, 0, 0);

	/* sky */
	prop = RNA_def_property(srna, "sky", PROP_POINTER, PROP_NONE);
	RNA_def_property_flag(prop, PROP_NEVER_NULL);
	RNA_def_property_struct_type(prop, "LampSkySettings");
	RNA_def_property_pointer_funcs(prop, "rna_Lamp_sky_settings_get", NULL, NULL, NULL);
	RNA_def_property_ui_text(prop, "Sky Settings", "Sky related settings for sun lamps");

	rna_def_lamp_sky_settings(brna);

	/* BGE Only */
	prop= RNA_def_property(srna, "shadow_frustum_size", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "shadow_frustum_size");
	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");
}