diff --git a/modules/gfx/pymod/export_gfx_obj.cc b/modules/gfx/pymod/export_gfx_obj.cc index 2331b0ec0b3d30f362670f550b0fa261c5c6173e..f9caac28c0d4c9181e29dd1aa01ca5ca84d04cd6 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 25c0df13baf0c092f363714c8a1101997100d95f..0ddeeab7e2961fd9187f7e7bb9414ab8191c1a0a 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)