MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / push_python_operator_undo_entry

Function push_python_operator_undo_entry

src/python/lfs/py_ui.cpp:332–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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);

Callers 1

Calls 3

moveFunction · 0.85
is_validMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected