-
Notifications
You must be signed in to change notification settings - Fork 70
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
Speed up export, skip xml #190
Comments
That would be nice, but there should be also an option to export the xml to inspect the resulting mesh and check for errors. Do you know how to export from phyton to .mesh directly? |
Right. |
that would be a bad idea. OgreNext can load v1 meshes, but Ogre cannot load v2 meshes, so you loose compatibility. Also, instead of re-implementing the binary format in python, you can just use the C++ implementation through the bindings: |
Hey guys, I did some tests to probe the waters before diving in too deep into exporting without going through the XML exporting process.
TESTExporting a Blenders base Sphere mesh with level 1 SubDiv: 11904 exported vertices
After profiling with cProfile it became clear that writing to the console was a mayor point of contention. Progress indicators commented out:
Exporting a Blenders base Sphere mesh with level 1 SubDiv: 11904 exported vertices
CONCLUSIONS:
|
As a result of the profiling, I have already found something to optimize: #199 |
nice findings! this shows that all optimization should start with profiling. For me As for the profiling: while introducing MockSaxWriter is a good start, it does not give a fair picture of the expected speedup as one of the major bottlenecks is constructing this string dict here: blender2ogre/io_ogre/ogre/mesh.py Lines 323 to 327 in b0c9578
where both the dict and the string parts are slow to do per vertex. Without XML, we could keep everything as binary numpy buffers. |
@paroj regarding switching to using OGRE directly to create the VertexBuffer, I think that there is some problem when trying to serialize the mesh to disk:
It seems that the function wants a *Ogre::Mesh, but I only have a Ogre::MeshPtr (a sharedptr) and the method getPointer() is deprecated (and missing) and the method get() (from sharedptr) is missing also. |
|
? |
note the extra parentheses to create a MeshSerializer instance instead of assuming a static method |
Well since it already came up on forum, I think this should be an issue.
https://forums.ogre3d.org/viewtopic.php?p=555617#p555617
Exporting isn't fast.
It's okay for single mesh (not too big) and exporting once a while. Anything more and it's a notable delay.
Best would be already wrting from python to .mesh binary not using xml.
The text was updated successfully, but these errors were encountered: