Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_world.c
| Show First 20 Lines • Show All 397 Lines • ▼ Show 20 Lines | static void rna_def_world_mist(BlenderRNA *brna) | ||||
| srna = RNA_def_struct(brna, "WorldMistSettings", NULL); | srna = RNA_def_struct(brna, "WorldMistSettings", NULL); | ||||
| RNA_def_struct_sdna(srna, "World"); | RNA_def_struct_sdna(srna, "World"); | ||||
| RNA_def_struct_nested(brna, srna, "World"); | RNA_def_struct_nested(brna, srna, "World"); | ||||
| RNA_def_struct_ui_text(srna, "World Mist", "Mist settings for a World data-block"); | RNA_def_struct_ui_text(srna, "World Mist", "Mist settings for a World data-block"); | ||||
| prop = RNA_def_property(srna, "use_mist", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_mist", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_MIST); | RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_MIST); | ||||
| RNA_def_property_ui_text(prop, "Use Mist", "Occlude objects with the environment color as they are further away"); | RNA_def_property_ui_text(prop, "Use Mist", "Occlude objects with the environment color as they are further away"); | ||||
| RNA_def_property_update(prop, 0, "rna_World_draw_update"); | RNA_def_property_update(prop, 0, "rna_World_draw_mist_update"); | ||||
| prop = RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE); | prop = RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE); | ||||
| RNA_def_property_float_sdna(prop, NULL, "misi"); | RNA_def_property_float_sdna(prop, NULL, "misi"); | ||||
| RNA_def_property_range(prop, 0, 1); | RNA_def_property_range(prop, 0, 1); | ||||
| RNA_def_property_ui_text(prop, "Minimum", "Overall minimum intensity of the mist effect"); | RNA_def_property_ui_text(prop, "Minimum", "Overall minimum intensity of the mist effect"); | ||||
| RNA_def_property_update(prop, 0, "rna_World_update"); | RNA_def_property_update(prop, 0, "rna_World_draw_mist_update"); | ||||
| prop = RNA_def_property(srna, "start", PROP_FLOAT, PROP_DISTANCE); | prop = RNA_def_property(srna, "start", PROP_FLOAT, PROP_DISTANCE); | ||||
| RNA_def_property_float_sdna(prop, NULL, "miststa"); | RNA_def_property_float_sdna(prop, NULL, "miststa"); | ||||
| RNA_def_property_range(prop, 0, FLT_MAX); | RNA_def_property_range(prop, 0, FLT_MAX); | ||||
| RNA_def_property_ui_range(prop, 0, 10000, 10, 2); | RNA_def_property_ui_range(prop, 0, 10000, 10, 2); | ||||
| RNA_def_property_ui_text(prop, "Start", "Starting distance of the mist, measured from the camera"); | RNA_def_property_ui_text(prop, "Start", "Starting distance of the mist, measured from the camera"); | ||||
| RNA_def_property_update(prop, 0, "rna_World_draw_mist_update"); | RNA_def_property_update(prop, 0, "rna_World_draw_mist_update"); | ||||
| Show All 9 Lines | static void rna_def_world_mist(BlenderRNA *brna) | ||||
| RNA_def_property_range(prop, 0, 100); | RNA_def_property_range(prop, 0, 100); | ||||
| RNA_def_property_ui_text(prop, "Height", "Control how much mist density decreases with height"); | RNA_def_property_ui_text(prop, "Height", "Control how much mist density decreases with height"); | ||||
| RNA_def_property_update(prop, 0, "rna_World_update"); | RNA_def_property_update(prop, 0, "rna_World_update"); | ||||
| prop = RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "mistype"); | RNA_def_property_enum_sdna(prop, NULL, "mistype"); | ||||
| RNA_def_property_enum_items(prop, falloff_items); | RNA_def_property_enum_items(prop, falloff_items); | ||||
| RNA_def_property_ui_text(prop, "Falloff", "Type of transition used to fade mist"); | RNA_def_property_ui_text(prop, "Falloff", "Type of transition used to fade mist"); | ||||
| RNA_def_property_update(prop, 0, "rna_World_update"); | RNA_def_property_update(prop, 0, "rna_World_draw_mist_update"); | ||||
| } | } | ||||
| void RNA_def_world(BlenderRNA *brna) | void RNA_def_world(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| srna = RNA_def_struct(brna, "World", "ID"); | srna = RNA_def_struct(brna, "World", "ID"); | ||||
| RNA_def_struct_ui_text(srna, "World", | RNA_def_struct_ui_text(srna, "World", | ||||
| "World datablock describing the environment and ambient lighting of a scene"); | "World datablock describing the environment and ambient lighting of a scene"); | ||||
| RNA_def_struct_ui_icon(srna, ICON_WORLD_DATA); | RNA_def_struct_ui_icon(srna, ICON_WORLD_DATA); | ||||
| rna_def_animdata_common(srna); | rna_def_animdata_common(srna); | ||||
| rna_def_mtex_common(brna, srna, "rna_World_mtex_begin", "rna_World_active_texture_get", | rna_def_mtex_common(brna, srna, "rna_World_mtex_begin", "rna_World_active_texture_get", | ||||
| "rna_World_active_texture_set", NULL, "WorldTextureSlot", "WorldTextureSlots", | "rna_World_active_texture_set", NULL, "WorldTextureSlot", "WorldTextureSlots", | ||||
| "rna_World_update", "rna_World_update"); | "rna_World_update", "rna_World_update"); | ||||
| /* colors */ | /* colors */ | ||||
| prop = RNA_def_property(srna, "horizon_color", PROP_FLOAT, PROP_COLOR); | prop = RNA_def_property(srna, "horizon_color", PROP_FLOAT, PROP_COLOR); | ||||
| RNA_def_property_float_sdna(prop, NULL, "horr"); | RNA_def_property_float_sdna(prop, NULL, "horr"); | ||||
| RNA_def_property_array(prop, 3); | RNA_def_property_array(prop, 3); | ||||
| RNA_def_property_ui_text(prop, "Horizon Color", "Color at the horizon"); | RNA_def_property_ui_text(prop, "Horizon Color", "Color at the horizon"); | ||||
| /* RNA_def_property_update(prop, 0, "rna_World_update"); */ | /* RNA_def_property_update(prop, 0, "rna_World_update"); */ | ||||
| /* render-only uses this */ | /* render-only uses this */ | ||||
| RNA_def_property_update(prop, NC_WORLD | ND_WORLD_DRAW, "rna_World_update"); | RNA_def_property_update(prop, 0, "rna_World_draw_mist_update"); | ||||
| prop = RNA_def_property(srna, "zenith_color", PROP_FLOAT, PROP_COLOR); | prop = RNA_def_property(srna, "zenith_color", PROP_FLOAT, PROP_COLOR); | ||||
| RNA_def_property_float_sdna(prop, NULL, "zenr"); | RNA_def_property_float_sdna(prop, NULL, "zenr"); | ||||
| RNA_def_property_array(prop, 3); | RNA_def_property_array(prop, 3); | ||||
| RNA_def_property_ui_text(prop, "Zenith Color", "Color at the zenith"); | RNA_def_property_ui_text(prop, "Zenith Color", "Color at the zenith"); | ||||
| RNA_def_property_update(prop, NC_WORLD | ND_WORLD_DRAW, "rna_World_update"); | RNA_def_property_update(prop, NC_WORLD | ND_WORLD_DRAW, "rna_World_update"); | ||||
| prop = RNA_def_property(srna, "ambient_color", PROP_FLOAT, PROP_COLOR); | prop = RNA_def_property(srna, "ambient_color", PROP_FLOAT, PROP_COLOR); | ||||
| RNA_def_property_float_sdna(prop, NULL, "ambr"); | RNA_def_property_float_sdna(prop, NULL, "ambr"); | ||||
| RNA_def_property_array(prop, 3); | RNA_def_property_array(prop, 3); | ||||
| RNA_def_property_ui_text(prop, "Ambient Color", "Ambient color of the world"); | RNA_def_property_ui_text(prop, "Ambient Color", "Ambient color of the world"); | ||||
| RNA_def_property_update(prop, 0, "rna_World_update"); | RNA_def_property_update(prop, 0, "rna_World_draw_mist_update"); | ||||
| /* exp, range */ | /* exp, range */ | ||||
| prop = RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE); | prop = RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE); | ||||
| RNA_def_property_float_sdna(prop, NULL, "exp"); | RNA_def_property_float_sdna(prop, NULL, "exp"); | ||||
| RNA_def_property_range(prop, 0.0, 1.0); | RNA_def_property_range(prop, 0.0, 1.0); | ||||
| RNA_def_property_ui_text(prop, "Exposure", "Amount of exponential color correction for light"); | RNA_def_property_ui_text(prop, "Exposure", "Amount of exponential color correction for light"); | ||||
| RNA_def_property_update(prop, 0, "rna_World_update"); | RNA_def_property_update(prop, 0, "rna_World_update"); | ||||
| ▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines | |||||