diff --git a/modules/gfx/pymod/__init__.py b/modules/gfx/pymod/__init__.py index 4dfc0fd64f31c7ddbda9a5e804e2e81881976305..5788da8cfeaedcc6b400f545dd5a8ab5d99b711d 100644 --- a/modules/gfx/pymod/__init__.py +++ b/modules/gfx/pymod/__init__.py @@ -141,7 +141,7 @@ def FitToScreen(gfx_ent, width=None, height=None, margin=0.01): scene.SetRTC(rtc) -class GfxNodeListAttrProxy: +class GfxNodeListAttrProxy(object): def __init__(self, node_list, name): self._node_list=node_list self._name=name @@ -164,6 +164,11 @@ class GfxNodeListProxy(object): return super(GfxNodeListProxy, self).__getattr__(name) return GfxNodeListAttrProxy(self._nodes, name) + def __dir__(self): + if len(self._nodes)==0: + return dir(None) + return dir(self._nodes[0]) + def __setattr__(self, name, value): if name.startswith('_'): super(GfxNodeListProxy, self).__setattr__(name, value) @@ -183,4 +188,4 @@ def _Match(scene, pattern="*"): return matches return GfxNodeListProxy(_Recurse("", Scene().root_node, pattern)) -SceneSingleton.__getitem__=_Match +SceneSingleton.Match=_Match