From c0a4bd07e20fec3e35eec5fdf4c1e6b29869c98c Mon Sep 17 00:00:00 2001
From: Marco Biasini <marco.biasini@unibas.ch>
Date: Wed, 23 Feb 2011 13:26:40 +0100
Subject: [PATCH] allow to clear selection with gfx_ent.selection=None

---
 modules/gfx/pymod/export_entity.cc | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/gfx/pymod/export_entity.cc b/modules/gfx/pymod/export_entity.cc
index 78dd67f09..c17fe7b3d 100644
--- a/modules/gfx/pymod/export_entity.cc
+++ b/modules/gfx/pymod/export_entity.cc
@@ -241,6 +241,11 @@ RenderOptionsPtr ent_ltrace_opts(Entity* ent)
 
 void set_selection(Entity* ent, object sel)
 {
+  object none;
+  if (sel==none) {
+    ent->SetSelection(ent->GetView().CreateEmptyView());
+    return;
+  }
   try {
     String sel_string=extract<String>(sel);
     ent->SetSelection(ent->GetView().Select(sel_string));
-- 
GitLab