Using of Codec API for DotSceneLoader Topic is solved

Problems building or running the engine, queries about how to use features etc.
Post Reply
Pellaeon
Goblin
Posts: 230
Joined: Thu Apr 28, 2011 12:23 pm
x 28

Using of Codec API for DotSceneLoader

Post by Pellaeon »

Ogre Version: 1.12.11

In the new version the DotSceneLoader is deprecated. To be conform with the new version, I changed my code to load a scene file to the following:

Code: Select all

auto oldGroupName = ResourceGroupManager::getSingleton().getWorldResourceGroupName();
ResourceGroupManager::getSingleton().setWorldResourceGroupName(m_res_group_name);

Codec::getCodec("scene")->decode(Ogre::DataStreamPtr(Root::openFileStream(tuc::helpers::to_utf8(scene_file), m_res_group_name)), m_p_machine_tool);

ResourceGroupManager::getSingleton().setWorldResourceGroupName(oldGroupName);
I want to ask if this is the correct new way to do it or is there a shorter and more elegant solution?
Because the old way with the help of DotSceneLoader is a short one-liner:

Code: Select all

Ogre::SceneLoaderManager::getSingleton().load(tuc::helpers::to_utf8(scene_file), m_res_group_name, m_p_machine_tool);
paroj
OGRE Team Member
OGRE Team Member
Posts: 1994
Joined: Sun Mar 30, 2014 2:51 pm
x 1074
Contact:

Re: Using of Codec API for DotSceneLoader

Post by paroj »

yeah, I just had that the discussion here:
https://github.com/OGRECave/ogre/pull/1 ... -780546739

currently I am thinking of putting this into:

Code: Select all

SceneNode::loadChildren(String);
SceneNode::loadChildren(DataStreamPtr);
the problem currently is that this should replace that whole "World Geometry" concept (see e.g. BSP Sample) which has some deeper interaction with resource management, that the above API lacks.

Therefore I currently let you deal with the raw Codec API, so I dont have to revoke an API I just introduced as happened with SceneLoaderManager. You can always write a custom helper function after all..
Post Reply