From 13fa395eb7b72646cca6fe1e12210e57ed545d76 Mon Sep 17 00:00:00 2001
From: Ansgar Philippsen <ansgar.philippsen@gmail.com>
Date: Tue, 16 Aug 2011 10:05:27 -0400
Subject: [PATCH] fixed BZDNG-300 (py export of GfxObj broken)

---
 modules/gfx/pymod/export_gfx_obj.cc | 2 +-
 modules/gfx/tests/test_gfx.py       | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/gfx/pymod/export_gfx_obj.cc b/modules/gfx/pymod/export_gfx_obj.cc
index 2331b0ec0..f9caac28c 100644
--- a/modules/gfx/pymod/export_gfx_obj.cc
+++ b/modules/gfx/pymod/export_gfx_obj.cc
@@ -165,7 +165,7 @@ void export_GfxObj()
     .value("TRANSPARENT_RENDER_PASS",TRANSPARENT_RENDER_PASS)
     ;        
 
-  class_<GfxObjWrap, bases<GfxObjBase>, boost::noncopyable>("GfxObj",init<const std::string&>())
+  class_<GfxObjWrap, boost::shared_ptr<GfxObj>, bases<GfxObjBase>, boost::noncopyable>("GfxObj",init<const std::string&>())
     .def("GetTF", &GfxObj::GetTF, return_value_policy<copy_const_reference>())
     .def("SetTF", &GfxObj::SetTF)
     .def("FlagRebuild",&GfxObj::FlagRebuild)
diff --git a/modules/gfx/tests/test_gfx.py b/modules/gfx/tests/test_gfx.py
index 25c0df13b..0ddeeab7e 100644
--- a/modules/gfx/tests/test_gfx.py
+++ b/modules/gfx/tests/test_gfx.py
@@ -55,7 +55,13 @@ class TestGfx(unittest.TestCase):
     self.test_primlist()
     self.test_entity_reset()
     self.test_custom_gfx_obj()
+    self.test_gfxobj_conv()
 
+  def test_gfxobj_conv(self):
+    e=mol.CreateEntity()
+    gfx.Scene().Add(gfx.Entity("foo2",e))
+    gfx.Scene()["foo2"].SetColor(gfx.YELLOW)
+    
   def test_custom_gfx_obj(self):
     myobj=MyGfxObj("foo")
     gfx.Scene().Add(myobj)
-- 
GitLab