Blender V4.3
io_drop_import_file.cc File Reference
#include "BLI_path_utils.hh"
#include "BLI_string.h"
#include "BLT_translation.hh"
#include "BKE_file_handler.hh"
#include "CLG_log.h"
#include "DNA_space_types.h"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "RNA_prototypes.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "UI_interface.hh"
#include "io_drop_import_file.hh"
#include "io_utils.hh"

Go to the source code of this file.

Functions

static blender::Vector< blender::bke::FileHandlerType * > drop_import_file_poll_file_handlers (const bContext *C, const blender::Span< std::string > paths, const bool quiet=true)
 
static PointerRNA file_handler_import_operator_create_ptr (const blender::bke::FileHandlerType *file_handler, const blender::Span< std::string > paths)
 
static int wm_drop_import_file_exec (bContext *C, wmOperator *op)
 
static int wm_drop_import_file_invoke (bContext *C, wmOperator *op, const wmEvent *)
 
void WM_OT_drop_import_file (wmOperatorType *ot)
 
static void drop_import_file_copy (bContext *, wmDrag *drag, wmDropBox *drop)
 
static bool drop_import_file_poll (bContext *C, wmDrag *drag, const wmEvent *)
 
static std::string drop_import_file_tooltip (bContext *C, wmDrag *drag, const int[2], wmDropBox *)
 
void ED_dropbox_drop_import_file ()
 

Variables

static CLG_LogRef LOG = {"io.drop_import_file"}
 

Function Documentation

◆ drop_import_file_copy()

◆ drop_import_file_poll()

static bool drop_import_file_poll ( bContext * C,
wmDrag * drag,
const wmEvent *  )
static

◆ drop_import_file_poll_file_handlers()

static blender::Vector< blender::bke::FileHandlerType * > drop_import_file_poll_file_handlers ( const bContext * C,
const blender::Span< std::string > paths,
const bool quiet = true )
static

Return a vector of file handlers that support any file path in paths and the call to poll_drop returns true. Unlike bke::file_handlers_poll_file_drop, it ensures that file handlers have a valid import operator.

Definition at line 35 of file io_drop_import_file.cc.

References blender::bke::FileHandlerType::import_operator, and WM_operatortype_find().

Referenced by drop_import_file_poll(), drop_import_file_tooltip(), wm_drop_import_file_exec(), and wm_drop_import_file_invoke().

◆ drop_import_file_tooltip()

static std::string drop_import_file_tooltip ( bContext * C,
wmDrag * drag,
const int [2],
wmDropBox *  )
static

◆ ED_dropbox_drop_import_file()

◆ file_handler_import_operator_create_ptr()

static PointerRNA file_handler_import_operator_create_ptr ( const blender::bke::FileHandlerType * file_handler,
const blender::Span< std::string > paths )
static

Creates a RNA pointer for the FileHandlerType.import_operator and sets on it all supported file paths from paths.

The directory and files properties are both required for handling multiple files, if only one is defined means that the other is missing.

Definition at line 50 of file io_drop_import_file.cc.

References BLI_assert, BLI_path_split_dir_part(), BLI_path_split_file_part(), CLOG_WARN, FILE_MAX, blender::bke::FileHandlerType::filter_supported_paths(), blender::bke::FileHandlerType::import_operator, LOG, ot, PROP_STRING, RNA_property_collection_add(), RNA_property_collection_clear(), RNA_property_string_set(), RNA_string_set(), RNA_struct_find_collection_property_check(), RNA_struct_find_property_check(), WM_operator_properties_create_ptr(), and WM_operatortype_find().

Referenced by wm_drop_import_file_exec(), and wm_drop_import_file_invoke().

◆ wm_drop_import_file_exec()

◆ wm_drop_import_file_invoke()

◆ WM_OT_drop_import_file()

Variable Documentation

◆ LOG

CLG_LogRef LOG = {"io.drop_import_file"}
static

Definition at line 28 of file io_drop_import_file.cc.

Referenced by file_handler_import_operator_create_ptr().