From b0a1cf2c9ae696b07f7a236bc855a5ab4a493dcb Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 17 Mar 2020 14:41:48 +0100 Subject: Objects: add Volume object type, and prototypes for Hair and PointCloud Only the volume object is exposed in the user interface. It is based on OpenVDB internally. Drawing and rendering code will follow in another commit. https://wiki.blender.org/wiki/Source/Objects/Volume https://wiki.blender.org/wiki/Reference/Release_Notes/2.83/Volumes Hair and PointCloud object types are hidden behind a WITH_NEW_OBJECT_TYPES build option. These are unfinished, and included only to make it easier to cooperate on development in the future and avoid tricky merges. https://wiki.blender.org/wiki/Source/Objects/New_Object_Types Ref T73201, T68981 Differential Revision: https://developer.blender.org/D6945 --- source/blender/editors/space_view3d/space_view3d.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/blender/editors/space_view3d/space_view3d.c') 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, -- cgit v1.2.3