From b4d23818c81e5d1559f87e52b8a7b8247e8759a3 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Mon, 20 Aug 2018 18:18:06 -0300 Subject: Remove MESH_OT_drop_named_image This was never ported to work with Cycles, so it is basically useless in 2.8. It can always be brought back in the future. --- source/blender/editors/mesh/mesh_data.c | 82 ---------------------- source/blender/editors/mesh/mesh_intern.h | 1 - source/blender/editors/mesh/mesh_ops.c | 1 - source/blender/editors/space_view3d/space_view3d.c | 10 --- 4 files changed, 94 deletions(-) (limited to 'source') diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index d4a6267fa6b..3598262ecf4 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -536,88 +536,6 @@ void MESH_OT_uv_texture_add(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int drop_named_image_invoke(bContext *C, wmOperator *op, const wmEvent *event) -{ - Main *bmain = CTX_data_main(C); - Scene *scene = CTX_data_scene(C); - View3D *v3d = CTX_wm_view3d(C); - Base *base; - Image *ima = NULL; - Mesh *me; - Object *obedit; - int exitmode = 0; - - if (v3d == NULL) { - BKE_report(op->reports, RPT_ERROR, "No 3D View Available"); - return OPERATOR_CANCELLED; - } - - base = ED_view3d_give_base_under_cursor(C, event->mval); - - /* Check context */ - if (base == NULL || base->object->type != OB_MESH) { - BKE_report(op->reports, RPT_ERROR, "Not an object or mesh"); - return OPERATOR_CANCELLED; - } - - ima = (Image *)WM_operator_drop_load_path(C, op, ID_IM); - if (!ima) { - return OPERATOR_CANCELLED; - } - /* handled below */ - id_us_min((ID *)ima); - - /* put mesh in editmode */ - - obedit = base->object; - me = obedit->data; - if (me->edit_btmesh == NULL) { - EDBM_mesh_make(obedit, scene->toolsettings->selectmode, false); - exitmode = 1; - } - if (me->edit_btmesh == NULL) - return OPERATOR_CANCELLED; - - if (exitmode) { - EDBM_mesh_load(bmain, obedit); - EDBM_mesh_free(me->edit_btmesh); - MEM_freeN(me->edit_btmesh); - me->edit_btmesh = NULL; - - /* load_editMesh free's pointers used by CustomData layers which might be used by evaluated mesh too, - * so signal to re-create evaluated mesh here (sergey) */ - DEG_id_tag_update(&me->id, 0); - } - - /* dummie drop support; ensure view shows a result :) */ - if (v3d) - v3d->flag2 |= V3D_SOLID_TEX; - - WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data); - - return OPERATOR_FINISHED; -} - -void MESH_OT_drop_named_image(wmOperatorType *ot) -{ - /* identifiers */ - ot->name = "Drop Image to Mesh UV Map"; - ot->description = "Assign Image to active UV Map, or create an UV Map"; - ot->idname = "MESH_OT_drop_named_image"; - - /* api callbacks */ - ot->poll = layers_poll; - ot->invoke = drop_named_image_invoke; - - /* flags */ - ot->flag = OPTYPE_UNDO | OPTYPE_INTERNAL; - - /* properties */ - RNA_def_string(ot->srna, "name", "Image", MAX_ID_NAME - 2, "Name", "Image name to assign"); - RNA_def_string(ot->srna, "filepath", "Path", FILE_MAX, "Filepath", "Path to image file"); - RNA_def_boolean(ot->srna, "relative_path", true, "Relative Path", "Select the file relative to the blend file"); -} - static int mesh_uv_texture_remove_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob = ED_object_context(C); diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h index 4a67dea9d4b..efaf90fd8ef 100644 --- a/source/blender/editors/mesh/mesh_intern.h +++ b/source/blender/editors/mesh/mesh_intern.h @@ -267,7 +267,6 @@ void MESH_OT_customdata_skin_add(struct wmOperatorType *ot); void MESH_OT_customdata_skin_clear(struct wmOperatorType *ot); void MESH_OT_customdata_custom_splitnormals_add(struct wmOperatorType *ot); void MESH_OT_customdata_custom_splitnormals_clear(struct wmOperatorType *ot); -void MESH_OT_drop_named_image(struct wmOperatorType *ot); #endif /* __MESH_INTERN_H__ */ diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index 9419caa4d65..deb37a5925d 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -167,7 +167,6 @@ void ED_operatortypes_mesh(void) WM_operatortype_append(MESH_OT_customdata_skin_clear); WM_operatortype_append(MESH_OT_customdata_custom_splitnormals_add); WM_operatortype_append(MESH_OT_customdata_custom_splitnormals_clear); - WM_operatortype_append(MESH_OT_drop_named_image); WM_operatortype_append(MESH_OT_edgering_select); WM_operatortype_append(MESH_OT_loopcut); diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 98c5c4e604d..1d254d608b2 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -621,15 +621,6 @@ static bool view3d_ima_empty_drop_poll(bContext *C, wmDrag *drag, const wmEvent return 0; } -static bool view3d_ima_mesh_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event, const char **tooltip) -{ - Base *base = ED_view3d_give_base_under_cursor(C, event->mval); - - if (base && base->object->type == OB_MESH) - return view3d_ima_drop_poll(C, drag, event, tooltip); - return 0; -} - static void view3d_ob_drop_copy(wmDrag *drag, wmDropBox *drop) { ID *id = WM_drag_ID(drag, ID_OB); @@ -693,7 +684,6 @@ static void view3d_dropboxes(void) WM_dropbox_add(lb, "OBJECT_OT_add_named", view3d_ob_drop_poll, view3d_ob_drop_copy); WM_dropbox_add(lb, "OBJECT_OT_drop_named_material", view3d_mat_drop_poll, view3d_id_drop_copy); - WM_dropbox_add(lb, "MESH_OT_drop_named_image", view3d_ima_mesh_drop_poll, view3d_id_path_drop_copy); WM_dropbox_add(lb, "OBJECT_OT_drop_named_image", view3d_ima_empty_drop_poll, view3d_id_path_drop_copy); WM_dropbox_add(lb, "VIEW3D_OT_background_image_add", view3d_ima_bg_drop_poll, view3d_id_path_drop_copy); WM_dropbox_add(lb, "OBJECT_OT_collection_instance_add", view3d_collection_drop_poll, view3d_collection_drop_copy); -- cgit v1.2.3