Is there a script or anyway to re-calculate a figures normals?



  • @trepleen It's basically the same process for making conforming clothing for a specific figure. While I have done it before, I don't honestly think I'm qualified to be teaching anyone else how to do it. It should be relatively straightforward for you though. Since you're essentially using the same figure.


  • Banned

    Bump, anyone have a solution? I really need to fix this.



  • The only solution is really the group tool with option Revert Group Normals... there isn't anything else.

    There's no way to automate this, because normals are only well defined for a manifold closed geometry (like a sphere). Only for that geometry it's well defined what's "inside" and "outside".

    For a non-manifold geometry (like a strip) there's no mathematical inside or outside. Even worse, if you take that strip, twist it and join the ends, now you have a surface that only has 1 side (you can write both "sides" of surface with a pencil without ever leaving the surface). So if you take a sphere and poke a hole in it, it automatically loses the "inside" and "outside" property.

    Therefore, anything else other than simple closed manifold volumes don't have well-defined normals and it's up to the human user to choose which sides are "in" or "out" based on some psychological thought (like imagining that the hole in the sphere does not exist, and then create the normals as if the sphere was solid, then put the hole back in... it's just a mind trick that works in some situations but not others ... it will not work if the hole covers say 99% of the sphere)


  • Banned

    Revert Group Normals only flips the normals, it does not re-calculate the surface.

    Also, in regards to your normals explanation. I can export the figure as an OBJ and when I re-import that OBJ the normals are fixed.

    There are three things you can do with normals.

    1. You can make them face outwards.
    2. Flip them inwards
    3. Calculate their surface in relation to the polygons next to them so shading is perfect.

    I need to do #3 ...



  • What do you mean recalculate normals? A normal does not have a strength. It's just a direction.
    The term "recalculate normals" usually just means some heuristic procedure to flip them through the surface to make them consistent. In the OBJ importer that the option "Make Normals Consistent" option.

    Poser (and any other 3D graphics software) doesn't keep any explicit information about normals. It keeps a vertex order. So given 3 vertices #1, #2, #3, this makes the normal pointing one direction: <#1, #2, #3>, while this makes the normal to point the other way <#1, #3, #2>.

    Poser (and IBM PC 3D graphic hardware, don't know if all of them do the same) use a right-hand rule for vertex order to define the direction of the normal.

    I suspect what you're asking is about a function to reproduce the heuristic flipping done with "Make Normals Consistent" option. But that's exactly the same thing as doing the same manually via Flip Normal in group editor. I've read the whole Poser API and never found any such function for a script.



  • By the way, if you're having problems with shading, the reason may be that your mesh is disconnected instead of normals; try to use the option Weld in Group editor to weld disconnected vertices; careful to not weld body parts; the shader algorithm requires that edges be shared with different faces in order for the shading to be smooth; if the edges are disconnected (for the reason the mesh is disconnected) it will disable the smooth shading and the mesh it will look blocky.



  • (another btw, if the mesh is fixed through OBJ import, the reason may be to the option Weld Identical Vertices in the OBJ importer; that is really the same as Weld in group editor; if the OBJ import gives a bad-looking mesh when you disable Weld Identical Vertices option, that confirms this theory)


  • Poser Ambassadors

    @trepleen - you know that Poser does multi-resolution morphs? Try setting the mesh to Unimesh, adding a level of subdivision, then GoZ. Obviously don't change subD levels in Zbrush. There is an option to bake to lower subD levels too.

    No idea if this will solve it but might be worth experimenting with. Like other posters, I'm not aware of any way of getting Poser to recalculate normals.


  • Banned

    @fbs7 said in Is there a script or anyway to re-calculate a figures normals?:

    What do you mean recalculate normals? A normal does not have a strength. It's just a direction.

    I need the directions to be re-calculated so the shading is perfect.

    In 3d studio max you can adjust the normal direction so that two separate objects can share perfectly directed normals so there are no shading anomalies.

    There are two concepts here.

    1. Flipping normals
    2. UNIFYING normals

    In this video he is unifying the normals between two objects manually. He could've used the unify normals option under the normals modifier.

    Back to poser.

    When you morph geometry too much via Zbrush GOZ, sometimes the normals get thrown off and need to be re-calculated. All human figures in poser are made up of body parts that are not welded so the normals between body parts have to be perfect or else there will be shading problems.

    The term "recalculate normals" usually just means some heuristic procedure to flip them through the surface to make them consistent. In the OBJ importer that the option "Make Normals Consistent" option.

    Yes, you're referring to FLIPPING normals, but there is also a concept called UNIFYING normals. It's common when you have two separate meshes.

    Let's take the right shoulder & right collar of a human figure in poser. They are technically two separate meshes. If you modify the geometry too much in that area via Zbrush, the normals get thrown off and need to be unified.

    Now, Poser actually has the option to UNIFY normals, but it's only available when importing an OBJ.

    I suspect what you're asking is about a function to reproduce the heuristic flipping done with "Make Normals Consistent" option. But that's exactly the same thing as doing the same manually via Flip Normal in group editor. I've read the whole Poser API and never found any such function for a script.

    No, I'm not talking about flipping.

    I'm talking about unify normals between two separate pieces of geometry which is how human figures work in Poser.


  • Banned

    @caisson said in Is there a script or anyway to re-calculate a figures normals?:

    @trepleen - you know that Poser does multi-resolution morphs? Try setting the mesh to Unimesh, adding a level of subdivision, then GoZ. Obviously don't change subD levels in Zbrush. There is an option to bake to lower subD levels too.

    No idea if this will solve it but might be worth experimenting with. Like other posters, I'm not aware of any way of getting Poser to recalculate normals.

    OMG DUDE IT WORKED. Simply changing the figure to UNIMESH forced the model to have it's normals re-calculated.

    YOU ARE A GOD BRO. THANK YOU SO MUCH!!!!!!!!

    The shading problems inbetween body parts that had too much morphing now have their normals fixed.

    I hope Poser eventually adds a feature that does this normal re-calculation with the press of a button for people who rely on heavy zbrush & GOZ morphs.


  • Poser Ambassadors

    @trepleen - educated guess is all, I use subD surfaces a lot. The base mesh is just a cage - it can look rough as hell, but it's just used as the basis for calculating the surface to be rendered.

    Glad you're up & running!


  • Banned

    @caisson said in Is there a script or anyway to re-calculate a figures normals?:

    @trepleen - educated guess is all, I use subD surfaces a lot. The base mesh is just a cage - it can look rough as hell, but it's just used as the basis for calculating the surface to be rendered.

    Glad you're up & running!

    Hopefully Poser adds a feature in the future to just re-calculate normals from the figure option window at the top. Even a script would be great.

    This is very important for people who morph their figures heavily in Zbrush via GOZ from Poser.

    I'm going to explain this problem in depth for everyone so people can find it via google.

    Let's take G2Jessi. She's a human figure in poser. All human figures in poser are made up of separate geometry. This means the RightCollar is actually separate at the vertex level from RightShoulder. Those two meshes don't have their vertex welded. If you export the figure to Zbrush GOZ and modify the geometry where the two body parts are not welded too much, you'll get a problem with shading in regards to the normals, so they need to be re-calculated or unified which is what it's called in 3d studio max. This problem only happens when you morph the areas inbetween body parts TOO MUCH, but sometimes that's necessary.

    If anyone knows ANY other way to force a figure to re-calculate it's normals please let me know. It would be ideal to just have a button or script I can run that does this.

    I now know of two ways to re-calculate aka unify normals in poser.

    1. Export the figure as OBj and re-import it using the OBJ import option to re-calculate normals.
    2. Switch the figure's skinning from poser traditional to poser unimesh.

    Ideally it would be best to just have a script that does this or a button I can push that just re-calculates normals. The functionality is already in poser, it just needs to be made into a feature for people who use a lot of Zbrushing to morph figures.



  • @trepleen And checking normals BEFORE you export them from GoZ is not an option because... ????


  • Poser Ambassadors

    @trepleen I use GoZ all the time and never have this problem. Do you select By Material or Bodypart when sending it to zbrush?


  • Banned

    @Ghostman said in Is there a script or anyway to re-calculate a figures normals?:

    @trepleen I use GoZ all the time and never have this problem. Do you select By Material or Bodypart when sending it to zbrush?

    Body part. Should I be exporting as material?

    I do A LOT of morphing and in many cases the changes I make have drastically changed the figure.

    The problem rarely happens for me, but it happens enough where it's annoying. It'd be nice to have a solution to re-calculate the normals.


  • Poser Ambassadors

    Actually Poser apply its own normal map when importing an OBJ into Poser. Even if the model has a normal map or not. So perfecting a normal map in a external modeling program is really a waste of time.


  • Poser Ambassadors

    @trepleen I always do it with Material. Everything is welded as well with this option. ;)



  • Hmm... I see what you're saying. That's actually a good point.

    You're talking about Vertex Normals, not Face Normals. A Vertex Normal is a true vector (used for shading), so it has direction and strength, while a Face Normal is just a vertex order (used to determine visibility of the triangle).

    The operation that 3DS Max calls Unify takes just makes vertex normals the same for vertices in same positions. That way the objects will have similar smoothing even if the vertices are split.

    The Poser GUI doesn't give any methods for calculating Vertex Normals, only Face Normals. The API doesn't give any methods either; there's a single read-only method to get the list of vertex normals (called Geometry.Normals()), but no methods to manipulate them. When you create an object in the API you don't specify any vertex normals.

    So it may be that Poser doesns't keep vertex normals internally, but calculates them on the fly (there's an algorithm for that). If so then such request would be impossible to fufill.

    But I have noticed the artifact you referred to in several figures, when the skin seems to have seams between body parts at some extreme morphing or bending angles. That's probably due to the vertex normals getting slightly different at the seams between different body parts. So it may be useful to request SM to create an option to as you say "unify" the vertex normals (that is, realign them), like say a checkbox for the figure. That might help rendering quality at high morphing or extreme - at very least would get rid of these irritating seam lines in the skin.


  • Banned

    @Batman said in Is there a script or anyway to re-calculate a figures normals?:

    Actually Poser apply its own normal map when importing an OBJ into Poser. Even if the model has a normal map or not. So perfecting a normal map in a external modeling program is really a waste of time.

    I wasn't creating a normal map. I was just moving around geometry to make the character look different for the face & body.

    @Ghostman said in Is there a script or anyway to re-calculate a figures normals?:

    @trepleen I always do it with Material. Everything is welded as well with this option. ;)

    I'm going to start doing it by material only and see if this makes the problem not even happen in the first place.

    But I have noticed the artifact you referred to in several figures, when the skin seems to have seams between body parts at some extreme morphing or bending angles. That's probably due to the vertex normals getting slightly different at the seams between different body parts. So it may be useful to request SM to create an option to as you say "unify" the vertex normals (that is, realign them), like say a checkbox for the figure. That might help rendering quality at high morphing or extreme - at very least would get rid of these irritating seam lines in the skin.

    That would be great. Fortunately doing Figure ---> Skinning Method ---> Poser UniMesh will unify the the vertex normals for now, thank goodness.

    You have a very thorough explanation! Very good for clarity on this issue.


  • Banned

    This post is deleted!