Home Technical Talk

Why is exporting to xNormal so painful

polycounter
Offline / Send Message
Justo polycounter
The thing that drives me crazy about xNormal is that apparently every vertex index must be the same between the lowpoly and the cage; having the same number of vertices is not enough.

This means that if I have an exploded mesh, do some test bakes, decide to correct some UVs in another app and bring it back to Maya before exporting everything to xNormal, I'll get the "incorrect vertex index" problem. This actually only occurs to me when I re-do specific cages, since I guess this alters the vertex index.

I read through some threads but no clear solution is given (or rather the issue was different).

How do you artists go about this? Do you have any easy auto-reassign-vertex-index solutions in Maya?

Replies

  • Eric Chadwick
    Have you tried using a blend shape to update the vertex order? Use the newly-UVd mesh as the base model, and load the cage as a blend shape, then export that as your new cage.
  • Joopson
    Offline / Send Message
    Joopson quad damage
    I just make sure the low is completely done before duplicating it and making the cage. If I need to change something in the low, I simply remake the cage again once I'm done making the changes. Sometimes it's a pain, but I don't usually have to manually tweak my cages much at all, so at most, it's a couple of minutes extra.
  • Justo
    Offline / Send Message
    Justo polycounter
    @Eric Chadwick: I haven't used blend shapes in a while. May I ask if this is your personal workflow? I'll do some tests tomorrow, thanks for the suggestion.

    @Joopson: Yeah, this is what I usually (try to) do. After I think I'm finished with the lowpoly, I duplicate all meshes and make the cages, and do some test bakes. Because I cannot modify one mesh and export everything together since it'll mess up the vertex index, I'll fix all the bake problems exporting the respective meshes individually. Once I think I corrected all issues, I finally do another time all cages from 0 so that the vertex index gives no problem.

    In short:

    1-make the lowpoly and UVs.
    2-explode where needed and duplicate all meshes for the cages and bake.
    3-fix any issues separately (this is somewhat annoying, since you have to be very organized with files and concentrate you're not forgetting anything).
    4-make all cages again for the final bake.


    If anybody finds this a roundabout way of doing things, please chime in and correct me. I hear with Transfer Attributes you can skip step 4, which would be a great fix, though I do not know how that is done yet.
  • Eric Chadwick
    To explode I just animate the meshes. That way there's only one lowpoly and one highpoly.

    I don't use blend shapes unless there's a problem, and it doesn't always fix it anyhow. But yeah, cages are usually avoidable, or just a simple inflate. I use 3ds Max btw.

    You can also make the cage in Xnormal, but if you need to edit it a bunch then Maya/Max is a better bet.
  • Justo
    Offline / Send Message
    Justo polycounter
    But yeah, cages are usually avoidable

    B-but muh 90° projections will be l-lost...




    Well, I'm not making any massive manual tweaks to my cages, that would be torture considering I have to do multiple cages during the baking process. Like you said, it's just a basic inflate. The only areas I take a few extra seconds are close spaces like fingers.

    I also animate my lp and hp; the one thing that still bugs my workflow is that flexibility when fixing baking issues. I heard Knald didn't care about vertex index, but then again everyone says xNormal still gives better results even if by the smallest amount.

    I shall report back with hopefully cool fixes for anyone to read.
  • Joost
    Offline / Send Message
    Joost polycount sponsor
    I use a turn to mesh modifier with a projection modifier on top and then export as .sbm.
    I have heard of people having issues with .sbm but it works fine for me.
    I can't think of a faster way, short from automating things with a script.
  • CheeseOnToast
    Offline / Send Message
    CheeseOnToast greentooth
    Because I cannot modify one mesh and export everything together since it'll mess up the vertex index, I'll fix all the bake problems exporting the respective meshes individually.

    I still use Mop's old multi-obj exporter, which allows me to export all my meshes and cages at once. That won't get around your problem of having to remake cages, but that's only a minute's work, if that. If you use it, make sure you right-click one of your exported object names and edit the obj export options, which it will remember from then on. Grab the script from my dropbox here :

    https://dl.dropboxusercontent.com/u/1889770/mopMultiObjTool.mel
  • Justo
    Offline / Send Message
    Justo polycounter
    So I found a solution: I didn't know this until m4dcow pointed it out in the xNormal master thread, but apparently the order in which the LPs and cages are in the outliner is what changes the vertex index when exporting.

    So if we have the following two meshes

    A
    B

    and their respective cages

    a
    b

    if we're exporting the meshes A and B in that order, the cages should NOT be in this order when selected to export:

    b
    a

    This would alter the vertex index. The correct order would be "a" first and "b" later.


    Having said that, CheeseOnToast's mop script seems much easier to work with if you don't mind multiple obj files. Thanks a ton (and mop) for the contribution!!
Sign In or Register to comment.