Starting on Pyogre/ what other tools should i play with ?

hizdudeness

04-04-2006 23:02:22

Hey I've decided to split my time between pythong and pyogre. I'm done with the basic tutorials out my book.I went to donload psyco, and the download link was broken. Is there another place that I can download this from?

Also on that note. If I want to start working at a scene putogether that I can walk arond in, what other tools should i download and start playing with. I have 3ds max7, but I'm under the impression that I need to use ofusion for my maps. What else should i start working at? If you could guys could just give me a shove in the right direction that would be awsome

Thanks!

Chris

OvermindDL1

04-04-2006 23:12:17

http://psyco.sourceforge.net/download.html

And read the page, they recommend getting the latest cvs/svn version instead of the pre-built.

hizdudeness

05-04-2006 03:14:22

Ok well I didnt even make it out of the first python tutorial. I was reading the python tutorial and I cut and pasted this code. (below) its supposed to be a sample I guess. When I compiled it it didnt work. I'm curious when I extract the pyogre zip into my python24 folder do i just leave it in the pyoger folder or is the contents of the pyogre folder supposed to be dropped into the python folder?

from pyogre import ogre
import SampleFramework

class TutorialApplication(SampleFramework.Application):
def _createScene(self):
pass

if __name__ == '__main__':
ta = TutorialApplication()
ta.go()

_______________________________________________
Heres the error i got

Traceback (most recent call last):
File "C:\Python24\basic_1.py", line 2, in -toplevel-
import SampleFramework
ImportError: No module named SampleFramework


___________________________________________


Also I tried to run a couple of the demos out of ogredemo folder and
they wouldnt work. If its all the same to you guys I'm ganna keep my questions to this thread so that i'm not spamming the heck out of this forum. I can also start posting in the help forum if that would be a better place to ask simple questions since this section seems less frequented.

dermont

05-04-2006 09:20:24

By the pyogre.zip folder, I'm assuming you mean pyogre-1.0.6-0.zip. You should only be using this if you intend to compile pyOgre yourself. For windows there are pre-packaged installers for python23 and python24:

1. Download

- pyogre-1.0.6.0.py23.exe or pyogre-1.0.6.0.py24.exe depending on your version of python
- vcredist_x86.exe
- demo_media.zip


2. Double click on pyogre-1.0.6.0.py2x.exe to install
Double click vcredist_x86.exe to install

You will now have dir structure similar to:

[python-path]\Lib\site-packages\pyogre # ogre dll's \ pyogre & pycegui modules
[python-path]\pyogre\ogre_demos # ogre demos
[python-path]\pyogre\cegui_demos # pycegui demos
[python-path]\pyogre\tutorials # pyogre tutorial
[python-path]\pyogre\tools # pycegui mesh viewer

where python-path is e.g. C:\Python23 or C:\Python24

3. Extract the media demo_media.zip to [python-path]\pyogre

[python-path]\pyogre\media # pyogre media


4. Before running the demos / tutorials, double check that resources.cfg
in each dir points to the media dir:

[Bootstrap]
Zip=../media/packs/OgreCore.zip

# Resource locations to be added to the default path
[General]
FileSystem=../media
FileSystem=../media/fonts
FileSystem=../media/materials/programs
FileSystem=../media/materials/scripts
FileSystem=../media/materials/textures
FileSystem=../media/models
FileSystem=../media/overlays
FileSystem=../media/particle
#FileSystem=../media/gui
Zip=../media/packs/cubemap.zip
Zip=../media/packs/cubemapsJS.zip
Zip=../media/packs/dragon.zip
Zip=../media/packs/fresneldemo.zip
Zip=../media/packs/ogretestmap.zip
Zip=../media/packs/skybox.zip
#Zip=../media/packs/chiropteraDM.pk3


5. If your encountering problems with the DirectX plugin check here:
http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=538
http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=267

For the "SampleFramework" error you can't find SampleFramework.py. You should copy that and the *.cfg from [python-path]\pyogre\ogre_demos to the directory your running from. After doing so edit the resources.cfg file to point to your media directory.

Much easier just to create and run your demos from [python-path]\pyogre\ogre_demos until you become familiar with the set up.

For other errors whilst running the demos check the Ogre.log file. It is created in the same dir that you run from.

Also remember your indentaion when writing python code:


from pyogre import ogre
import SampleFramework

class TutorialApplication(SampleFramework.Application):
def _createScene(self):
pass

if __name__ == '__main__':
try:
application = TutorialApplication()
application.go()
except ogre.OgreException, e:
print e

hizdudeness

05-04-2006 20:23:27

Hey thanks it actaully a little of each. I didnt have the directX stuff installed, and I wasnt saving into the ogre demo folder. Does the pyogre tutorials cover creating/ teaking a *cfg file? I'll do some googling if they dont.

dermont

05-04-2006 23:24:31

Check the C:\Python24\pyogre\ogre_demos\resources.cfg file. Everything should be setup. All you should need to change, if your running from another directory other than the demos, is the main path in resources.cfg. The path should be relative to your applications dir, e.g
- running from pyogre\ogre_demos ../media
- running from C:\Python24 pyogre/media


The ogre.cfg stores the config info you selected when starting the demos, e.g:
Render System OpenGL Rendering Subsystem
Colour Depth 32
Display Frequency N/A
FSAA 0
Full Screen No
VSync No
Video Mode 640 x 480

Sometimes it get's a bit funny if that is not there.

For the terrain.cfg:
http://www.ogre3d.org/wiki/index.php/Terrain_Scene_Manager

hizdudeness

06-04-2006 23:11:56

Hey I worked through the beginner tutorials in pyogre, and I have a couple of questions about design ( I can post these out to the content creators if need be)

I was wondering when desining a level say a open room with a box and a cylinder. If i'm not intending to move the items indavidually and they are going to be static would i be better off creating the whole scene (in max7) in one mesh. When exporting my mesh will my max lighing follow w/ the export?

Also I was wondering about setting up a first person view mode where the camera/view followed at a given height off of the terrain. Does the pyogre wiki cover information like this somwhere?

Also I tried dropping a mesh into the folder that had all of the other mesh files, and tried to load it up in ogre and didnt really have any luck so i guess i was curious as to where this information was.


How/where should I begin to research this?
I think if i can get rolling with this i should be off and running for a while.

Thanks your for the help so far.

-Chris

dermont

07-04-2006 11:04:06

1. What exporter are you using for max7?. Never used max 7 before. Maybe you should check with content creator.

2. The information is in resources.cfg. This file let's ogre know where your media files are such as meshes, overlays,zips etc. SampleFramwork.py loads the resources.cfg file, stores the locations/paths of your media and initialise the resouces via initialiseAllResourceGroups (i.e. parses scripts such as materials etc).

Check out SampleFramework.py to see how it's done:

def _setUpResources(self)
def _loadResources(self):


Also for more details:
http://www.ogre3d.org/docs/api/html/classOgre_1_1ResourceGroupManager.html#Ogre_1_1ResourceGroupManagera10

Now when you create an entity/ scenenode Ogre knows what/where 'yourmeshname.mesh' is and any material associated with it (assuming the material script / textures are in your media dir), eg:

node = sceneManager.rootSceneNode.createChildSceneNode()
entity = sceneManager.createEntity('head', 'yourmeshname.mesh')
node.attachObject(entity)



For your particular problem post the code of how you created your entity/node. Have you copied accross your material scripts and textures to media's dir materials/scripts and textures to materials/textures.

3. The TerrainDemo.py demo shows the camera/view following at a given height off of the terrain using RaySceneQuery.

hizdudeness

07-04-2006 18:06:06

Awsome. I think i'm just exporting wrong. I am modeling in max 7, and i was trying to export with the tool in the downloads section. It looks like ofusion is the way to go. I was having problems with figuring out how to get textures, lighting etc to show up in the ofusion window erlier. I'll go post around over there adn see what i can come up with. What it comes down to is its a ton of information to take in at once and I have to keep bouncing back and fourth between learning to model, and learning to program. I'm never sure if its my model being weird, or my lack of programin skills.

I was looking at the resources *cfg file and I was wondering what the [bootstrap] means at the top. More out of curiosity than out of needing to know.

If I wanted to create a folder where all of the python code, meshes, media etc was located how would I structure it. When I read from the resources cfg here it just says

FileSystem=../media/
If I wanted to say save everything to this directory

C:/python24/testcompile

Could I get away with just adding the sampleframework.py to this folder along with the cfg file, and then change the resource cfg to mirror where the files are at?

C:/python24/testcompile

Or is it more technical than that?

Once again Thank you for the help I'm learning a ton.