Manipulating materials in terrain scene manager

bigjhnny

09-04-2006 06:00:27

The OGRE api for terrain scene manager mentions that there is a method:


sceneManager.getTerrainMaterial()


http://www.ogre3d.org/docs/api/html/classOgre_1_1TerrainSceneManager.html#Ogre_1_1TerrainSceneManagera43

which returns the material used by the terrain

I tried in pyogre using

sceneManager.getTerrainMaterial()
or
sceneManager.terrainMaterial


Either is a valid attribute of the scene manager....

Do I need to manually cast the scene manager to a terrain scene manager some way?

I would like to add another pass to the terrain material to display a grid, mentioned in this thread:
http://www.ogre3d.org/phpBB2/viewtopic.php?t=14928&highlight=grid

Thanks in advance.

dermont

09-04-2006 10:23:26

Sorry I don't think you can do this. pOgre only currently supports attributes for:

http://www.ogre3d.org/docs/api/html/classOgre_1_1SceneManager.html
- additional basic types int,real,boolean,string using:
sceneManager.getOption("attribute")
sceneManager.setOption("attribute")

Looking at the TerrainSceneManager.cpp there doesn't appear to be a
getOption("TerrainMaterial").

bigjhnny

09-04-2006 18:19:00

Sorry for the flood of questions. After porting my test app to use pyogre1.2, I get the following:


texState.textureAddressingMode = ogre.TextureUnitState.TAM_CLAMP
TypeError: in method 'TextureUnitState_textureAddressingMode_set', argument 2 of type 'Ogre::TextureUnitState::UVWAddressingMode'


How should I port this to be compatible with ogre1.2?

I was basically following the projective decal tutorial and texState is created like this:


...
texState = _pass.createTextureUnitState('Decal.png')
texState.setProjectiveTexturing(True, self.decalFrustum)
texState.textureAddressingMode = ogre.TextureUnitState.TAM_CLAMP


Thanks

dermont

17-04-2006 11:04:15

Yep, sorry the createTextureUnitState needs to be updated. The patch to update pyOgre1.2 was only such that it compiles and runs.

There's still quite a bit to do in terms of functionality, updates and testing. I'll only be able to really start on these at the beginning of May.

I was hoping that since Clay will no longer be working on pyOgre that others would want to contribute.