Fix crash in active_paint_texture_index callback
This commit is contained in:
@@ -195,14 +195,17 @@ static void rna_Material_active_paint_texture_index_update(Main *bmain, Scene *s
|
||||
nodeSetActive(ma->nodetree, node);
|
||||
}
|
||||
|
||||
for (sc = bmain->screen.first; sc; sc = sc->id.next) {
|
||||
ScrArea *sa;
|
||||
for (sa = sc->areabase.first; sa; sa = sa->next) {
|
||||
SpaceLink *sl;
|
||||
for (sl = sa->spacedata.first; sl; sl = sl->next) {
|
||||
if (sl->spacetype == SPACE_IMAGE) {
|
||||
SpaceImage *sima = (SpaceImage *)sl;
|
||||
ED_space_image_set(sima, scene, scene->obedit, ma->texpaintslot[ma->paint_active_slot].ima);
|
||||
if (ma->texpaintslot) {
|
||||
Image *image = ma->texpaintslot[ma->paint_active_slot].ima;
|
||||
for (sc = bmain->screen.first; sc; sc = sc->id.next) {
|
||||
ScrArea *sa;
|
||||
for (sa = sc->areabase.first; sa; sa = sa->next) {
|
||||
SpaceLink *sl;
|
||||
for (sl = sa->spacedata.first; sl; sl = sl->next) {
|
||||
if (sl->spacetype == SPACE_IMAGE) {
|
||||
SpaceImage *sima = (SpaceImage *)sl;
|
||||
ED_space_image_set(sima, scene, scene->obedit, image);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user