Added support for the Make Local command in the Outliner on textures in line styles.

This commit is contained in:
Tamito Kajiyama
2014-04-23 15:35:55 +09:00
parent 78fb7249c6
commit 5347c7b9db

View File

@@ -788,6 +788,7 @@ void BKE_texture_make_local(Tex *tex)
Lamp *la;
Brush *br;
ParticleSettings *pa;
FreestyleLineStyle *ls;
int a;
bool is_local = false, is_lib = false;
@@ -856,6 +857,16 @@ void BKE_texture_make_local(Tex *tex)
}
pa = pa->id.next;
}
ls = bmain->linestyle.first;
while (ls) {
for (a = 0; a < MAX_MTEX; a++) {
if (ls->mtex[a] && ls->mtex[a]->tex == tex) {
if (ls->id.lib) is_lib = true;
else is_local = true;
}
}
ls = ls->id.next;
}
if (is_local && is_lib == false) {
id_clear_lib_data(bmain, &tex->id);
@@ -939,6 +950,19 @@ void BKE_texture_make_local(Tex *tex)
}
pa = pa->id.next;
}
ls = bmain->linestyle.first;
while (ls) {
for (a = 0; a < MAX_MTEX; a++) {
if (ls->mtex[a] && ls->mtex[a]->tex == tex) {
if (ls->id.lib == NULL) {
ls->mtex[a]->tex = tex_new;
tex_new->id.us++;
tex->id.us--;
}
}
}
ls = ls->id.next;
}
}
}