diff options
author | Roland Hess <me@harkyman.com> | 2008-08-01 16:56:29 +0400 |
---|---|---|
committer | Roland Hess <me@harkyman.com> | 2008-08-01 16:56:29 +0400 |
commit | 115dfb22ccd267f22b9980652acbf479c8b3ac5a (patch) | |
tree | bf96ae2dfba1d6eebd237eaaa0fd329c8f8bd290 /source/blender/blenkernel | |
parent | cb0aa467cd7acb1392897bf436d808de5b40e552 (diff) |
Ipo Editor would not allow access to either World or Lamp texture Ipos. Now it does. Fixes bug #17379.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_texture.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/texture.c | 15 |
2 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_texture.h b/source/blender/blenkernel/BKE_texture.h index 78a8f60caeb..fade0f8cbaa 100644 --- a/source/blender/blenkernel/BKE_texture.h +++ b/source/blender/blenkernel/BKE_texture.h @@ -62,6 +62,7 @@ struct Tex *copy_texture(struct Tex *tex); void make_local_texture(struct Tex *tex); void autotexname(struct Tex *tex); struct Tex *give_current_texture(struct Object *ob, int act); +struct Tex *give_current_world_texture(void); struct TexMapping *add_mapping(void); void init_mapping(struct TexMapping *texmap); diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 37804bf68ac..ad139220785 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -53,6 +53,7 @@ #include "DNA_world_types.h" #include "DNA_brush_types.h" #include "DNA_node_types.h" +#include "DNA_scene_types.h" #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" @@ -731,7 +732,7 @@ Tex *give_current_texture(Object *ob, int act) bNode *node; if(ob==0) return 0; - if(ob->totcol==0) return 0; + if(ob->totcol==0 && !(ob->type==OB_LAMP)) return 0; if(ob->type==OB_LAMP) { la=(Lamp *)ob->data; @@ -775,6 +776,18 @@ Tex *give_current_texture(Object *ob, int act) return tex; } +Tex *give_current_world_texture(void) +{ + MTex *mtex = 0; + Tex *tex = 0; + + if(!(G.scene->world)) return 0; + + mtex= G.scene->world->mtex[(int)(G.scene->world->texact)]; + if(mtex) tex= mtex->tex; + + return tex; +} /* ------------------------------------------------------------------------- */ |