Home Technical Talk

UVs distortion on mirrored geometry when SI to Max exporting

polycounter lvl 13
Offline / Send Message
pasha_sevez polycounter lvl 13
Rather strange trouble occurs every time I export my geometry from SI 2011 to Max 2009. The issue can be described by the following pictures.

1) Say, I create a half of a sphere and unwrap it.
42691744.jpg

2) Create a COPY (not CLONE!) of it and mirror the geometry via negitive scale along X axis.
99543858.jpg

3) Fix the right half's UVs by mirroring them along U axis.
35227510.jpg

4) Merge both parts and weld border points.
61773463.jpg

5) Export geometry to FBX via Crosswalk.
86648518.jpg

6) Import FBX to Max (FBX ver. 2011.1)
31315069.jpg

7) When I put a checker on my geo the squashed unwrap on the mirrired part of the mesh becomes visible.
77252368.jpg

This is very strange issue because ONLY mirrored polygons! Is there any way to force XSI somehow reset mirrored state of geometry??
BTW there's no such problem with OBJ but it doesn't export smooth groups from XSI.

8) Anyway the squashed UVs can be fixed up using Unwarp Tools Max Script.
62627505.jpg

9) I press index rotate button several times until get an adequate result.
39623179.jpg

Anyway - it's just a palliative not a cure. Anybody know how to solve this problem?

Replies

  • Neox
    Options
    Online / Send Message
    Neox godlike master sticky
    do you have to use fbx for a given reason? if not try obj

    oh well should have read better, why doesn't the obj exporter export the normals right? some settings you could try out to transfer them correctly?
  • pasha_sevez
    Options
    Offline / Send Message
    pasha_sevez polycounter lvl 13
    I see no options on OBJ export dialog:\
    80998953.jpg

    While Max's obj import dialog offers importing smoothing groups!
    41129118.jpg

    But no smoothing groups appear to be in the result.
    23840506.jpg
  • Neox
    Options
    Online / Send Message
    Neox godlike master sticky
    i guess this is because no smoothinggroups are exported, so my question would be: are there any other OBJ exporter plugins for XSI?
  • pasha_sevez
    Options
    Offline / Send Message
    pasha_sevez polycounter lvl 13
    Probably I should try to update Crosswalk and export via dotXSI... I'll try tonight
  • pasha_sevez
    Options
    Offline / Send Message
    pasha_sevez polycounter lvl 13
    The most interesting is HOW and WHERE does SI store the polygon's "mirrored flag"? Neither Freezing nor any other operations (known to me) makes "mirrored" polygon normal! That's real question :)
  • cryrid
    Options
    Offline / Send Message
    cryrid interpolator
    I've read and reread the thread a few times, and I still can't make out what you're doing or what the problem is, even with the pictures. I will say this though:

    1) Don't scale -1 to flip the object. This looks ok by default viewport settings, but if you enable backface culling you'll see how it really tends to mess with the object's normals. Instead go to edit>duplicate/instantiate>duplicate symmetry.

    2) When you merge the objects, be sure to freeze the result and delete the input meshes.
    are there any other OBJ exporter plugins for XSI?
    I don't think XSI is at issue here. The 'usernormals' flag is checked and would handle his hard edges the way it is supposed to. Instead I think it is that he is using Max 2009, and from what I can tell support for vertex normals wasn't added to obj import until Max 2010 (http://forums.cgsociety.org/showthread.php?t=816006)
  • pasha_sevez
    Options
    Offline / Send Message
    pasha_sevez polycounter lvl 13
    cryrid wrote: »
    I've read and reread the thread a few times, and I still can't make out what you're doing or what the problem is, even with the pictures.

    I'm doing a typical game model with some symmetrical elements and smooth groups. Nothing special =)
    cryrid wrote: »
    I will say this though:
    1) Don't scale -1 to flip the object. This looks ok by default viewport settings, but if you enable backface culling you'll see how it really tends to mess with the object's normals. Instead go to edit>duplicate/instantiate>duplicate symmetry.

    "Duplicate symmetry" = "Duplicate" + "Negative Scale" + "Freeze Scaling" so it doesn't help. I know that when we negative scale a model its normals are getting inverted - it can be solved by "Freeze scaling". But it's still not an aid.
    cryrid wrote: »
    2) When you merge the objects, be sure to freeze the result and delete the input meshes.

    Done!
    cryrid wrote: »
    I don't think XSI is at issue here. The 'usernormals' flag is checked and would handle his hard edges the way it is supposed to. Instead I think it is that he is using Max 2009, and from what I can tell support for vertex normals wasn't added to obj import until Max 2010 (http://forums.cgsociety.org/showthread.php?t=816006)

    I've tried to prove your statement but it seems to be faulty - in Max's 2011 OBJ import dialog we can see that OBJ exported from XSI doesn't contain any Smoothing Group information.

    SEE ATTACHMENT!

    I've updated crosswalk and gathered have some interesting facts:

    1. dotXSI 6.0 format transfers UVs correctly but either without normals at all or with frozen/baked/implicit normals.

    2. Collada 1.4.1 (DAE) - the same as 1.

    3. OBJ transfers UVs correctly but as one smoothing group, i.e. no smg info included in OBJ.

    4. FBX transfers smoothing groups fine but UVs are corrupted/"index-rotated".

    5. If I mirror the half of the model and export two halves without merging everything seems to be imported fine! Also mirrired geometry transfers correctly. The trouble appears only when I merge two parts together.

    6. The only working solution I found in this situation is to press "Polygon Cycle CW" 3 times (the same number as it is in Max if I need to fix UVs). Although the mirrored part of the mesh becomes visually messed up in SI's vieport - it moves absolutely fine to Max via FBX (2011.1-2011.5).


    So the questions are still not answered -

    what happens to mesh when mirroring?
    why should I change UV enumeration via Index rotation to get correct result?
  • cryrid
    Options
    Offline / Send Message
    cryrid interpolator
    I've tried to prove your statement but it seems to be faulty - in Max's 2011 OBJ import dialog we can see that OBJ exported from XSI doesn't contain any Smoothing Group information.
    SEE ATTACHMENT!

    You don't want to import the smoothing groups (which I think is a Max-only thing?), you want to import the user/vertex normals (the option above it).
    Just tested:
    usernormals_si2max.jpg
  • pasha_sevez
    Options
    Offline / Send Message
    pasha_sevez polycounter lvl 13
    cryrid wrote: »
    You don't want to import the smoothing groups (which I think is a Max-only thing?), you want to import the user/vertex normals (the option above it).
    Just tested:

    Vice versa ;) I need only smoothing groups (which are max only thing - you're right) because our engine supports only smoothing groups but not user defined/custom normals - as you show in your example ((

    FBX converts hard edges to smoothing groups rather correctly (sometimes it gets stuck on "mixed"/complex smoothing groups - see attach) - without fixed normals.
  • pasha_sevez
    Options
    Offline / Send Message
    pasha_sevez polycounter lvl 13
    I've solved a problem finally! I've written two scripts. One - for XSI to export data, another one - for Max to import it!
  • pasha_sevez
    Options
    Offline / Send Message
    pasha_sevez polycounter lvl 13
    The main idea of solution is to create second UV set where UV islands' borders are the hard edges of the mesh (via Unfold). Then we export the mesh to two OBJs with different UV sets. In max - first we process the mesh with unfolded UVs - via TexTools' "Smoothing Groups from UV" algorithm (i've ripped a part of it into importer script for full automation). Then we copy the original UV set into the mesh with correct smoothing groups. That's it!
    So we can correctly move mesh from XSI to MAX without loosing smoothing groups and getting UV errors on the mirrored part of the mesh!

    Now in details.

    Original mesh in XSI. Symmetrical - right half is a mirrored left one. There are many hard edges.
    origmesh.jpg

    Mesh with second UV set via Unfold: UV islands' borders = hard edges.
    unfoldedmesh.jpg

    Mesh imported to Max. All hard edges are preserved and UVs are correct!
    maxmesh.jpg

    Now about scripts. I called them for myself XSI2MAX_TRANS.
    The first part is an exporter script for XSI - XSI2MAX_TRANS.js
    Copy it to where you want (usually - <you user SI dir>\Data\Scripts) and drag it to any toolbar. Click OK. Now you have a new button.
    xsitoolbar.jpg

    The second part is a script for Max. Copy Get_mesh_from_XSI.mcr to your user macros dir, usually C:\Users\<your_account>\AppData\Local\Autodesk\3dsMax\20xx - xxbit\enu\UI\usermacros (this is Win7 path, XP may have another). IMPORTANT: If you're using Max 2009 or earlier version - also copy gw_objimp_xsi2max.cfg to C:\Users\<your_account>\AppData\Local\Autodesk\3dsMax\2009 - xxbit\enu\plugcfg! Now run Max and go to Customize menu. Here drag and drop new "Get mesh from XSI" button to any toolbar.

    maxtoolbar.jpg

    Now select your mesh in XSI and click XSI2MAX_TRANS button. Switch to Max and click "From XSI". You should get your model with correct smoothing groups and UVs. That's it!

    Some info about exporter.

    1. Max's importer uses a part or TexTools script to make smoothing groups from UVs. Creditns to it's respected authors.

    2. The communication between apps is done via two files:
    c:\XSI2MAX_MESH_SG.obj and c:\XSI2MAX_MESH_UV.obj

    3. The problem of "mixed" smoothed groups is still actual - but FBX also can't process them correctly.

    Hope it will help someone facing the same problem as I did :))
  • pasha_sevez
    Options
    Offline / Send Message
    pasha_sevez polycounter lvl 13
    It seems like I've forgot to upload the scripts :)

    XSI2MAX_TRANS DOWNLOAD LINK
Sign In or Register to comment.