Fix potential crash introduced by weightpaint engine when no active object

This commit is contained in:
Dalai Felinto 2017-05-03 20:10:54 +02:00
parent 8c2b98ffa5
commit 62189a5ab7
1 changed files with 6 additions and 1 deletions

View File

@ -2538,7 +2538,12 @@ static void rna_LayerCollectionEngineSettings_weight_wire_update(bContext *C, Po
{
Scene *scene = CTX_data_scene(C);
SceneLayer *sl = CTX_data_scene_layer(C);
BKE_mesh_batch_cache_dirty(sl->basact->object->data, BKE_MESH_BATCH_DIRTY_WEIGHT);
Object *ob = OBACT_NEW;
if (ob != NULL) {
BKE_mesh_batch_cache_dirty(ob, BKE_MESH_BATCH_DIRTY_WEIGHT);
}
/* TODO(sergey): Use proper flag for tagging here. */
DAG_id_tag_update(&scene->id, 0);
}