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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-02-06 09:53:19 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-02-06 10:03:29 +0300
commit2a184f3d2b6cc180fedd0c93c266d847f7d27936 (patch)
tree5d7472cb10888e6e18dd64bbcdb3c078ac325ca0 /source/blender/editors/mesh/meshtools.c
parent906ed54d286d0dd6686aac997883e7dfa4bba792 (diff)
Object Mode: use eval_ctx for paint & object
Diffstat (limited to 'source/blender/editors/mesh/meshtools.c')
-rw-r--r--source/blender/editors/mesh/meshtools.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c
index 842b62be028..d0d43c4b3dd 100644
--- a/source/blender/editors/mesh/meshtools.c
+++ b/source/blender/editors/mesh/meshtools.c
@@ -1340,17 +1340,17 @@ bool ED_mesh_pick_vert(bContext *C, Object *ob, const int mval[2], unsigned int
MDeformVert *ED_mesh_active_dvert_get_em(Object *ob, BMVert **r_eve)
{
- if (ob->mode & OB_MODE_EDIT && ob->type == OB_MESH && ob->defbase.first) {
+ if (ob->type == OB_MESH && ob->defbase.first) {
Mesh *me = ob->data;
- BMesh *bm = me->edit_btmesh->bm;
- const int cd_dvert_offset = CustomData_get_offset(&bm->vdata, CD_MDEFORMVERT);
-
- if (cd_dvert_offset != -1) {
- BMVert *eve = BM_mesh_active_vert_get(bm);
-
- if (eve) {
- if (r_eve) *r_eve = eve;
- return BM_ELEM_CD_GET_VOID_P(eve, cd_dvert_offset);
+ if (me->edit_btmesh != NULL) {
+ BMesh *bm = me->edit_btmesh->bm;
+ const int cd_dvert_offset = CustomData_get_offset(&bm->vdata, CD_MDEFORMVERT);
+ if (cd_dvert_offset != -1) {
+ BMVert *eve = BM_mesh_active_vert_get(bm);
+ if (eve) {
+ if (r_eve) *r_eve = eve;
+ return BM_ELEM_CD_GET_VOID_P(eve, cd_dvert_offset);
+ }
}
}
}
@@ -1375,7 +1375,8 @@ MDeformVert *ED_mesh_active_dvert_get_ob(Object *ob, int *r_index)
MDeformVert *ED_mesh_active_dvert_get_only(Object *ob)
{
if (ob->type == OB_MESH) {
- if (ob->mode & OB_MODE_EDIT) {
+ Mesh *me = ob->data;
+ if (me->edit_btmesh != NULL) {
return ED_mesh_active_dvert_get_em(ob, NULL);
}
else {