From 9a7f6e937bc80b9e72b503d0b0fb07ea840a3e38 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 14 Dec 2009 17:08:02 +0000 Subject: Fix #20345: weight paint crashes with armature modifier without object. Also fixes: * Weight paint subsurf drawing. * Missing pointer endian conversion in paint brushes. * Use of unitialized variable in screen version patch. * Multires modifier without mdisps layer crash. --- source/blender/editors/sculpt_paint/paint_vertex.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 7021d76b1c4..56e020e22aa 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1300,15 +1300,18 @@ static char *wpaint_make_validmap(Mesh *me, Object *ob) if (md->type == eModifierType_Armature) { amd = (ArmatureModifierData*) md; - pose = amd->object->pose; - - for (chan=pose->chanbase.first; chan; chan=chan->next) { - if (chan->bone->flag & BONE_NO_DEFORM) - continue; - if (BLI_ghash_haskey(gh, chan->name)) { - BLI_ghash_remove(gh, chan->name, NULL, NULL); - BLI_ghash_insert(gh, chan->name, SET_INT_IN_POINTER(1)); + if(amd->object && amd->object->pose) { + pose = amd->object->pose; + + for (chan=pose->chanbase.first; chan; chan=chan->next) { + if (chan->bone->flag & BONE_NO_DEFORM) + continue; + + if (BLI_ghash_haskey(gh, chan->name)) { + BLI_ghash_remove(gh, chan->name, NULL, NULL); + BLI_ghash_insert(gh, chan->name, SET_INT_IN_POINTER(1)); + } } } } -- cgit v1.2.3