Files
test2/source/blender/editors/io/io_utils.hh
Jacques Lucke 252a9b63ed Geometry Nodes: support creating import nodes when dropping file paths
Now import nodes are automatically created in Geometry Nodes when dropping
`.obj`, `.stl`, `.ply` and `.csv` files. Note that this is still hidden behind an
experimental feature flag.

Pull Request: https://projects.blender.org/blender/blender/pulls/135036
2025-02-24 16:25:50 +01:00

34 lines
1.0 KiB
C++

/* SPDX-FileCopyrightText: 2024 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
#include "WM_types.hh"
#include "BLI_vector.hh"
struct wmOperator;
namespace blender::bke {
} // namespace blender::bke
namespace blender::ed::io {
/**
* Shows a import dialog if the operator was invoked with filepath properties set,
* otherwise invokes the file-select window.
*/
int filesel_drop_import_invoke(bContext *C, wmOperator *op, const wmEvent *event);
bool poll_file_object_drop(const bContext *C, blender::bke::FileHandlerType *fh);
/**
* Return all paths stored in the pointer.
* Properties in pointer should include a `directory` #PropertySubType::PROP_FILEPATH property and
* a `files` #RNA_OperatorFileListElement collection property.
* If the pointer has a `filepath` property is also returned as fallback.
*/
Vector<std::string> paths_from_operator_properties(PointerRNA *ptr);
void paths_to_operator_properties(PointerRNA *ptr, const Span<std::string> paths);
} // namespace blender::ed::io