Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt_filter_color.c
| Show First 20 Lines • Show All 259 Lines • ▼ Show 20 Lines | static int sculpt_color_filter_modal(bContext *C, wmOperator *op, const wmEvent *event) | ||||
| SCULPT_flush_update_step(C, SCULPT_UPDATE_COLOR); | SCULPT_flush_update_step(C, SCULPT_UPDATE_COLOR); | ||||
| return OPERATOR_RUNNING_MODAL; | return OPERATOR_RUNNING_MODAL; | ||||
| } | } | ||||
| static int sculpt_color_filter_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) | static int sculpt_color_filter_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) | ||||
| { | { | ||||
| Object *ob = CTX_data_active_object(C); | Object *ob = CTX_data_active_object(C); | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); | |||||
| Sculpt *sd = CTX_data_tool_settings(C)->sculpt; | Sculpt *sd = CTX_data_tool_settings(C)->sculpt; | ||||
| SculptSession *ss = ob->sculpt; | SculptSession *ss = ob->sculpt; | ||||
| int mode = RNA_enum_get(op->ptr, "type"); | int mode = RNA_enum_get(op->ptr, "type"); | ||||
| PBVH *pbvh = ob->sculpt->pbvh; | PBVH *pbvh = ob->sculpt->pbvh; | ||||
| /* Disable for multires and dyntopo for now */ | /* Disable for multires and dyntopo for now */ | ||||
| if (!ss->pbvh) { | if (!ss->pbvh) { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| if (BKE_pbvh_type(pbvh) != PBVH_FACES) { | if (BKE_pbvh_type(pbvh) != PBVH_FACES) { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| if (!ss->vcol) { | if (!ss->vcol) { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| SCULPT_undo_push_begin("color filter"); | SCULPT_undo_push_begin("color filter"); | ||||
| BKE_sculpt_color_layers_ensure(ob); | |||||
sergey: This function is not defined in master and in this patch. Did you compile the patch? | |||||
| Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); | |||||
sergeyUnsubmitted Done Inline ActionsCan add same comment as above. sergey: Can add same comment as above. | |||||
| bool needs_pmap = mode == COLOR_FILTER_SMOOTH; | bool needs_pmap = mode == COLOR_FILTER_SMOOTH; | ||||
| BKE_sculpt_update_object_for_edit(depsgraph, ob, needs_pmap, false, true); | BKE_sculpt_update_object_for_edit(depsgraph, ob, needs_pmap, false, true); | ||||
| if (BKE_pbvh_type(pbvh) == PBVH_FACES && needs_pmap && !ob->sculpt->pmap) { | if (BKE_pbvh_type(pbvh) == PBVH_FACES && needs_pmap && !ob->sculpt->pmap) { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| SCULPT_filter_cache_init(ob, sd, SCULPT_UNDO_COLOR); | SCULPT_filter_cache_init(ob, sd, SCULPT_UNDO_COLOR); | ||||
| Show All 28 Lines | |||||
This function is not defined in master and in this patch. Did you compile the patch?