static void rna_def_point_lamp(BlenderRNA *brna) { StructRNA *srna; srna = RNA_def_struct(brna, "PointLamp", "Lamp"); RNA_def_struct_sdna(srna, "Lamp"); RNA_def_struct_ui_text(srna, "Point Lamp", "Omnidirectional point lamp"); RNA_def_struct_ui_icon(srna, ICON_LAMP_POINT); rna_def_lamp_falloff(srna); rna_def_lamp_shadow(srna, 0, 0); }
static void rna_def_spot_lamp(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "SpotLamp", "Lamp"); RNA_def_struct_sdna(srna, "Lamp"); RNA_def_struct_ui_text(srna, "Spot Lamp", "Directional cone lamp"); RNA_def_struct_ui_icon(srna, ICON_LAMP_SPOT); rna_def_lamp_falloff(srna); rna_def_lamp_shadow(srna, 1, 0); prop = RNA_def_property(srna, "use_square", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SQUARE); RNA_def_property_ui_text(prop, "Square", "Cast a square spot light shape"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); prop = RNA_def_property(srna, "use_halo", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_HALO); RNA_def_property_ui_text(prop, "Halo", "Render spotlight with a volumetric halo"); RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop = RNA_def_property(srna, "halo_intensity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "haint"); RNA_def_property_ui_range(prop, 0, 5.0, 0.1, 3); RNA_def_property_ui_text(prop, "Halo Intensity", "Brightness of the spotlight's halo cone"); RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop = RNA_def_property(srna, "halo_step", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "shadhalostep"); RNA_def_property_range(prop, 0, 12); RNA_def_property_ui_text(prop, "Halo Step", "Volumetric halo sampling frequency"); RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop = RNA_def_property(srna, "spot_blend", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "spotblend"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Spot Blend", "The softness of the spotlight edge"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); prop = RNA_def_property(srna, "spot_size", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "spotsize"); RNA_def_property_range(prop, DEG2RADF(1.0f), DEG2RADF(180.0f)); RNA_def_property_ui_text(prop, "Spot Size", "Angle of the spotlight beam"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); prop = RNA_def_property(srna, "show_cone", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SHOW_CONE); RNA_def_property_ui_text(prop, "Show Cone", "Draw transparent cone 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_spot_lamp(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem prop_shadbuffiltertype_items[] = { {LA_SHADBUF_BOX, "BOX", 0, "Box", "Apply the Box filter to shadow buffer samples"}, {LA_SHADBUF_TENT, "TENT", 0, "Tent", "Apply the Tent Filter to shadow buffer samples"}, {LA_SHADBUF_GAUSS, "GAUSS", 0, "Gauss", "Apply the Gauss filter to shadow buffer samples"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_numbuffer_items[] = { {1, "BUFFERS_1", 0, "1", "Only one buffer rendered"}, {4, "BUFFERS_4", 0, "4", "Render 4 buffers for better AA, this quadruples memory usage"}, {9, "BUFFERS_9", 0, "9", "Render 9 buffers for better AA, this uses nine times more memory"}, {0, NULL, 0, NULL, NULL}}; srna = RNA_def_struct(brna, "SpotLamp", "Lamp"); RNA_def_struct_sdna(srna, "Lamp"); RNA_def_struct_ui_text(srna, "Spot Lamp", "Directional cone lamp"); RNA_def_struct_ui_icon(srna, ICON_LAMP_SPOT); rna_def_lamp_falloff(srna); rna_def_lamp_shadow(srna, 1, 0); prop = RNA_def_property(srna, "use_square", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SQUARE); RNA_def_property_ui_text(prop, "Square", "Cast a square spot light shape"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); prop = RNA_def_property(srna, "use_halo", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_HALO); RNA_def_property_ui_text(prop, "Halo", "Render spotlight with a volumetric halo"); RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop = RNA_def_property(srna, "halo_intensity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "haint"); RNA_def_property_ui_range(prop, 0, 5.0, 0.1, 3); RNA_def_property_ui_text(prop, "Halo Intensity", "Brightness of the spotlight's halo cone"); RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop = RNA_def_property(srna, "halo_step", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "shadhalostep"); RNA_def_property_range(prop, 0, 12); RNA_def_property_ui_text(prop, "Halo Step", "Volumetric halo sampling frequency"); RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop = RNA_def_property(srna, "spot_blend", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "spotblend"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Spot Blend", "The softness of the spotlight edge"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); prop = RNA_def_property(srna, "spot_size", PROP_FLOAT, PROP_ANGLE); /* RNA_def_property_float_sdna(prop, NULL, "spotsize"); */ RNA_def_property_range(prop, M_PI/180.0, M_PI); RNA_def_property_ui_text(prop, "Spot Size", "Angle of the spotlight beam"); /* only for deg/rad conversion */ RNA_def_property_float_funcs(prop, "rna_Lamp_spot_size_get", "rna_Lamp_spot_size_set", NULL); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); prop = RNA_def_property(srna, "show_cone", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SHOW_CONE); RNA_def_property_ui_text(prop, "Show Cone", "Draw transparent cone in 3D view to visualize which objects are contained in it"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); }