Blender V4.5
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 void file_handler_import_operator_write_ptr (const blender::bke::FileHandlerType *file_handler, PointerRNA &props, const blender::Span< std::string > paths)
static wmOperatorStatus wm_drop_import_file_exec (bContext *C, wmOperator *op)
static wmOperatorStatus 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()

void drop_import_file_copy ( bContext * ,
wmDrag * drag,
wmDropBox * drop )
static

◆ drop_import_file_poll()

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

◆ drop_import_file_poll_file_handlers()

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 C, blender::bke::file_handlers_poll_file_drop(), 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()

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

◆ ED_dropbox_drop_import_file()

◆ file_handler_import_operator_write_ptr()

void file_handler_import_operator_write_ptr ( const blender::bke::FileHandlerType * file_handler,
PointerRNA & props,
const blender::Span< std::string > paths )
static

Sets in the RNA pointer all file paths supported by the file handler.

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 49 of file io_drop_import_file.cc.

References BLI_assert_msg, BLI_path_is_rel(), BLI_path_rel(), BLI_path_split_dir_part(), CLOG_WARN, FILE_MAX, blender::bke::FileHandlerType::filter_supported_paths(), LOG, 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(), and STRNCPY().

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.