Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_select.c
| Show First 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| void ED_view3d_viewcontext_init_object(ViewContext *vc, Object *obact) | void ED_view3d_viewcontext_init_object(ViewContext *vc, Object *obact) | ||||
| { | { | ||||
| vc->obact = obact; | vc->obact = obact; | ||||
| if (vc->obedit) { | if (vc->obedit) { | ||||
| BLI_assert(BKE_object_is_in_editmode(obact)); | BLI_assert(BKE_object_is_in_editmode(obact)); | ||||
| vc->obedit = obact; | vc->obedit = obact; | ||||
| /* previous selections are now invalid. */ | |||||
| vc->v3d->flag |= V3D_INVALID_BACKBUF; | |||||
| if (vc->em) { | if (vc->em) { | ||||
| vc->em = BKE_editmesh_from_object(vc->obedit); | vc->em = BKE_editmesh_from_object(vc->obedit); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| ▲ Show 20 Lines • Show All 2,205 Lines • ▼ Show 20 Lines | if (SEL_OP_USE_PRE_DESELECT(sel_op)) { | ||||
| changed |= paintvert_deselect_all_visible(vc->obact, SEL_DESELECT, false); | changed |= paintvert_deselect_all_visible(vc->obact, SEL_DESELECT, false); | ||||
| } | } | ||||
| if (BLI_rcti_is_empty(rect)) { | if (BLI_rcti_is_empty(rect)) { | ||||
| /* pass */ | /* pass */ | ||||
| } | } | ||||
| else if (use_zbuf) { | else if (use_zbuf) { | ||||
| MVert *mvert; | MVert *mvert; | ||||
| unsigned int *rt; | uint *rt, *buf, buf_len; | ||||
| int a, index; | int a, index; | ||||
| char *selar; | char *selar; | ||||
| selar = MEM_callocN(me->totvert + 1, "selar"); | selar = MEM_callocN(me->totvert + 1, "selar"); | ||||
| uint buf_len; | ED_view3d_select_id_validate(vc); | ||||
| uint *buf = ED_view3d_select_id_read_rect(vc, rect, &buf_len); | buf = ED_view3d_select_id_read_rect(vc, rect, &buf_len); | ||||
| rt = buf; | rt = buf; | ||||
| a = buf_len; | a = buf_len; | ||||
| while (a--) { | while (a--) { | ||||
| if (*rt) { | if (*rt) { | ||||
| index = *rt; | index = *rt; | ||||
| if (index <= me->totvert) { | if (index <= me->totvert) { | ||||
| ▲ Show 20 Lines • Show All 1,369 Lines • Show Last 20 Lines | |||||