How to call getOptionKeys from PyOgre

newbie4ever

02-03-2010 16:45:13

Hi all,

I am using PyOgre and I have run into a problem. The following code does not work

keydict = {}
optionkeys = scene_manager.getOptionKeys(keydict)

nor does:
keylist = []
optionkeys = scene_manager.getOptionKeys(keylist)


I am using Eclipse IDE and I get the following error when I attempt to run the code:

Boost.Python.ArgumentError: Python argument types in
SceneManager.getOptionKeys(SceneManager, dict)
did not match C++ signature:
getOptionKeys(struct SceneManager_wrapper {lvalue}, class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > {lvalue} refKeys)
getOptionKeys(class Ogre::SceneManager {lvalue}, class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > {lvalue} refKeys)


and if I use a list:

Boost.Python.ArgumentError: Python argument types in
SceneManager.getOptionKeys(SceneManager, list)
did not match C++ signature:
getOptionKeys(struct SceneManager_wrapper {lvalue}, class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > {lvalue} refKeys)
getOptionKeys(class Ogre::SceneManager {lvalue}, class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > {lvalue} refKeys)


Preceeding the code above I have lines that print out the SceneManager info just so I can be sure that the SceneManager object has been created successfully:

print 'scene_manager name:',scene_manager.getName()
print 'scene_manager typename:',scene_manager.getTypeName()


and that prints:
scene_manager name: Default ScreenManager
scene_manager typename: OctreeSceneManager


so I take it that there is nothing wrong with the SceneManager instance. So my question is, can getOptionKeys(...) be invoked from Python and if so how? What Python object is compatible with the std::vector<std::string> container?

thanks in advance for any assistance you can provide.
:-)

newbie4ever

02-03-2010 17:32:09

Lol, nevermind, I figured it out, the following code works for me:

sv = ogre.StringVector()
scene_manager_optionkeys = scene_manager.getOptionKeys(sv)
for str in sv:
print 'scene_manager.getOptionKey:',str


Still figuring things out I guess....

Cheers :-)