Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt_detail.c
| Show First 20 Lines • Show All 253 Lines • ▼ Show 20 Lines | static int sample_detail(bContext *C, int mx, int my, int mode) | ||||
| CTX_wm_area_set(C, area); | CTX_wm_area_set(C, area); | ||||
| CTX_wm_region_set(C, region); | CTX_wm_region_set(C, region); | ||||
| Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); | Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); | ||||
| ViewContext vc; | ViewContext vc; | ||||
| ED_view3d_viewcontext_init(C, &vc, depsgraph); | ED_view3d_viewcontext_init(C, &vc, depsgraph); | ||||
| Object *ob = vc.obact; | Object *ob = vc.obact; | ||||
| SculptSession *ss = ob->sculpt; | if (ob == NULL) { | ||||
| return OPERATOR_CANCELLED; | |||||
| } | |||||
| SculptSession *ss = ob->sculpt; | |||||
| if (!ss->pbvh) { | if (!ss->pbvh) { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| /* Pick sample detail. */ | /* Pick sample detail. */ | ||||
| switch (mode) { | switch (mode) { | ||||
| case SAMPLE_DETAIL_DYNTOPO: | case SAMPLE_DETAIL_DYNTOPO: | ||||
| if (BKE_pbvh_type(ss->pbvh) != PBVH_BMESH) { | if (BKE_pbvh_type(ss->pbvh) != PBVH_BMESH) { | ||||
| ▲ Show 20 Lines • Show All 157 Lines • Show Last 20 Lines | |||||