1 # PyOpenSG is (C) Copyright 2005-2009 by Allen Bierbaum
3 # This file is part of PyOpenSG.
5 # PyOpenSG is free software; you can redistribute it and/or modify it under
6 # the terms of the GNU Lesser General Public License as published by the Free
7 # Software Foundation; either version 2 of the License, or (at your option)
10 # PyOpenSG is distributed in the hope that it will be useful, but WITHOUT ANY
11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
15 # You should have received a copy of the GNU Lesser General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 # Init file for osg package.
22 # Hack to bring in all symbols OpenSG is linked against and loads from plugins
23 # Search for : setdlopenflags and RTLD_GLOBAL on google to see why
27 original_dlopen_flags
= None
31 original_dlopen_flags
= sys
.getdlopenflags()
32 sys
.setdlopenflags(original_dlopen_flags | dl
.RTLD_GLOBAL
)
38 osgPythonModules
= glob
.glob(os
.path
.dirname(__file__
) + "/../OSG*")
40 # Import everything from the opensg module
41 ${OSG_PYTHON_ALL_IMPORTS}
43 for osg2ModuleFP
in osgPythonModules
:
45 osg2Module
= os
.path
.basename(osg2ModuleFP
)
47 if osg2ModuleNameList
.count(osg2Module
) == 0 and osg2Module
!= "osg":
49 exec("from .. " + osg2Module
+ " import *")
51 osg2ModuleList
.append(sys
.modules
["osg2." + osg2Module
+ "." + osg2Module
+ "Py"])
52 osg2ModuleNameList
.append(osg2Module
)
54 if original_dlopen_flags
:
55 sys
.setdlopenflags(original_dlopen_flags
)
58 # Import other things.
59 from ..helpers
.fcd_reflector
import FcdReflector
, FieldReflector
60 import osg2
.helpers
as helpers