diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-10-12 17:12:45 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-10-12 17:12:45 +0400 |
commit | f1a0df22df7b929601db58db5ecb77ed82bf8361 (patch) | |
tree | 106260cd3e3753debf685a0434078a3a3f1cf238 /source/blender/makesrna/intern/rna_world.c | |
parent | e36003e8e73e42e7b559d4cec19b9004d14fefa6 (diff) |
Bugfix: texture nodes header was still showing wrong texture
when using node materials.
Diffstat (limited to 'source/blender/makesrna/intern/rna_world.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_world.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c index b2ed90eef03..c0c9c1d6568 100644 --- a/source/blender/makesrna/intern/rna_world.c +++ b/source/blender/makesrna/intern/rna_world.c @@ -71,31 +71,15 @@ static PointerRNA rna_World_active_texture_get(PointerRNA *ptr) World *wo= (World*)ptr->data; Tex *tex; - tex= (wo->mtex[(int)wo->texact])? wo->mtex[(int)wo->texact]->tex: NULL; + tex= give_current_world_texture(wo); return rna_pointer_inherit_refine(ptr, &RNA_Texture, tex); } static void rna_World_active_texture_set(PointerRNA *ptr, PointerRNA value) { World *wo= (World*)ptr->data; - int act= wo->texact; - - if(wo->mtex[act] && wo->mtex[act]->tex) - id_us_min(&wo->mtex[act]->tex->id); - - if(value.data) { - if(!wo->mtex[act]) { - wo->mtex[act]= add_mtex(); - wo->mtex[act]->texco= TEXCO_VIEW; - } - - wo->mtex[act]->tex= value.data; - id_us_plus(&wo->mtex[act]->tex->id); - } - else if(wo->mtex[act]) { - MEM_freeN(wo->mtex[act]); - wo->mtex[act]= NULL; - } + + set_current_world_texture(wo, value.data); } static void rna_World_update(bContext *C, PointerRNA *ptr) |