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

Method cancelModalOperator

src/visualizer/operator/operator_registry.cpp:592–623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

590 }
591
592 void OperatorRegistry::cancelModalOperator() {
593 std::unique_lock lock(mutex_);
594
595 if (!active_modal_id_.empty()) {
596 auto it = python_operators_.find(active_modal_id_);
597 if (it != python_operators_.end() && it->second.cancel_fn) {
598 it->second.cancel_fn();
599 }
600 active_modal_id_.clear();
601 const bool finalize_history = active_modal_has_undo_transaction_;
602 lock.unlock();
603 if (finalize_history) {
604 finalizeUndoTransaction(true, OperatorResult::CANCELLED, active_modal_has_undo_transaction_);
605 }
606 return;
607 }
608
609 if (!active_modal_) {
610 return;
611 }
612
613 if (auto ctx = makeContext()) {
614 active_modal_->cancel(*ctx);
615 }
616 active_modal_.reset();
617 active_modal_builtin_.reset();
618 const bool finalize_history = active_modal_has_undo_transaction_;
619 lock.unlock();
620 if (finalize_history) {
621 finalizeUndoTransaction(true, OperatorResult::CANCELLED, active_modal_has_undo_transaction_);
622 }
623 }
624
625 void OperatorRegistry::clear() {
626 std::unique_lock lock(mutex_);

Callers 5

register_ui_operatorsFunction · 0.80
register_operatorsFunction · 0.80
control_job_on_guiFunction · 0.80
handleKeyMethod · 0.80

Calls 7

finalizeUndoTransactionFunction · 0.85
emptyMethod · 0.45
findMethod · 0.45
endMethod · 0.45
clearMethod · 0.45
cancelMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected