STEAM GROUP
Blender Source Tools BleST
STEAM GROUP
Blender Source Tools BleST
208
IN-GAME
1,566
ONLINE
Founded
8 November, 2013
All Discussions > Help > Topic Details
[Suggestion] Better support for custom normals
Currently, when you import an SMD with custom normals, the model has it's smoothing groups intact, but at the cost of splitting apart each and every polygon in the model, which can make it very difficult to edit (which is what the tooltip warns you of), but it also causes the model's polygons to triangulate while the bones animate, and this shows up in the Source Engine, so this method of importing custom normals is almost not even worth using, IMO

So my suggestion, if it's even possible, is instead of splitting up each and every polygon, would it be possible to either
A) Import the SMD with it's smoothing groups using Blender's 'Sharp Edges'
or
B) Import the SMD with it's smoothing groups by splitting the edges only on faces that have normals that differ from neighboring faces
And when i say "splitting the edges", i mean like when you have edges selected, you press Ctrl + E and you select 'Split Edges' to separate the polygons via selected edges

Because having the edges of every polygon split apart makes it impossible to select multiple faces that are connected, and the triangulation while animating looks horrific
Last edited by Misterlegodude; 22 Sep, 2016 @ 3:10am
< >
Showing 1-4 of 4 comments
Zappy 22 Sep, 2016 @ 4:04am 
Artfunkel has explained that it would be way too hard to detect the normals of faces and split edges, both by the "A" and the "B" methods you propose, and even if they did manage to implement it, would you like to wait... I guess [an exponentially-increasing amount of time based on how many triangles are in the mesh] more than currently?

Additionally, normals can not only face directly outwards, they can face in any given direction, so if the model is using truly custom normals, they will be broken by both the A and B methods.

Personally, I highly prefer opening Blender twice, importing a mesh that's just smooth-shaded in one Blender and importing it with the normals intact in the other Blender, then manually splitting the edges of the mesh in the first Blender. That way, it will also look better when animated and such, I believe.
Misterlegodude 22 Sep, 2016 @ 5:20am 
It would take a varying amount of time for any other importer to import a model with smoothing groups, and while it increases import time to import the entire rest of a model, as well as splitting the faces on import, i'd be fine with that

For example, i have a Darth Vader model i want to edit that has 99 bones, 23,358 polygons, and about 23 materials, and is a total of 7.22 MB, importing it with custom normals only took 14.4 seconds

Blender has several other import options that can correctly import a model's normals, but those don't support armature, why is it that much of a problem to get proper normals with SMDs? They have all that data for each polygon in them, i'm sure it's not easy, but wouldn't there be a way to compare the normal data per-face and just split the edges wherever the values don't match?

And while i could just manually do edge splits, that would waste a TON more of one's time than just waiting about 5 or so extra seconds when importing

It's a 23k polygon model with so many nooks, crannies, and tiny doohickies, to use your method and search out all the sharp edges on this blob of a model would take a long time

I did a similar thing with the Master Chief model from Halo 3 and that took a while, but that model only has 5,066 polygons, so that was actually easy to do, it was just a little time consuming
Last edited by Misterlegodude; 22 Sep, 2016 @ 5:22am
Zappy 22 Sep, 2016 @ 6:12am 
Originally posted by Masterlegodude:
importing [a model with 23358 polygons] with custom normals only took 14.4 seconds
If it's an SMD, importing it with custom normals completely ignores connections of triangles. If it's not an SMD, it probably stores what parts are connected to what parts within itself, and then share the vertices.

Originally posted by Masterlegodude:
wouldn't there be a way to compare the normal data per-face and just split the edges wherever the values don't match?
That's what's so insanely difficult to implement and will take exponentially-increasing "insanely" long time to import and calculate.

Originally posted by Masterlegodude:
[SMDs] have all that data for each polygon in them,
No, they don't. (And SMDs don't even support polygons, only triangles. ("Poly" refers to "any amount of" or something, and "gon" refers to... like, "any shape", with "polygon" referring to a shape that can have any amount of edges/corners.))

SMDs store each triangle's material name and its 3 vertices' positions in the 3D world space, normals, UV mappings, bone weight rigging, etcetera, basically everything there is to know about the triangle (except which edges are "sharp", as that's redundant with every triangle storing custom normals of each vertice).
But the thing is... it stores every single triangle separately, and it doesn't even store which triangles are connected to each other. The Blender Source Tools merge/weld/whatever every vertice together that are close enough to each other... but this does not work right at all when the vertices have custom normals, thus the triangles of custom-normal-imported-SMDs aren't connected. (Go on, try importing an SMD with custom normals enabled, then select everything of it in Edit Mode and do the Remove Doubles thing.)
And it'd be even harder to properly load in the custom normals after merging the vertices than working around it and truly splitting the edges of sharp edges between triangles.

Remember, the Blender Source Tools are a script made by one(?) person, who doesn't get paid for it, and Blender isn't built around specifically supporting it, instead being the other way around, unlike some of the tools VALVe use for Source editing or such. Speaking of other tools, you can use another tool, import the SMD with something built by a team specifically for it, export it as a DMX, import the DMX into Blender, and that should be good enough. (DMX stores which polygons are connected just fine and also support custom normals, which Blender can then import with no problem.)
Artfunkel 22 Sep, 2016 @ 7:52am 
I don't try to reconstruct sharp edges because doing so is inaccurate. There is no guarantee that Blender's auto-generated normals will match the input data, especially if the artist has done clever things like having non-unit normal magnitudes or "brushing" normals in a particular direction.

The polys are disconnected due to a limitation of Blender. As Zappy pointed out, when you run the merge doubles operator it will completely change the topology of the model and result in messed up normals (if you have custom normals) or edges (if you have reconstructed sharp edges). There's nothing I can realistically do about that. The answer is to use DMX, which does not suffer from this issue.
< >
Showing 1-4 of 4 comments
Per page: 1530 50

All Discussions > Help > Topic Details
Date Posted: 22 Sep, 2016 @ 3:09am
Posts: 4