diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-01 18:37:13 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-01 18:37:13 +0400 |
commit | bfbda2d2846ef7f1be601938dd425fe73c87502e (patch) | |
tree | d5b441c7d4baedbf55c0bf0208579bec53366d98 /source | |
parent | 7fd1bd18e5705f33ddcf0458a4bef0eaa3da92d4 (diff) |
fix for crash in 'Skin Armature Create' when the mesh doesnt have any skin data.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index cf3e04b84b8..be69d4ca9ea 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -1804,9 +1804,15 @@ static int skin_armature_create_exec(bContext *C, wmOperator *op) Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); Object *ob = CTX_data_active_object(C), *arm_ob; + Mesh *me = ob->data; ModifierData *skin_md; ArmatureModifierData *arm_md; + if (!CustomData_has_layer(&me->vdata, CD_MVERT_SKIN)) { + BKE_reportf(op->reports, RPT_WARNING, "Mesh '%s' has no skin vertex data", me->id.name + 2); + return OPERATOR_CANCELLED; + } + /* create new armature */ arm_ob = modifier_skin_armature_create(scene, ob); |