diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-08-03 15:33:03 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-08-03 15:33:03 +0300 |
commit | 3a9897f8cee9884b0a38c54fec99ecfb75fbb0d9 (patch) | |
tree | 82a2b84e2e4646161493203acd7ad5196864a9a0 /source | |
parent | 3aa2dd74b55829ed8930c338e2ab27787c0afc9d (diff) |
OpenSubdiv: Fix crash caused by applying subsurf on non-mesh object
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/gpu/intern/gpu_draw.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index af8b2a0f806..bf7b8fbc386 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -1533,11 +1533,15 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O #ifdef WITH_OPENSUBDIV { DerivedMesh *derivedFinal = NULL; - Mesh *me = ob->data; - BMEditMesh *em = me->edit_btmesh; - - if (em != NULL) { - derivedFinal = em->derivedFinal; + if (ob->type == OB_MESH) { + Mesh *me = ob->data; + BMEditMesh *em = me->edit_btmesh; + if (em != NULL) { + derivedFinal = em->derivedFinal; + } + else { + derivedFinal = ob->derivedFinal; + } } else { derivedFinal = ob->derivedFinal; |