diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2007-01-06 02:49:51 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2007-01-06 02:49:51 +0300 |
commit | 130f135d2a3714f07c305affed111c50461cf957 (patch) | |
tree | efd9ed73e2d2177a0fb84ee3299cb7e812ad1aa1 /source/blender/blenloader | |
parent | 0306a86d941a4ffcc358148b469add1d14f8dc84 (diff) |
Fix for bug #5096:
Geometry shader node storage (added for UV name) wasn't allocated reading
older files, could crash on render.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 69c8a504367..8343f8db9ad 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4322,6 +4322,11 @@ static void do_version_ntree_242_2(bNodeTree *ntree) } } } + else if(ntree->type==NTREE_SHADER) { + for(node= ntree->nodes.first; node; node= node->next) + if(node->type == SH_NODE_GEOMETRY && node->storage == NULL) + node->storage= MEM_callocN(sizeof(NodeGeometry), "NodeGeometry"); + } } static void do_versions(FileData *fd, Library *lib, Main *main) @@ -6322,6 +6327,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } for(ntree= main->nodetree.first; ntree; ntree= ntree->id.next) do_version_ntree_242_2(ntree); + for(ma = main->mat.first; ma; ma= ma->id.next) + if(ma->nodetree) + do_version_ntree_242_2(ma->nodetree); for(sc= main->screen.first; sc; sc= sc->id.next) { ScrArea *sa; |