Jump to content

Double verts on nif export?


Grimoa

Recommended Posts

Hi!

 

So, I have created a mesh in Blender. It looks like this. All verts are connected.

 

http://img6.imagebanana.com/img/z0sk3eub/verts_problem01.jpg

 

I export it to a nif file. The file is 400KB and the NiTriShapeData says "num verts 2850".

Today I got a comment "Your verts aren't connected! Try remove doubles."

I'm like "what?" but try anyway. Select everything with "a" hit remove doubles. -> "removed: 0"

 

huh.

I re-import the nif to blender and get this:

 

http://img7.imagebanana.com/img/n7dow45r/verts_problem02.jpg

 

Remove doubles -> removed: 1950

this is what it looks like after removing doubles on the feet (but not the claws)

 

http://img7.imagebanana.com/img/lnipv8do/verts_problem03.jpg

 

0.o

Export as nif again. File size: 138KB, "num verts 748"

import to blender. Everything stays connected. And looks smooth as in the picture above.

 

Thinking back I already wondered what made my vanilla-mashups so much bigger in file size. I thought it was because I didn't cut away so much of the body underneath the closing and kept more seperate objects to assign the vanilla textures to.

 

So do I have to export - import - remove doubles - export for everything I do?

Does anyone know this problem?

 

Thanks for reading!

 

Oh before I forget. I used this tutorial for the export and import settings.

Edited by Grimoa
Link to comment
Share on other sites

Actually this explains a lot:

 

Picture one: Quads

http://img6.imagebanana.com/img/z0sk3eub/verts_problem01.jpg

 

Picture two: Tris

http://img7.imagebanana.com/img/n7dow45r/verts_problem02.jpg

 

When you export to .nif the Square polygons are split into Triangles but, aren't connected.

 

Fix: Convert the faces before export, easily done in Blender, Mesh > Face > Quad to Tri (ctrl T)

Edited by PopReference
Link to comment
Share on other sites

Ok, I tried that. After converting to tris and exporting nifskope says "num verts 3656". That's even more than when I exported from the quad version.

After re-import the tris arent connected and I can remove 3016 doubles.

In object view it didn't look all smooth (before removing doubles), it's more like in the very first picture only with triangle instead of quads.

After exporting to nif again I get 748 verts.

Which is the same as if I didn't triangulate before the first export. And therefore seems to be the correct number of verts in that mesh.

I'm a little tempted to count them of by hand. But.. nuh, not before breaktfast.

 

Anyways, you get a kudo for pointing this issue out. I'd give you a second one for trying to help if I could. :thumbsup:

 

 

 

Edit: Alright, I added a new cube and exported that.

-> 8 verts

 

still same cube (no reimporting) add material, texture, uv unwrap. export

-> 24 verts

huh?

 

reimport, remove 16 doubles, export

-> 20 verts.

 

>.<

 

One more edit: I can recreate the same with the femalebody and some clothes I've been working on (i.e. multiplied verts number on export) but my scarf and gugel mod does not seem to be effected. At least the vertex number is smaller on the mesh I cut parts off compared to the original.

What on earth did I do differently for that one?

Edited by Grimoa
Link to comment
Share on other sites

Game engine mesh formats vert count =/= your 3d apps vert count. The game format will create arrays for each type of vertex data, normals, coordinates, vertex color, UV. etc.

As each vert is assigned a number, all those arrays will equal the same amount of total verts. So if you count all the verts on your UV layout and it is more than the verts on mesh(due to UV seams for example) then that maybe the total number of verts on the mesh when it is exported to a game engine.

 

Example an 8 sided cylinder unwrapped like this

http://i25.photobucket.com/albums/c85/lego-botz/other/8sidedcylinder32verts.jpg

 

Is actually 34 verts. count them, and don't forget the 2 extra verts that make the seam down the side of the cylinder.

 

 

Things that will create extra vertices on a mesh at export to a game engine:

 

Hard edges create extra vertices. This is a lighting trick that allows a vertex to have more than one vertex normal. In game formats this trick does not exist and exporters will break those faces to acquire the extra verts needed to store those extra vertex normals. Your mesh is all hard edges therefore every face is split in effect doubling the vertex count. (triangulating the mesh instead of quads, will create more faces that are going to be split, assuming everything is a hard edge. )

 

Edges are split, creating extra vertices on material ID borders

 

Edges are split at UV seams.

 

An edge can only be split once, ie UV split and hard edge on the same edge do not stack, it only duplicates the verts one time.

 

http://www.ericchadwick.com/examples/provost/byf2_figure2.jpg

 

 

It's why placing hard edges and UV seams does not add any more vertices to a mesh than chamfering edges

http://artisaverb.info/Hygiene/SgSplits.jpg

 

Note that the hard edge( 2nd one) is the same number of verts as having 2 separate faces, which is exactly the same as chamfering that edge but keeping it on one smoothing group.

Edited by Ghogiel
Link to comment
Share on other sites

Wooooooow. Thank you!

 

This is... wow. That's why it looks smooth after I removed the doubles. That's why the cube suddenly exports with all those extra verts after I added a texture. I feared I'd broken my blender installation somehow. But no, it's working as it should be, it was just me not knowing what I did. Thanks for enlightning me.

 

Now I need to learn how to create meshes with hard edges and without hard edges on purpose. Back to reading tutorials :teehee:

 

Edit: SOmeone already told me in the mod's comments: Mesh ->Faces-> set smooth

I previously thought of the smooth modifier when I read that comment. :/

Edited by Grimoa
Link to comment
Share on other sites

 

 

Now I need to learn how to create meshes with hard edges and without hard edges on purpose.

This is entirely essential to set up correctly (along with accompanying UV splits where hard edges are) to get a good normal map bake and to avoid any shading errors when the tangent basis of the baker doesn't match the target renderer. (which is nearly always)

Link to comment
Share on other sites

Hmm... Does the nif exporter break up objects according to material in the later versions of the NIF format? Exporting to Oblivion does this, but I don't know about Fallout 3 or Skyrim. Edited by ziitch
Link to comment
Share on other sites

  • 3 weeks later...

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...