Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/space_view3d.c
| Show First 20 Lines • Show All 526 Lines • ▼ Show 20 Lines | |||||
| static bool view3d_mat_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) | static bool view3d_mat_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) | ||||
| { | { | ||||
| return view3d_drop_id_in_main_region_poll(C, drag, event, ID_MA); | return view3d_drop_id_in_main_region_poll(C, drag, event, ID_MA); | ||||
| } | } | ||||
| static char *view3d_mat_drop_tooltip(bContext *C, | static char *view3d_mat_drop_tooltip(bContext *C, | ||||
| wmDrag *drag, | wmDrag *drag, | ||||
| const wmEvent *event, | const int xy[2], | ||||
| struct wmDropBox *drop) | struct wmDropBox *drop) | ||||
| { | { | ||||
| const char *name = WM_drag_get_item_name(drag); | const char *name = WM_drag_get_item_name(drag); | ||||
| ARegion *region = CTX_wm_region(C); | |||||
| RNA_string_set(drop->ptr, "name", name); | RNA_string_set(drop->ptr, "name", name); | ||||
| return ED_object_ot_drop_named_material_tooltip(C, drop->ptr, event); | int mval[2] = { | ||||
| xy[0] - region->winrct.xmin, | |||||
| xy[1] - region->winrct.ymin, | |||||
| }; | |||||
| return ED_object_ot_drop_named_material_tooltip(C, drop->ptr, mval); | |||||
| } | } | ||||
| static bool view3d_world_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) | static bool view3d_world_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) | ||||
| { | { | ||||
| return view3d_drop_id_in_main_region_poll(C, drag, event, ID_WO); | return view3d_drop_id_in_main_region_poll(C, drag, event, ID_WO); | ||||
| } | } | ||||
| static bool view3d_object_data_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) | static bool view3d_object_data_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) | ||||
| { | { | ||||
| ID_Type id_type = view3d_drop_id_in_main_region_poll_get_id_type(C, drag, event); | ID_Type id_type = view3d_drop_id_in_main_region_poll_get_id_type(C, drag, event); | ||||
| if (id_type && OB_DATA_SUPPORT_ID(id_type)) { | if (id_type && OB_DATA_SUPPORT_ID(id_type)) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| static char *view3d_object_data_drop_tooltip(bContext *UNUSED(C), | static char *view3d_object_data_drop_tooltip(bContext *UNUSED(C), | ||||
| wmDrag *UNUSED(drag), | wmDrag *UNUSED(drag), | ||||
| const wmEvent *UNUSED(event), | const int UNUSED(xy[2]), | ||||
| wmDropBox *UNUSED(drop)) | wmDropBox *UNUSED(drop)) | ||||
| { | { | ||||
| return BLI_strdup(TIP_("Create object instance from object-data")); | return BLI_strdup(TIP_("Create object instance from object-data")); | ||||
| } | } | ||||
| static bool view3d_ima_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) | static bool view3d_ima_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) | ||||
| { | { | ||||
| if (ED_region_overlap_isect_any_xy(CTX_wm_area(C), event->xy)) { | if (ED_region_overlap_isect_any_xy(CTX_wm_area(C), event->xy)) { | ||||
| ▲ Show 20 Lines • Show All 1,240 Lines • Show Last 20 Lines | |||||