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
path: root/source
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2014-08-28 23:30:29 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-08-29 01:16:07 +0400
commitd1c91016429e81aa96f4ff64da773deec8f060ee (patch)
tree49624e3d0dfd50e528c8336aa89e4ccf8d5e6ba6 /source
parentb583894592e22468ef25cf2979577f6ce7fcf777 (diff)
Fix some crash cases after last commit
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/material.c5
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c23
2 files changed, 16 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index e7500392c81..8ccdb8a3223 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -1340,8 +1340,11 @@ void BKE_texpaint_slot_refresh_cache(Scene *scene, Material *ma)
if (use_nodes || ma->use_nodes) {
bNode *node, *active_node;
- if (!(ma->nodetree))
+ if (!(ma->nodetree)) {
+ ma->paint_active_slot = 0;
+ ma->paint_clone_slot = 0;
return;
+ }
for (node = ma->nodetree->nodes.first; node; node = node->next) {
if (node->typeinfo->nclass == NODE_CLASS_TEXTURE && node->typeinfo->type == SH_NODE_TEX_IMAGE && node->id)
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index f596f330534..f0176bcd04d 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -1391,20 +1391,21 @@ void paint_proj_mesh_data_ensure(bContext *C, Object *ob, wmOperator *op)
if (!ma->texpaintslot) {
proj_paint_add_slot(C, ma, NULL);
- 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[0].ima);
+ if (ma->texpaintslot) {
+ 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[0].ima);
+ }
}
}
}
- }
-
+ }
}
}
}