Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/space_view3d.c
| Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_mball.h" | #include "BKE_mball.h" | ||||
| #include "BKE_mesh.h" | #include "BKE_mesh.h" | ||||
| #include "BKE_object.h" | #include "BKE_object.h" | ||||
| #include "BKE_scene.h" | #include "BKE_scene.h" | ||||
| #include "BKE_screen.h" | #include "BKE_screen.h" | ||||
| #include "BKE_workspace.h" | #include "BKE_workspace.h" | ||||
| #include "ED_object.h" | |||||
| #include "ED_render.h" | #include "ED_render.h" | ||||
| #include "ED_screen.h" | #include "ED_screen.h" | ||||
| #include "ED_space_api.h" | #include "ED_space_api.h" | ||||
| #include "ED_transform.h" | #include "ED_transform.h" | ||||
| #include "GPU_matrix.h" | #include "GPU_matrix.h" | ||||
| #include "DRW_engine.h" | #include "DRW_engine.h" | ||||
| ▲ Show 20 Lines • Show All 459 Lines • ▼ Show 20 Lines | static bool view3d_collection_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) | ||||
| return view3d_drop_id_in_main_region_poll(C, drag, event, ID_GR); | return view3d_drop_id_in_main_region_poll(C, drag, event, ID_GR); | ||||
| } | } | ||||
| 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, | |||||
| wmDrag *drag, | |||||
| const wmEvent *event, | |||||
| struct wmDropBox *drop) | |||||
| { | |||||
| if (drop->copy) { | |||||
| drop->copy(drag, drop); | |||||
| } | |||||
| return ED_object_ot_drop_named_material_tooltip(C, drop->ptr, event); | |||||
| } | |||||
| 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 wmEvent *UNUSED(event), | ||||
| 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->x)) { | if (ED_region_overlap_isect_any_xy(CTX_wm_area(C), &event->x)) { | ||||
| return false; | return false; | ||||
| ▲ Show 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | WM_dropbox_add(lb, | ||||
| view3d_ob_drop_copy, | view3d_ob_drop_copy, | ||||
| WM_drag_free_imported_drag_ID, | WM_drag_free_imported_drag_ID, | ||||
| NULL); | NULL); | ||||
| WM_dropbox_add(lb, | WM_dropbox_add(lb, | ||||
| "OBJECT_OT_drop_named_material", | "OBJECT_OT_drop_named_material", | ||||
| view3d_mat_drop_poll, | view3d_mat_drop_poll, | ||||
| view3d_id_drop_copy, | view3d_id_drop_copy, | ||||
| WM_drag_free_imported_drag_ID, | WM_drag_free_imported_drag_ID, | ||||
| NULL); | view3d_mat_drop_tooltip); | ||||
| WM_dropbox_add(lb, | WM_dropbox_add(lb, | ||||
| "VIEW3D_OT_background_image_add", | "VIEW3D_OT_background_image_add", | ||||
| view3d_ima_bg_drop_poll, | view3d_ima_bg_drop_poll, | ||||
| view3d_id_path_drop_copy, | view3d_id_path_drop_copy, | ||||
| WM_drag_free_imported_drag_ID, | WM_drag_free_imported_drag_ID, | ||||
| NULL); | NULL); | ||||
| WM_dropbox_add(lb, | WM_dropbox_add(lb, | ||||
| "OBJECT_OT_drop_named_image", | "OBJECT_OT_drop_named_image", | ||||
| ▲ Show 20 Lines • Show All 1,074 Lines • Show Last 20 Lines | |||||