Fix #122802: Drag and droping a .vdb file no longer works

Changes in view3d_id_path_drop_copy from 8b6a21c122 assumed that
drag-drop filepaths was handled only with FileHandlers in View3d. This
adds the missing drop-box to FileHandler conversion for .vdb files.

Pull Request: https://projects.blender.org/blender/blender/pulls/122839
This commit is contained in:
Guillermo Venegas 2024-06-07 02:15:34 +02:00 committed by Jesse Yurkovich
parent b73b663309
commit 26965a0758
2 changed files with 12 additions and 12 deletions

@ -296,6 +296,17 @@ class VIEW3D_FH_camera_background_image(FileHandler):
return rv3d.view_perspective == 'CAMERA'
class VIEW3D_FH_vdb_volume(FileHandler):
bl_idname = "VIEW3D_FH_vdb_volume"
bl_label = "OpenVDB volume"
bl_import_operator = "OBJECT_OT_volume_import"
bl_file_extensions = ".vdb"
@classmethod
def poll_drop(cls, context):
return context.space_data and context.space_data.type == 'VIEW_3D'
classes = (
VIEW3D_OT_edit_mesh_extrude_individual_move,
VIEW3D_OT_edit_mesh_extrude_move,
@ -304,4 +315,5 @@ classes = (
VIEW3D_OT_transform_gizmo_set,
VIEW3D_FH_camera_background_image,
VIEW3D_FH_empty_image,
VIEW3D_FH_vdb_volume,
)

@ -684,12 +684,6 @@ static bool view3d_ima_empty_drop_poll(bContext *C, wmDrag *drag, const wmEvent
return false;
}
static bool view3d_volume_drop_poll(bContext * /*C*/, wmDrag *drag, const wmEvent * /*event*/)
{
const eFileSel_File_Types file_type = eFileSel_File_Types(WM_drag_get_path_file_type(drag));
return (drag->type == WM_DRAG_PATH) && (file_type == FILE_TYPE_VOLUME);
}
static bool view3d_geometry_nodes_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
{
if (!view3d_drop_id_in_main_region_poll(C, drag, event, ID_NT)) {
@ -966,12 +960,6 @@ static void view3d_dropboxes()
view3d_id_path_drop_copy,
WM_drag_free_imported_drag_ID,
nullptr);
WM_dropbox_add(lb,
"OBJECT_OT_volume_import",
view3d_volume_drop_poll,
view3d_id_path_drop_copy,
WM_drag_free_imported_drag_ID,
nullptr);
WM_dropbox_add(lb,
"OBJECT_OT_data_instance_add",
view3d_object_data_drop_poll,