ASnakeNeverDies

[PyFFI] Mesh optimization on export? Is it true, and if so, how to disable?

I was just googling around and found this:

I was reading through and noticed this at the end:

On 3/14/2011 at 7:27 PM, Arthmoor said:

I may be wrong about this but I think if you're using Blender and have the most recent PyFFI + Blender Nif Scripts, it already performs the necessary optimizations when you export the mesh.

If you're using 3DS Max, then I'm given to understand you need to run PyFFI to clear the mesh properly after you've done whatever you need to do to it in nifskope first.

I don't know if the kind of optimization it does could be done by hand, you'd probably want to ask Amorilia about that in the official PyFFI thread.

I was really surprised to learn this, because a couple of days ago I was having trouble exporting a sword mesh I modeled in Blender. For some reason, the number of vertices changed on export and I had no idea why. In my case, some vertices were duplicated rather than erased. My sword model is already very efficient, even more than the swords already found in the game, but has a lot of duplicated vertices (like the swords already found in the game) to define sharp edges.

In the end, I managed to solve most of the problem by re-exporting the exact same mesh with the Blender NIF Scripts for Blender 2.49B again, but there remains a difference in the form of a duplicated vertex in the scabbard I couldn't avoid after the export. The mesh in blender and the exported sword have the exact same amount of triangles (less than 900), but the exported one always has an extra vertex. It's no big deal now, but the first time I exported it, the sword ended up having shading problems because of some vertices that got removed and others cut, even though no such geometry was present in the source .blend file and I've no idea why re-exporting the same unchanged mesh solved the issue either.

Anyway, what I'd like to know is if there's a way to disable this PyFFI functionality and leave the meshes untouched on export? I'm a noob when it comes to 3D modelling, but I'd think experience modelers would prefer to optimize their meshes themselves. I didn't even knew what PyFFI was when I installed the Blender NIF Tools, I just thought of it as just another obscure requirement, but now that I know it actually makes judgement calls for the user I'm concerned about the fact that the version required for running the NIF export tool is not the latest one released. I'd appreciate if someone out there could shed some light here. I'm not even sure if what user Arthmoor said is true, but based on my results it makes sense to me.

Edited by ASnakeNeverDies
Better formatting.
1

Share this post


Link to post
Share on other sites

Heh, well, that's a quote from 5 years ago, pre-Skyrim so it's relating to Oblivion, where everyone was 'optimizing' everything they could get their hands on.

The PYFFI in the current version of NifScripts is just fine (no, you can't turn it off). What you're probably noticing is that quads in Blender get turned into Tris during export, and this can sometimes be noticable in a doubling of vertex information or stray vertices if you're already using Tris.

As long as you're creating your mesh in an optimized way, I wouldn't worry about it. By "in an optimized way" I mean working with quads, and using the Remove Doubles command on all your pieces. Unless you have too many verts to begin with, a few strays is not going to matter.

2

Share this post


Link to post
Share on other sites

Yes, you could say I create in "an optimized way". I do everything with quads and in the latest version of Blender. When the time comes, I triangulate the mesh with the appropriate modifier (for more control), check the shading is correct (and manually adjust edges if necessary) and then move to Blender 2.49B for animation and export.

Also, I Remove Doubles before applying the Edge Split modifier. I can't do it after that, because the intentionally duplicated vertices (by the Edge Split modifier) would get removed which would be an undesirable result. I know there's a new feature in recent versions of Blender, called "Auto-Smooth", that works to define smoothing groups, based on edge-angle values, without actually modifying the geometry, but older versions of Blender seem to be incompatible with it (I haven't tested enough yet).

Beyond that, the collisions and scabbard empty objects are already defined before switching versions, so all there's to do in 2.49B is to load the project, make the diffuse .DDS file the new texture and (if there's no need for animation) export the mesh.

Thankfully, one vertex, two vertices (or vertexes if you prefer) are no big deal. Thank you for your time Hanaisse!

1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now