Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/paint_mask.c
| Show First 20 Lines • Show All 1,546 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| Object *object = CTX_data_active_object(C); | Object *object = CTX_data_active_object(C); | ||||
| SculptSession *ss = object->sculpt; | SculptSession *ss = object->sculpt; | ||||
| if (BKE_pbvh_type(ss->pbvh) != PBVH_FACES) { | if (BKE_pbvh_type(ss->pbvh) != PBVH_FACES) { | ||||
| /* Not supported in Multires and Dyntopo. */ | /* Not supported in Multires and Dyntopo. */ | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| if (ss->totvert == 0) { | |||||
| /* No geometry to trim or to detect a valid position for the trimming shape. */ | |||||
| return OPERATOR_CANCELLED; | |||||
| } | |||||
| SculptGestureContext *sgcontext = sculpt_gesture_init_from_box(C, op); | SculptGestureContext *sgcontext = sculpt_gesture_init_from_box(C, op); | ||||
| if (!sgcontext) { | if (!sgcontext) { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| sculpt_gesture_init_trim_properties(sgcontext, op); | sculpt_gesture_init_trim_properties(sgcontext, op); | ||||
| sculpt_gesture_apply(C, sgcontext); | sculpt_gesture_apply(C, sgcontext); | ||||
| sculpt_gesture_context_free(sgcontext); | sculpt_gesture_context_free(sgcontext); | ||||
| Show All 21 Lines | |||||
| { | { | ||||
| Object *object = CTX_data_active_object(C); | Object *object = CTX_data_active_object(C); | ||||
| SculptSession *ss = object->sculpt; | SculptSession *ss = object->sculpt; | ||||
| if (BKE_pbvh_type(ss->pbvh) != PBVH_FACES) { | if (BKE_pbvh_type(ss->pbvh) != PBVH_FACES) { | ||||
| /* Not supported in Multires and Dyntopo. */ | /* Not supported in Multires and Dyntopo. */ | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| if (ss->totvert == 0) { | |||||
| /* No geometry to trim or to detect a valid position for the trimming shape. */ | |||||
| return OPERATOR_CANCELLED; | |||||
| } | |||||
| SculptGestureContext *sgcontext = sculpt_gesture_init_from_lasso(C, op); | SculptGestureContext *sgcontext = sculpt_gesture_init_from_lasso(C, op); | ||||
| if (!sgcontext) { | if (!sgcontext) { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| sculpt_gesture_init_trim_properties(sgcontext, op); | sculpt_gesture_init_trim_properties(sgcontext, op); | ||||
| sculpt_gesture_apply(C, sgcontext); | sculpt_gesture_apply(C, sgcontext); | ||||
| sculpt_gesture_context_free(sgcontext); | sculpt_gesture_context_free(sgcontext); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| ▲ Show 20 Lines • Show All 188 Lines • Show Last 20 Lines | |||||