Skip to content

Commit 35ad684

Browse files
committed
For #67:
- in Commands, do not "instrument" function call for member function of base classes (including Commands and its parents), instrument only actual commands. - in autogui_commands.lua, detect invalid objects that became nil when object was deleted in the meanwhile.
1 parent 57b0cc8 commit 35ad684

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

lib/autogui_commands.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,9 @@ end
419419
function autogui.command_is_alive(cmd_state)
420420
if cmd_state.request_.object().is_a(OGF.Interface) then
421421
local grob = cmd_state.request_.object().grob
422+
if grob == nil then
423+
return false
424+
end
422425
if not grob.is_a(OGF.SceneGraph) and
423426
not scene_graph.is_bound(grob.name) then
424427
return false

lib/gizmo.lua

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ function gizmo_gui.draw_gizmo()
1717
end
1818
x0 = graphite_gui.left_pane_width
1919
y0 = 20.0
20-
21-
-- For testing camera centering (which is still buggy)
22-
-- x0 = graphite_main_window.gx
23-
-- y0 = graphite_main_window.gy
24-
2520
L = 150.0
2621
ImOGuizmo.SetRect(x0,y0,L)
2722
ImOGuizmo.BeginFrame(false)

src/lib/OGF/scene_graph/commands/commands.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,15 @@ namespace OGF {
8484
const ArgList& args_in, Any& ret_val
8585
) {
8686

87+
// do not do anything special for functions inherited from
88+
// Commands (and base classes).
89+
if(
90+
ogf_meta<Commands>::meta_class()->find_method(method_name) !=
91+
nullptr
92+
) {
93+
return Interface::invoke_method(method_name, args_in, ret_val);
94+
}
95+
8796
// override_lock_ is not used anywhere, except in a commented-out
8897
// code in GeometricIntelligence plugin.
8998

0 commit comments

Comments
 (0)