Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/paint_utils.c
| Show First 20 Lines • Show All 446 Lines • ▼ Show 20 Lines | if (use_palette) { | ||||
| color = BKE_palette_color_add(palette); | color = BKE_palette_color_add(palette); | ||||
| palette->active_color = BLI_listbase_count(&palette->colors) - 1; | palette->active_color = BLI_listbase_count(&palette->colors) - 1; | ||||
| } | } | ||||
| if (CTX_wm_view3d(C) && texpaint_proj) { | if (CTX_wm_view3d(C) && texpaint_proj) { | ||||
| /* first try getting a colour directly from the mesh faces if possible */ | /* first try getting a colour directly from the mesh faces if possible */ | ||||
| SceneLayer *sl = CTX_data_scene_layer(C); | ViewLayer *sl = CTX_data_view_layer(C); | ||||
| Object *ob = OBACT(sl); | Object *ob = OBACT(sl); | ||||
| bool sample_success = false; | bool sample_success = false; | ||||
| ImagePaintSettings *imapaint = &scene->toolsettings->imapaint; | ImagePaintSettings *imapaint = &scene->toolsettings->imapaint; | ||||
| bool use_material = (imapaint->mode == IMAGEPAINT_MODE_MATERIAL); | bool use_material = (imapaint->mode == IMAGEPAINT_MODE_MATERIAL); | ||||
| if (ob) { | if (ob) { | ||||
| Mesh *me = (Mesh *)ob->data; | Mesh *me = (Mesh *)ob->data; | ||||
| DerivedMesh *dm = mesh_get_derived_final(&eval_ctx, scene, ob, CD_MASK_BAREMESH); | DerivedMesh *dm = mesh_get_derived_final(&eval_ctx, scene, ob, CD_MASK_BAREMESH); | ||||
| ▲ Show 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static int brush_curve_preset_exec(bContext *C, wmOperator *op) | static int brush_curve_preset_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| Brush *br = BKE_paint_brush(BKE_paint_get_active_from_context(C)); | Brush *br = BKE_paint_brush(BKE_paint_get_active_from_context(C)); | ||||
| if (br) { | if (br) { | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| SceneLayer *sl = CTX_data_scene_layer(C); | ViewLayer *sl = CTX_data_view_layer(C); | ||||
| BKE_brush_curve_preset(br, RNA_enum_get(op->ptr, "shape")); | BKE_brush_curve_preset(br, RNA_enum_get(op->ptr, "shape")); | ||||
| BKE_paint_invalidate_cursor_overlay(scene, sl, br->curve); | BKE_paint_invalidate_cursor_overlay(scene, sl, br->curve); | ||||
| } | } | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| static int brush_curve_preset_poll(bContext *C) | static int brush_curve_preset_poll(bContext *C) | ||||
| ▲ Show 20 Lines • Show All 199 Lines • Show Last 20 Lines | |||||