| 330 | } |
| 331 | |
| 332 | void push_python_operator_undo_entry(const std::string& label, nb::object instance) { |
| 333 | if (!instance.is_valid() || instance.is_none()) { |
| 334 | return; |
| 335 | } |
| 336 | if (!nb::hasattr(instance, "undo") || !nb::hasattr(instance, "redo")) { |
| 337 | return; |
| 338 | } |
| 339 | |
| 340 | auto entry = std::make_unique<lfs::python::PyUndoEntry>( |
| 341 | label, |
| 342 | instance.attr("undo"), |
| 343 | instance.attr("redo"), |
| 344 | "python.operator", |
| 345 | "python", |
| 346 | "operator"); |
| 347 | vis::op::undoHistory().push(std::move(entry)); |
| 348 | } |
| 349 | |
| 350 | uint64_t load_icon_from_path(const std::filesystem::path& path, const std::string& cache_key) { |
| 351 | const auto [data, width, height, channels] = lfs::core::load_image_with_alpha(path); |
no test coverage detected