OGRECave / ogitor

Ogitor SceneBuilder, the WYSIWYG scene editing environment for OGRE
MIT License
95 stars 31 forks source link

DotSceneSerializer: port to upstream plugin #20

Closed paroj closed 4 years ago

paroj commented 4 years ago

Ogre now comes with a .scene loader - we should use it here as well.

kPYKx7Ddw4n1aIKZ commented 4 years ago

I think this would be useful and possible, but not trivial. As far as I can tell, Ogitor can read and write .scene files. The Ogre .scene loader can only read them (if I'm not wrong) and populate them directly in a SceneNode. One could of course just keep the .scene files writing part and replace the reading part. Then different XML libraries (TinyXML and pugixml) would be used, which may not be a problem, but one could also port the writing part to pugixml. Furthermore, I think that some values are kept as metadata in Ogitor, so an abstraction might help.

paroj commented 4 years ago

making it use the ogre plugin has proved trivial (see PR). However restoring the metadata is not. The broken attempt that is checked in is as far as I could get without the whole input to silently fail.

On the plus side, the original code crashes when trying to import a blender2ogre generated .scene file.

kPYKx7Ddw4n1aIKZ commented 4 years ago

However restoring the metadata is not.

Thats why I think that it would make sense to introduce an abstraction (maybe in the code of the .scene loader plugin). Maybe some kind of data access object / data transfer object pattern or the strategy pattern would be suitable to easily access the metadata and improve reusability.

However, I don't know if that would fit into the existing class hierarchy for loading scenes in Ogre.

paroj commented 4 years ago

Thats why I think that it would make sense to introduce an abstraction (maybe in the code of the .scene loader plugin). Maybe some kind of data access object / data transfer object pattern or the strategy pattern would be suitable to easily access the metadata and improve reusability.

I think the need of such an intrusive mechanism is a design flaw on the ogitor side, which we should not give into.

Fortunately, I made was able to properly connect the metadata and importing the default blender scene now works.