Serialize mesh to stream

Problems building or running the engine, queries about how to use features etc.
Post Reply
SamJ
Halfling
Posts: 40
Joined: Tue Jan 25, 2011 9:12 pm

Serialize mesh to stream

Post by SamJ » Tue Apr 12, 2011 12:58 am

MeshSerializer doesn't have a method to save a serialized mesh to a stream. There has to be a way to save a mesh to a stream without having to save it to disk and then read it. How do people do that?

And would you guys accept a patch that adds an overload? (Last time I asked this about a patch I got no answer, do ogre developers read this forum?)
0 x

User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US

Re: Serialize mesh to stream

Post by xavier » Tue Apr 12, 2011 3:42 am

Patches go into the patch tracker; while it's certainly a good idea to bring it up here, the forums are not the place to post patches.

And yes, the Ogre team does read this forums and others. ;)
0 x
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.

SamJ
Halfling
Posts: 40
Joined: Tue Jan 25, 2011 9:12 pm

Re: Serialize mesh to stream

Post by SamJ » Tue Apr 12, 2011 1:17 pm

Yeah, I understand where to submit patches. The thing is, if it's not gonna be included I'm not gonna waste time writing a patch, in that case I prefer just hacking a solution up in my application space because I don't wanna be applying patches every time I build a new version of Ogre.

So I still need to ask in the forum, right? The website says in case of bug to submit a patch first (which is risky cause if it's not gonna be accepted it's a waste of time) *or* discuss it in the forums which is what I'm doing. Then again this is not a bug but a feature request so more of a reason to ask here. Or should I create a issue in mantis to ask about this? I also asked in irc and they told me that there are no developers usually there.
0 x

User avatar
Chris Jones
Lich
Posts: 1742
Joined: Tue Apr 05, 2005 1:11 pm
Location: Gosport, South England

Re: Serialize mesh to stream

Post by Chris Jones » Tue Apr 12, 2011 2:51 pm

I think it's a good idea to discuss things like this in the forum first. I don't really know what question xavier was replying to, probably just saw something about patches and assumed...

A stream overload sounds good though but i'd wait for some other replies on this first i guess. By stream do you mean a std stream or Ogre's?
0 x

User avatar
madmarx
OGRE Expert User
OGRE Expert User
Posts: 1668
Joined: Mon Jan 21, 2008 10:26 pm

Re: Serialize mesh to stream

Post by madmarx » Tue Apr 12, 2011 8:30 pm

I consider that if I were to write some mesh-merging optimisator, or modeler, I would appreciate to be able to write to a stream.
Personnaly, I would prefer std::stream, but this only is very personnal at this point.

I think that if you write it as a good patch (meaning tested, without crazy design), I don't see why it would be refused.
0 x
Tutorials + Ogre searchable API + more for Ogre1.7 : http://sourceforge.net/projects/so3dtools/
Corresponding thread : http://www.ogre3d.org/forums/viewtopic. ... 93&start=0

SamJ
Halfling
Posts: 40
Joined: Tue Jan 25, 2011 9:12 pm

Re: Serialize mesh to stream

Post by SamJ » Tue Apr 12, 2011 10:08 pm

Chris Jones wrote:I think it's a good idea to discuss things like this in the forum first. I don't really know what question xavier was replying to, probably just saw something about patches and assumed...

A stream overload sounds good though but i'd wait for some other replies on this first i guess. By stream do you mean a std stream or Ogre's?
Well I would prefer a std stream, unfortunately Ogre uses its own stream everywhere so I don't think that's desired by the designers, so I was willing to compromise.

I don't like how Ogre wants to use its resource manager/datastream type for everything and forces you to center your application around them (even though the authors insist that Ogre is only a graphic engine), it's awful for applications with dynamic content. I used other engine before ogre that had a std::stream overload for everything, it was a pleasure to integrate.
0 x

SamJ
Halfling
Posts: 40
Joined: Tue Jan 25, 2011 9:12 pm

Re: Serialize mesh to stream

Post by SamJ » Tue Apr 12, 2011 10:25 pm

I did some reading of the code. Turns out the whole serialization infrastructure of ogre" OgreSerializer.cpp" depends on dozens of functions that use fput and fpuc to write contents to a file descriptor :shock: . I didn't expect ogre to be so C-ish in its guts. Anyway, I don't mind doing the overhaul but this would be too big a patch to do without confirmation that it would be included and I don't see any developers around to confirm (it's not only this thread, see:
http://www.ogre3d.org/forums/viewtopic.php?f=3&t=64180
and http://www.ogre3d.org/forums/viewtopic.php?f=1&t=64023 Although in the second one I realized I could achieve my purpose through extension so nvm that one, but still I got no answer to a patch offer in both cases. I guess maybe Ogre is like the linux kernel in that they get too many patches?

So I guess I'll have to save to a file in a temporary folder, create a std::stream from it and then delete it :( That's sad.
0 x

Post Reply