Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenloader/intern/readfile.c')
-rw-r--r--source/blender/blenloader/intern/readfile.c39
1 files changed, 29 insertions, 10 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index acedf51e619..423d050c862 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -1524,6 +1524,7 @@ static void lib_verify_nodetree(Main *main, int open)
{
Scene *sce;
Material *ma;
+ Tex *tx;
bNodeTree *ntree;
/* this crashes blender on undo/redo
@@ -1548,6 +1549,11 @@ static void lib_verify_nodetree(Main *main, int open)
if(sce->nodetree)
ntreeVerifyTypes(sce->nodetree);
}
+ /* and texture trees */
+ for(tx= main->tex.first; tx; tx= tx->id.next) {
+ if(tx->nodetree)
+ ntreeVerifyTypes(tx->nodetree);
+ }
}
@@ -1584,6 +1590,9 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree)
else if(ELEM3(node->type, CMP_NODE_IMAGE, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER))
((ImageUser *)node->storage)->ok= 1;
}
+ else if( ntree->type==NTREE_TEXTURE && (node->type==TEX_NODE_CURVE_RGB || node->type==TEX_NODE_CURVE_TIME) ) {
+ direct_link_curvemapping(fd, node->storage);
+ }
}
link_list(fd, &node->inputs);
link_list(fd, &node->outputs);
@@ -2490,6 +2499,9 @@ static void lib_link_texture(FileData *fd, Main *main)
tex->ipo= newlibadr_us(fd, tex->id.lib, tex->ipo);
if(tex->env) tex->env->object= newlibadr(fd, tex->id.lib, tex->env->object);
+ if(tex->nodetree)
+ lib_link_ntree(fd, &tex->id, tex->nodetree);
+
tex->id.flag -= LIB_NEEDLINK;
}
tex= tex->id.next;
@@ -2515,6 +2527,11 @@ static void direct_link_texture(FileData *fd, Tex *tex)
memset(tex->env->cube, 0, 6*sizeof(void *));
tex->env->ok= 0;
}
+
+ tex->nodetree= newdataadr(fd, tex->nodetree);
+ if(tex->nodetree)
+ direct_link_nodetree(fd, tex->nodetree);
+
tex->preview = direct_link_preview_image(fd, tex->preview);
tex->iuser.ok= 1;
@@ -8306,11 +8323,23 @@ static void expand_key(FileData *fd, Main *mainvar, Key *key)
expand_doit(fd, mainvar, key->ipo);
}
+static void expand_nodetree(FileData *fd, Main *mainvar, bNodeTree *ntree)
+{
+ bNode *node;
+
+ for(node= ntree->nodes.first; node; node= node->next)
+ if(node->id && node->type!=CMP_NODE_R_LAYERS)
+ expand_doit(fd, mainvar, node->id);
+
+}
static void expand_texture(FileData *fd, Main *mainvar, Tex *tex)
{
expand_doit(fd, mainvar, tex->ima);
expand_doit(fd, mainvar, tex->ipo);
+
+ if(tex->nodetree)
+ expand_nodetree(fd, mainvar, tex->nodetree);
}
static void expand_brush(FileData *fd, Main *mainvar, Brush *brush)
@@ -8323,16 +8352,6 @@ static void expand_brush(FileData *fd, Main *mainvar, Brush *brush)
expand_doit(fd, mainvar, brush->clone.image);
}
-static void expand_nodetree(FileData *fd, Main *mainvar, bNodeTree *ntree)
-{
- bNode *node;
-
- for(node= ntree->nodes.first; node; node= node->next)
- if(node->id && node->type!=CMP_NODE_R_LAYERS)
- expand_doit(fd, mainvar, node->id);
-
-}
-
static void expand_material(FileData *fd, Main *mainvar, Material *ma)
{
int a;