원클릭으로
dm-right-click-close
Pattern for single-RMB tool close. Required reading before editing on_button3_down or any tool's finish() method.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Pattern for single-RMB tool close. Required reading before editing on_button3_down or any tool's finish() method.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Architecture reference for the unified edit-mode transform gizmo (translation arrows + rotation rings, transform spaces, x-ray rendering). Required reading before implementing any task in todo.md whose ID begins with GIZMO-.
Reference for the two-color (orange/blue) boolean system where IsSubtractive classifies inputs into groups and boolean operations combine them into a parent-child tree. Required reading before implementing any task in todo_bool.md.
Standardized pattern for creating interactive SDF primitive tools in the Direct Modeling workbench.
Template and rules for creating new SDF primitive field classes in core/sdf/sdf/. Required reading before implementing any new SdfField subclass.
Reference for converting SVG path data (M L H V C S Q T A Z) and shape elements (rect, circle, ellipse, line, polyline, polygon) into cubic Bezier segments with no rasterization. Required reading before implementing svg_importer.py.
Convention for registering primitive-specific GLSL inside the primitive's own .py file. Required reading before editing any to_glsl/to_glsl_2d method.
| name | DM Right-Click Close |
| description | Pattern for single-RMB tool close. Required reading before editing on_button3_down or any tool's finish() method. |
| Action | Behavior |
|---|---|
| Right-click (any state) | Commit in-progress work (if any), then always terminate |
| Enter key | Commit in-progress work; tool may stay alive (subclass decides) |
| ESC key | Terminate without committing |
DMBase.on_button3_down (tools/dm_base.py) is the sole entry point for right-click on all
tools. It uses a deferred closure so finish() and terminate() run outside the Qt event
dispatch stack:
def on_button3_down(self, event_dict):
if not getattr(self, '_finish_scheduled', False):
self._finish_scheduled = True
def _rclick_close():
if self.is_in_progress():
self.finish() # subclass commit (may internally call terminate — safe)
self.terminate() # always close; _terminated guard prevents double-fire
QtCore.QTimer.singleShot(0, _rclick_close)
return True
_terminated Guardterminate() sets self._terminated = True immediately and returns early if already set.
Calling terminate() after finish() (which may itself call terminate()) is always safe.
Do not add an on_button3_down override to a tool unless it has unique commit semantics
that cannot be expressed by overriding finish(). The base-class implementation applies to
all tools. If a tool previously had an override (e.g. SdfEditTool), remove it.
| Method | Commits | Stays alive |
|---|---|---|
finish() | Yes | Depends on tool (subclass may call reset_state() to stay alive, or terminate()) |
terminate() | No | No |
The RMB close pattern calls both: finish() commits, then terminate() ensures the tool
always exits regardless of what finish() did internally.
tools/dm_base.py — on_button3_down (line 625), terminate (line 402), is_in_progress (line 513)tools/edit_tool.py — SdfEditTool.on_button3_down (line 665, to be removed per I-002)tools/primitive_tool.py — SdfPrimitiveCreator.finish (line 157); calls reset_state() not terminate()