python version of PCZ Scene Manager: zone removing problem

yubgipenguin

18-12-2008 22:50:43

It seems like sceneManager.destroyZone doesn't work since it's for C++ class object and python only passes python objects.

Or.. am I doing it wrong? Am I not supposed to use that function to remove a zone? If so how do I do it to remove a zone?

andy

18-12-2008 23:26:40

You will need to supply more information before we can help.. A snip it of Python code and the error you are having would help.. Something like:
DestroyNodes = False
PZSM.destroyZone ( PCZone, DestroyNodes )


Regards
Andy

yubgipenguin

18-12-2008 23:38:35

You can recreate this error very easily.

Open \PythonOgre\demos\ogrepcz\Demo_PCZ01.py

Search for code like this in def _createScene of class PCZTestApplication

terrain_cfg = "terrain.cfg"
zoneName ="Terrain0_Zone"
self.terrainZone = self.createTerrainZone(zoneName, terrain_cfg)


Add a line:

terrain_cfg = "terrain.cfg"
zoneName ="Terrain0_Zone"
self.terrainZone = self.createTerrainZone(zoneName, terrain_cfg)
self.sceneManager.destroyZone( self.terrainZone, True)
# or self.sceneManager.destroyZone( self.terrainZone, False)

It crashes without any error messages. (I know it's crashed because it triggers the Just In Time debugger for python.exe)


Switching sceneManager into pczSM, for example:

terrain_cfg = "terrain.cfg"
zoneName ="Terrain0_Zone"
self.terrainZone = self.createTerrainZone(zoneName, terrain_cfg)
self.pczSM.destroyZone( self.terrainZone, True)
# or self.pczSM.destroyZone( self.terrainZone, False)

does not help. (I have no idea what a difference is though lol there's no doc)

yubgipenguin

23-12-2008 10:41:07

anyone?

I wanted to fix it so I tried to build Python Ogre with no luck..
when I do buildmodule.py -g ogre I get this..

WARNING: std::vector<float, std::allocator<float> > [class]


> warning W1048: There are two or more aliases within


> "pyplusplus::aliases" namespace for the class. Py++ selected


> "LodDistanceList" as class alias. Other aliases: LodDistanceList,


> stdVectorFloat

Traceback (most recent call last):

File "generate_code.py", line 1281, in <module>

generate_code()

File "generate_code.py", line 1224, in generate_code

mb.build_code_creator (module_name='_ogre_' , doc_extractor= extractor )

File "C:\Python25\Lib\site-packages\pyplusplus\module_builder\builder.py", line 275, in build_code_creator

self.__code_creator = creator.create()

File "C:\Python25\Lib\site-packages\pyplusplus\module_creator\creator.py", line 354, in create

self.__dependencies_manager.inform_user()

File "C:\Python25\Lib\site-packages\pyplusplus\module_creator\dependencies_manager.py", line 194, in inform_user

used_not_exported_decls = self.__find_out_used_but_not_exported()

File "C:\Python25\Lib\site-packages\pyplusplus\module_creator\dependencies_manager.py", line 138, in __find_out_used_but_not_exported

if self.__has_unexposed_dependency( exported_ids, depend_on_decl, dependency ):

File "C:\Python25\Lib\site-packages\pyplusplus\module_creator\dependencies_manager.py", line 101, in __has_unexposed_dependency

value_type = sptr_traits.value_type( depend_on_decl )

File "generate_code.py", line 86, in value_type

return declarations.internal_type_traits.get_by_name( type, "element_type" )

AttributeError: 'module' object has no attribute 'internal_type_traits'


I really want to remove a zone so I can page terrain lol

andy

23-12-2008 11:08:31

I'm not sure if this is a bug in Python-Ogre as it's simply exposing the function -- perhaps you could hack the Ogre demo (C++) to see if it has the same issue.

Perhaps it is zone 0 and this can't be deleted ??

Andy

yubgipenguin

24-12-2008 03:50:49

Aww

I tried C++ version of PCZTestApp...

Oh yeah it crashes just the same.

For zone 0... I don't know but trying to delete secondly created zone crashes just the same.. maybe second zone also is some another root zone(zone 0?) well but no way to know unless I dig into source code..

I'll ask PCZSM guy..

Thanks.