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.
This commit is contained in:
Dalai Felinto 2018-08-20 18:18:06 -03:00
parent 753be0a2a5
commit b4d23818c8
Notes: blender-bot 2023-06-12 00:52:52 +02:00
Referenced by issue #56489, Unable to use the viewport navigation gizmo when using Grease Pencil in draw mode
Referenced by issue #54643, Multi-Object-Mode: EditMesh Tools
4 changed files with 0 additions and 94 deletions

View File

@ -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);

View File

@ -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__ */

View File

@ -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);

View File

@ -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);