SirGolan
15-03-2009 19:38:03
I'm in the process of upgrading MV3D from a very old version of Python Ogre (1.1 I think) to 1.6.1. It seems like in 1.6.1, there is no way to set a height function for a GrassLoader. The setHeightFunction method doesn't seem to be wrapped. Am I missing something here?
Thanks,
Mike
SirGolan
15-03-2009 21:34:43
Hijacking my own thread here. Another issue I found while upgrading is that it seems like the autoconversion from MemoryDataStream to DataStream isn't working any more. This code works fine with older versions of Python-Ogre:
fil = open("some.material")
data = fil.read()
fil.close()
sctyp = ctypes.c_char * len(data)
cpy = sctyp(" ")
for pos in range(len(data)):
cpy[pos] = data[pos]
dst = Ogre.MemoryDataStream(Ogre.CastVoidPtr(ctypes.addressof(cpy)),
len(data))
Ogre.MaterialManager.getSingleton().parseScript(dst, "General")
But in 1.6.1 gives the following exception:
Traceback (most recent call last):
File "F:\Projects\MV3D\branches\354-upgradeogre\mv3d\test\test_asset.py", line 146, in test_readyAsset
asset.readyAsset()
File "F:\Projects\MV3D\branches\354-upgradeogre\mv3d\resource\ogre3d.py", line 302, in readyAsset
Ogre.MaterialManager.getSingleton().parseScript(dst, "General")
Boost.Python.ArgumentError: Python argument types in
MaterialManager.parseScript(MaterialManager, MemoryDataStream, str)
did not match C++ signature:
parseScript(struct MaterialManager_wrapper {lvalue}, class Ogre::SharedPtr<class Ogre::DataStream> {lvalue} stream, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > groupName)
parseScript(class Ogre::MaterialManager {lvalue}, class Ogre::SharedPtr<class Ogre::DataStream> {lvalue} stream, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > groupName)
Can you upgrade to the 'latest' version of Python Ogre and see if it solves your issue -- basically install 1.6.1 and then overwrite the installation with the files referenced
here
Thanks
Andy
SirGolan
18-03-2009 02:28:51
Hi Andy,
I knew I was missing something. That did fix the DataStream/MemoryDataStream issue, but it still seems like setHeightFunction is missing from GrassLoader:
File "F:\Projects\MV3D\branches\354-upgradeogre\mv3d\client\ui\ogre3d.py", line 758, in create
self.object.setHeightFunction(OgreGrass, "getHeight")
exceptions.AttributeError: 'GrassLoader' object has no attribute 'setHeightFunction'
Probably not as big of a deal as the other issue since I can just turn off grass for anyone using Python-Ogre 1.6 for now.
Thanks,
Mike
You are right -- for some reason I commented out the hand wrapper code for OgreForests that defined setHeight -- not sure why so will take another look........
Regards
Andy