diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-30 04:32:13 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-30 04:32:13 +0400 |
commit | 9b2df014d2ab714c4ff0ec9848f25a7db7f54142 (patch) | |
tree | a571e2a262f8d5ccbeb8b94fcc3d320c9dadb378 /source/blender/blenkernel/intern/texture.c | |
parent | aff705c4305cf972992fd4750dccc8b7b4a343b8 (diff) |
fix [#29459] Crash making a linked object group local
was an error with make-local refactor & path updating.
Diffstat (limited to 'source/blender/blenkernel/intern/texture.c')
-rw-r--r-- | source/blender/blenkernel/intern/texture.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index a67a61c7638..13205326dd2 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -973,20 +973,20 @@ void make_local_texture(Tex *tex) extern_local_texture(tex); } else if(is_local && is_lib) { - Tex *texn= copy_texture(tex); + Tex *tex_new= copy_texture(tex); - texn->id.us= 0; + tex_new->id.us= 0; /* Remap paths of new ID using old library as base. */ - BKE_id_lib_local_paths(bmain, &texn->id); + BKE_id_lib_local_paths(bmain, tex->id.lib, &tex_new->id); ma= bmain->mat.first; while(ma) { for(a=0; a<MAX_MTEX; a++) { if(ma->mtex[a] && ma->mtex[a]->tex==tex) { if(ma->id.lib==NULL) { - ma->mtex[a]->tex= texn; - texn->id.us++; + ma->mtex[a]->tex= tex_new; + tex_new->id.us++; tex->id.us--; } } @@ -998,8 +998,8 @@ void make_local_texture(Tex *tex) for(a=0; a<MAX_MTEX; a++) { if(la->mtex[a] && la->mtex[a]->tex==tex) { if(la->id.lib==NULL) { - la->mtex[a]->tex= texn; - texn->id.us++; + la->mtex[a]->tex= tex_new; + tex_new->id.us++; tex->id.us--; } } @@ -1011,8 +1011,8 @@ void make_local_texture(Tex *tex) for(a=0; a<MAX_MTEX; a++) { if(wrld->mtex[a] && wrld->mtex[a]->tex==tex) { if(wrld->id.lib==NULL) { - wrld->mtex[a]->tex= texn; - texn->id.us++; + wrld->mtex[a]->tex= tex_new; + tex_new->id.us++; tex->id.us--; } } @@ -1023,8 +1023,8 @@ void make_local_texture(Tex *tex) while(br) { if(br->mtex.tex==tex) { if(br->id.lib==NULL) { - br->mtex.tex= texn; - texn->id.us++; + br->mtex.tex= tex_new; + tex_new->id.us++; tex->id.us--; } } @@ -1035,8 +1035,8 @@ void make_local_texture(Tex *tex) for(a=0; a<MAX_MTEX; a++) { if(pa->mtex[a] && pa->mtex[a]->tex==tex) { if(pa->id.lib==NULL) { - pa->mtex[a]->tex= texn; - texn->id.us++; + pa->mtex[a]->tex= tex_new; + tex_new->id.us++; tex->id.us--; } } |