Hello,, im learning DotScene and i have a question.

mykeh13

28-02-2009 19:41:34

Hi

I downloaded the last update Andy post here, i found in ogre folder the Demo_dotscene.py file, i read this, and execute this is my code :
import sys
sys.path.insert(0,"..")
import ogre.renderer.OGRE as ogre
import SampleFramework as sf
import PythonOgreConfig
import os, sys
import dotscene as DotScene

class DotSceneApplication(sf.Application):

def _setUpResources(self):
sf.Application._setUpResources(self)
bases = ["./nmitm/mansion/2/pd"]
for base in bases:
for directory in os.listdir (base):
fullPath = os.path.join(base,directory)
if os.path.isdir(fullPath):
ogre.ResourceGroupManager.getSingleton().addResourceLocation(fullPath,"FileSystem","General")

def _createScene(self):
sceneManager = self.sceneManager
sceneManager.ambientLight = (.8,.8,.8)
camera = self.camera

self.pdNode = self.sceneManager.getRootSceneNode().createChildSceneNode("DotSceneRoot")
self.dotscene = DotScene.DotScene("./nmitm/mansion/2/pd/objects/pd.scene", self.sceneManager, self.pdNode)

camera.position = (0,0,0)
camera.lookAt (0,0,0)

def __del__(self):
del self.particleSystem2
sf.Application.__del__(self)

if __name__ == "__main__":
app = DotSceneApplication()
app.go()


In the "./nmitm/mansion/2/pd/objects/" folder are two subfolders with names : "textures" and "objects", where in textures i have copied all images, and in the "objects" i copied the meshes, the "pd.scene" file and the material file.

But when i try to execute the code i got this error.. :
Traceback (most recent call last):
File "C:\Documents and Settings\Administrador\Escritorio\Eclipse-works\Testing\src\pd.py", line 36, in <module>
app.go()
File "C:\Python25\lib\site-packages\ogre\renderer\OGRE\sf_OIS.py", line 100, in go
if not self._setUp():
File "C:\Python25\lib\site-packages\ogre\renderer\OGRE\sf_OIS.py", line 147, in _setUp
self._createScene()
File "C:\Documents and Settings\Administrador\Escritorio\Eclipse-works\Testing\src\pd.py", line 25, in _createScene
self.dotscene = DotScene.DotScene("./nmitm/mansion/2/pd/objects/pd.scene", self.sceneManager, self.pdNode)
TypeError: __init__() takes exactly 3 arguments (4 given)


What should be wrong since i copied all from Demo_dotscene .. thk for your time.

andy

01-03-2009 00:32:36

Did you copy the new dotscene.py from the demos/ogre directory to your test directory ??

Andy

mykeh13

01-03-2009 01:01:18

yes!, i have all modules in current directory...


This dotscene.py is that one content in your las update 1.6.1 post, so, i can deduce that is the last....

does what exactly those arguments means... is strange, i see three arguments not four...

andy

01-03-2009 02:07:04

The 4th argument is the implied 'self' -- have a look at your dotscene.py line 20 and you can see the constructor -- check that it shows.. def __init__ (self, fileName, sceneManager, rootNode=None, prefix = ''):
If that looks OK post your complete test program..

Thanks
Andy

mykeh13

01-03-2009 15:23:47

Hi !, finally work, a bit different... but work...the problem was that you mentioned, that line....

when execute script, In console i got those messages :
Finished parsing scripts for resource group Internal
Mesh: Loading muralla.mesh.
Texture: pd_0016.jpg: Loading 1 faces(PF_R8G8B8,1024x1024x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,1024x1024x1.
Mesh: Loading armario.mesh.
Texture: armario.jpg: Loading 1 faces(PF_R8G8B8,572x572x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,572x572x1.
Mesh: Loading barrera1.mesh.
Texture: pd_0020.jpg: Loading 1 faces(PF_R8G8B8,800x600x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,800x600x1.
Mesh: Loading Cube.753.mesh.
Mesh: Loading Cylinder.002.mesh.
could not attach: Cube.015
could not attach: Cylinder.540
Mesh: Loading Cube.008.mesh.
Mesh: Loading Plane.028.mesh.
could not attach: Plane.392
Mesh: Loading Plane.mesh.
Texture: mh_0006.jpg: Loading 1 faces(PF_R8G8B8,262x263x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,262x263x1.
added light: "Lamp.001"
added camera: "Camera" fov: 79.932426 type: perspective clipping: 100.000000,100000.000000
Mesh: Loading cocina_puerta.mesh.
Texture: pd_0017.jpg: Loading 1 faces(PF_R8G8B8,300x500x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,300x500x1.
Mesh: Loading tejado.mesh.
Error loading texture pd_0019.jpg. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource pd_0019.jpg in resource group General or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)
Error loading texture pd_0019.jpg. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource pd_0019.jpg in resource group General or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)
Mesh: Loading Plane.006.mesh.
Texture: lamp.png: Loading 1 faces(PF_A8R8G8B8,49x47x1) with 5 generated mipmaps from Image. Internal format is PF_A8R8G8B8,49x47x1.
Mesh: Loading lavabos_puerta.mesh.
Mesh: Loading piso.mesh.
Texture: piso.jpg: Loading 1 faces(PF_R8G8B8,900x585x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,900x585x1.
Mesh: Loading escritorio.mesh.
Texture: mantel.jpg: Loading 1 faces(PF_R8G8B8,320x240x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,320x240x1.
Texture: soporte_velador.jpg: Loading 1 faces(PF_R8G8B8,1024x677x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,1024x677x1.
Texture: velador_madera0.jpg: Loading 1 faces(PF_R8G8B8,1024x677x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,1024x677x1.
Mesh: Loading alfombra.mesh.
Texture: pd_0001.jpg: Loading 1 faces(PF_R8G8B8,2298x320x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,2298x320x1.
Mesh: Loading barrera3.mesh.
Mesh: Loading barrera2.mesh.
Mesh: Loading barra.mesh.
could not attach: barra
Mesh: Loading cuadro4.mesh.
Texture: cuadro_4.JPG: Loading 1 faces(PF_R8G8B8,143x121x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,143x121x1.
Mesh: Loading cuadro1.mesh.
Texture: cuadro_3.JPG: Loading 1 faces(PF_R8G8B8,135x88x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,135x88x1.
Mesh: Loading cuadro3.mesh.
Texture: pd_0006.jpg: Loading 1 faces(PF_R8G8B8,640x480x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,640x480x1.
Mesh: Loading cuadro2.mesh.
Texture: Cuadro_2.jpg: Loading 1 faces(PF_R8G8B8,420x323x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,420x323x1.
Mesh: Loading silla1.mesh.
Texture: pd_0008.jpg: Loading 1 faces(PF_R8G8B8,300x225x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,300x225x1.
Texture: pd_0014.jpg: Loading 1 faces(PF_R8G8B8,160x225x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,160x225x1.
Mesh: Loading silla2.mesh.
Mesh: Loading baranda.mesh.
Error loading texture barandas_1.jpg. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource barandas_1.jpg in resource group General or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)
Error loading texture barandas_1.jpg. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource barandas_1.jpg in resource group General or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)
Texture: barandas_0.jpg: Loading 1 faces(PF_R8G8B8,424x196x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,424x196x1.
Mesh: Loading mainhall_puerta.mesh.
Mesh: Loading Cylinder.001.mesh.
could not attach: Cylinder.537
Mesh: Loading marco4.mesh.
Mesh: Loading marco1.mesh.
Mesh: Loading marco2.mesh.
Mesh: Loading marco3.mesh.
added light: "Lamp"
Mesh: Loading barrera4.mesh.
Mesh: Loading pilar0.mesh.
Error loading texture pd_charms_grp.png. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource pd_charms_grp.png in resource group General or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)
Error loading texture pd_charms_grp.png. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource pd_charms_grp.png in resource group General or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)
Texture: pd_marmol0.jpg: Loading 1 faces(PF_R8G8B8,200x200x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,200x200x1.
Mesh: Loading pilar1.mesh.
Error loading texture pd_charms_grp.png. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource pd_charms_grp.png in resource group General or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)
Error loading texture pd_charms_grp.png. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource pd_charms_grp.png in resource group General or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 753)
added light: "Lamp.002"
Mesh: Loading baranda2.mesh.
could not attach: baranda2
ERROR in sf_OIS.py: Could not find overlay POCore/DebugOverlay
ERROR in sf_OIS.py: Could not find overlay POCore/DebugOverlay
ERROR in sf_OIS.py: Could not find overlay POCore/DebugOverlay


The problem is in-game window, as you can see this is the result of ogre scene proportion:


And this is how it must to be, like blender:



Anyway, i can suspect that the order problem is from scene file, and basically Blender's source problem. I think better to create a new scene in blender, to re-order database.

Thanks Andy !!

bharling

01-03-2009 19:32:47

make sure you do CTRL-A ( Apply scale and rotation ) on ALL your meshes before you export them, that should solve the problem,

mykeh13

01-03-2009 19:43:29

Fantastic!... thanks you two!!