Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DotScene usage scenarios #1892

Merged
merged 5 commits into from
Feb 19, 2021
Merged

Add DotScene usage scenarios #1892

merged 5 commits into from
Feb 19, 2021

Conversation

sercero
Copy link
Contributor

@sercero sercero commented Feb 17, 2021

I had a lot of trouble understanding how to use the Plugin, most of the information is in this thread: https://forums.ogre3d.org/viewtopic.php?t=96069 but it is not clear how to do it the modern way.
Eventually found the code in OgreSceneLoader.cpp, but new users should have an easier time using this important plugin.
If this gets accepted, I will see if the manual can be modified to put an example.

I had a lot of trouble understanding how to use the Plugin, most of the information is in this thread: https://forums.ogre3d.org/viewtopic.php?t=96069 but it is not clear how to do it the modern way.
Eventually found the code in OgreSceneLoader.cpp, but new users should have an easier time using this important plugin.
If this gets accepted, I will see if the manual can be modified to put an example.
PlugIns/DotScene/README.md Outdated Show resolved Hide resolved
PlugIns/DotScene/README.md Outdated Show resolved Hide resolved
PlugIns/DotScene/README.md Outdated Show resolved Hide resolved
@paroj
Copy link
Member

paroj commented Feb 17, 2021

note, I deprecated SceneLoaderManager after improving the Codec API, which it is now duplicating.

typically that nasty Codec::decode call would be encapsulated somewhere (like is the case for Mesh). However, I am not sure where to put it.
SceneManager::setWorldGeometry seems suitable, but it is currently very much tailored to loading BSP "worlds" - whereas you can encapsulated arbitrary chunks of your scene in .scene.

@sercero
Copy link
Contributor Author

sercero commented Feb 18, 2021

note, I deprecated SceneLoaderManager after improving the Codec API, which it is now duplicating.

typically that nasty Codec::decode call would be encapsulated somewhere (like is the case for Mesh). However, I am not sure where to put it.
SceneManager::setWorldGeometry seems suitable, but it is currently very much tailored to loading BSP "worlds" - whereas you can encapsulated arbitrary chunks of your scene in .scene.

I think the syntaxis should be something like this:

Ogre::DotSceneLoader *loader = new Ogre::DotSceneLoader();
loader->load("level.scene", "ResourceGroup", attachmentNode);

And behind the scenes there is the codec.

That seems to me like the most intuive way to do it...

@sercero
Copy link
Contributor Author

sercero commented Feb 18, 2021

I just tested the code: Codec::getCodec("scene")->decode(stream, attachmentNode);

With this code I don't need to link against libPlugin_DotScene as you said, but now it is using the Resource Group "General", so I can't specify a resource group for the scene.

@paroj
Copy link
Member

paroj commented Feb 18, 2021

it uses ResourceGroupManager::getSingleton().getWorldResourceGroupName() internally

@paroj
Copy link
Member

paroj commented Feb 18, 2021

I think the syntaxis should be something like this:

we cannot use the DotSceneLoader type or we would have to link against the plugin.

Also, the user should not care about the format, so both XXX.load("foo.scene") and XXX.load("foo.bsp") could work if the according plugin is present.

PlugIns/DotScene/README.md Outdated Show resolved Hide resolved
PlugIns/DotScene/README.md Outdated Show resolved Hide resolved
@paroj paroj merged commit a828f18 into OGRECave:master Feb 19, 2021
@sercero sercero deleted the patch-3 branch March 26, 2021 01:02
raymond-w-ko pushed a commit to syandus/ogre that referenced this pull request Jan 3, 2022
I had a lot of trouble understanding how to use the Plugin, most of the information is in this thread: https://forums.ogre3d.org/viewtopic.php?t=96069 but it is not clear how to do it the modern way.
Eventually found the code in OgreSceneLoader.cpp, but new users should have an easier time using this important plugin.
If this gets accepted, I will see if the manual can be modified to put an example.

Co-authored-by: Pavel Rojtberg <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants