contex
06-05-2007 14:57:31
ive done everything to install python-ogre, demos works fine but when i start typing the code in GUI i get the following error:
>>> import ogre.renderer.OGRE
Warning (from warnings module):
File "C:\Python25\lib\site-packages\ogre\renderer\OGRE\__init__.py", line 6
from _ogre_ import *
RuntimeWarning: to-Python converter for struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > already registered; second conversion method ignored.
>>>
can u help me please?
You don't need any help -- it's a "feature"
Just ignore the
warning and continue programming ....
Cheers
Andy
contex
06-05-2007 17:04:14
ok sorry
lets start coding with this example from
http://www.ogre3d.org/wiki/index.php/Py ... Tutorial_1
from pyogre import ogre
import SampleFramework
Class TutorialApplication(SampleFramework.Application):
def _createScene(self):
pass
if __name__ == '__main__':
ta = TutorialApplication()
ta.go()
i save as basic_1.py and i go to the command line typing *python basic_1.py* and on the screen it shows :
C:\python3desempi>python basic_1.py
File "basic_1.py", line 3
Class TutorialApplication(SampleFramework.Application):
^
SyntaxError: invalid syntax
contex
06-05-2007 17:11:17
ive seen some demos and the code is different, i should find a good base tutorial to start. But where?
It should be "class", not "Class"
contex
06-05-2007 21:22:14
and now why this error?
File "basic_1.py", line 4
def _createScene(self):
team23
06-05-2007 22:01:32
Well aside from it looking like you're using pyogre and not Python-Ogre the code should look like this...
from pyogre import ogre
import SampleFramework
class TutorialApplication(SampleFramework.Application):
def _createScene(self):
pass
if __name__ == '__main__':
ta = TutorialApplication()
ta.go()
The big keys are the indentations, they need to be there or python will be very unhappy.
The tutorials are broken and refer to the older pyogre package, not the current Python-Ogre -- sorry.......
And the best thing to do is to check out the various demos in the demos/ogre directory (Smoke and the various Skyxx ones are good starting points)
Cheers
Andy