diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-07 21:35:20 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-07 21:35:20 +0400 |
commit | f3407e7d60d8000d71c66192d760bd5700345b21 (patch) | |
tree | 99930ebf3b63d48bff2def3d30d543acacd6f1b1 /source/blender/blenloader/intern/readfile.c | |
parent | 448731834839bbddee02558080dd9a5e586f6f21 (diff) |
Textures/Shaders: extend TexMapping to include projection options, and add a
ColorMapping struct for color manipulation of textures. These will be the
standard built-in texture node options for manipulating the incoming texture
coordinate and outgoing color.
Diffstat (limited to 'source/blender/blenloader/intern/readfile.c')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index ba1d333f44f..96fbe392922 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5991,7 +5991,7 @@ static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, int flag, ID if(id->flag & LIB_FAKEUSER) id->us= 1; else id->us= 0; id->icon_id = 0; - id->flag &= ~LIB_ID_RECALC; + id->flag &= ~(LIB_ID_RECALC|LIB_ID_RECALC_DATA); /* this case cannot be direct_linked: it's just the ID part */ if(bhead->code==ID_ID) { @@ -7235,6 +7235,22 @@ static void do_versions_nodetree_image_default_alpha_output(bNodeTree *ntree) } } +static void do_version_ntree_tex_mapping_260(void *UNUSED(data), ID *UNUSED(id), bNodeTree *ntree) +{ + bNode *node; + + for(node=ntree->nodes.first; node; node=node->next) { + if(node->type == SH_NODE_MAPPING) { + TexMapping *tex_mapping; + + tex_mapping= node->storage; + tex_mapping->projx= PROJ_X; + tex_mapping->projy= PROJ_Y; + tex_mapping->projz= PROJ_Z; + } + } +} + static void do_versions(FileData *fd, Library *lib, Main *main) { /* WATCH IT!!!: pointers from libdata have not been converted */ @@ -12320,6 +12336,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } + if (main->versionfile < 260 || (main->versionfile == 260 && main->subversionfile < 2)) { + bNodeTreeType *ntreetype= ntreeGetType(NTREE_SHADER); + + if(ntreetype && ntreetype->foreach_nodetree) + ntreetype->foreach_nodetree(main, NULL, do_version_ntree_tex_mapping_260); + } + /* put compatibility code here until next subversion bump */ { { |