diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_world.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_world.c | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c index 22570460093..d421aff7157 100644 --- a/source/blender/makesrna/intern/rna_world.c +++ b/source/blender/makesrna/intern/rna_world.c @@ -46,6 +46,8 @@ #include "BKE_main.h" #include "BKE_texture.h" +#include "ED_node.h" + #include "WM_api.h" static PointerRNA rna_World_lighting_get(PointerRNA *ptr) @@ -119,6 +121,15 @@ static void rna_World_stars_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Po WM_main_add_notifier(NC_WORLD|ND_WORLD_STARS, wo); } +static void rna_World_use_nodes_update(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + World *wrld= (World*)ptr->data; + + if(wrld->use_nodes && wrld->nodetree==NULL) + ED_node_shader_default(scene, &wrld->id); + + rna_World_update(bmain, scene, ptr); +} #else @@ -161,11 +172,6 @@ static void rna_def_world_mtex(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Zenith Down", "Affect the color of the zenith below"); RNA_def_property_update(prop, 0, "rna_World_update"); - /* unused - prop= RNA_def_property(srna, "map_mist", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_MIST); - RNA_def_property_ui_text(prop, "Mist", "Causes the texture to affect the intensity of the mist");*/ - prop= RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "texco"); RNA_def_property_enum_items(prop, texco_items); @@ -393,7 +399,7 @@ static void rna_def_world_mist(BlenderRNA *brna) prop= RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "misi"); RNA_def_property_range(prop, 0, 1); - RNA_def_property_ui_text(prop, "Intensity", "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"); prop= RNA_def_property(srna, "start", PROP_FLOAT, PROP_DISTANCE); @@ -461,13 +467,6 @@ static void rna_def_world_stars(BlenderRNA *brna) RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_text(prop, "Color Randomization", "Randomize star colors"); RNA_def_property_update(prop, 0, "rna_World_stars_update"); - - /* unused - prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); - RNA_def_property_float_sdna(prop, NULL, "starr"); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Color", "Stars color"); - RNA_def_property_update(prop, 0, "rna_World_update");*/ } void RNA_def_world(BlenderRNA *brna) @@ -564,6 +563,17 @@ void RNA_def_world(BlenderRNA *brna) RNA_def_property_pointer_funcs(prop, "rna_World_stars_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Stars", "World stars settings"); + /* nodes */ + prop= RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "nodetree"); + RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node based worlds"); + + prop= RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_text(prop, "Use Nodes", "Use shader nodes to render the world"); + RNA_def_property_update(prop, 0, "rna_World_use_nodes_update"); + rna_def_lighting(brna); rna_def_world_mist(brna); rna_def_world_stars(brna); |