diff options
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/space_view3d.c | 9 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_buttons.c | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index f16e19c598e..0f5607bc8cd 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -559,6 +559,14 @@ static bool view3d_ima_empty_drop_poll(bContext *C, return false; } +static bool view3d_volume_drop_poll(bContext *UNUSED(C), + wmDrag *drag, + const wmEvent *UNUSED(event), + const char **UNUSED(tooltip)) +{ + return (drag->type == WM_DRAG_PATH) && (drag->icon == ICON_FILE_VOLUME); +} + static void view3d_ob_drop_copy(wmDrag *drag, wmDropBox *drop) { ID *id = WM_drag_ID(drag, ID_OB); @@ -626,6 +634,7 @@ static void view3d_dropboxes(void) lb, "VIEW3D_OT_background_image_add", view3d_ima_bg_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, "OBJECT_OT_volume_import", view3d_volume_drop_poll, view3d_id_path_drop_copy); WM_dropbox_add(lb, "OBJECT_OT_collection_instance_add", view3d_collection_drop_poll, diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 9b02ea7238c..54f00b67898 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -1591,8 +1591,8 @@ static void view3d_panel_transform(const bContext *C, Panel *pa) RNA_id_pointer_create(&ob->id, &obptr); v3d_transform_butsR(col, &obptr); - /* dimensions and editmode just happen to be the same checks */ - if (OB_TYPE_SUPPORT_EDITMODE(ob->type)) { + /* Dimensions and editmode are mostly the same check. */ + if (OB_TYPE_SUPPORT_EDITMODE(ob->type) || ELEM(ob->type, OB_VOLUME, OB_HAIR, OB_POINTCLOUD)) { View3D *v3d = CTX_wm_view3d(C); v3d_object_dimension_buts(NULL, col, v3d, ob); } |