Home Technical Talk

3DS Max, reset x-form

Mr Whippy
polycounter lvl 7
Offline / Send Message
Mr Whippy polycounter lvl 7
So what exactly does the reset x-form do to a mesh?

I'm exporting an object here via ASE and it looks bad in my game engine.

Yet using a dedicated exporter (which I can't use in this project) and the mesh looks ok in game engine.

It looks fine in 3DS Max too.



So Max is storing something on the mesh that is important to how the mesh may appear if sent via ASE, but that data seems to be dumped via other formats like .3ds, or exported directly 'as you see the mesh' in the Max viewports direct to the game engine format.

This isn't inverted surfaces, but almost like normals are globally rotated 90deg or so in the rendering engine.



Is there any way in Max to repair an object, or at least see why it looks wrong in the viewport, so you can make a fix without using reset x-form (which can sometimes invert surfaces and also destroys the useful pivot alignment)?


Half my objects look fine, others have the issue showing. I can fix the instanced ones relatively trivially but the hundreds of others which have fairly complex pivots which I'd like to retain, means a blanket reset x-form is really not ideal.

I'm guessing this is all pivot and alignment related to start with... maybe the ASE format or the ASE parser is taking some data but not other data and rebuilding the mesh normals incorrectly... but that data must be coming from somewhere.
Being able to 'see' that data in Max would be great but everything looks fine, from normals to everything else.


Any help/advice would be much appreciated!

Thanks

Dave

Replies

  • sprunghunt
    Offline / Send Message
    sprunghunt polycounter
    reset Xform sets the rotation, position, and scale back to 0,0,0 or 100% without moving the vertexes. With ASE this shouldn't matter as I don't think ase exports the transform data anyway.
  • Noors
    Offline / Send Message
    Noors greentooth
    Well try to reset xform 1 object, see if it works.
    Then,
    http://www.paulneale.com/scripts/resetXform/PEN_resetXform.htm
    might be useful, it preserves the pivot.

    Some exporters are very picky with xform.
  • YdoUwant2know
    Offline / Send Message
    YdoUwant2know polycounter lvl 7
    Im not really sure about ASE files and what is/is not exported in them.

    An old trick that sometimes works when normal's get all messed up:

    Create box, and covert it to an editable poly.
    Attach the "broken" object to the box then erase the box.

    If you want to keep the same pivot point, then first align the box to the object pivot to pivot.


    Otherwise, if you have a couple of images you can share it might help. Best of luck.
  • Mr Whippy
    Offline / Send Message
    Mr Whippy polycounter lvl 7
    I think I figured it out.

    I need to test but so far I'm thinking that ASE *doesn't* export some Max properties that define the meshes current orientation in the Max world.


    At some stage I've probably done some odd things with these meshes. Basically it's about 500 road side signs so lots of copy/pasting, rotating, flipping, (no mirroring though), scaling in both object and sub-object mode etc.

    They all look fine in Max and ok if exported directly from Max, but clearly some important properties are not being sent via ASE, thus requiring the x-form reset to make the ASE see all the information properly.



    Noors, thank you for pointing that plugin out. I'll give it a shot. It could save me a lot of headaches here getting meshes that will export via ASE without problems but also retaining a nice axis alignment for later tweaking if necessary!


    YdoUwant2know, I tried that but without too much luck. I think you are right that it's pivot related somewhere along the line. A surprise really that ASE export doesn't include some kind of transform reset at export because without it it allows Max to export some bad meshes it seems.


    Sprunghunt, I assumed that is all reset x-form did, but it seems the issue really is with the ASE format not passing important data, or not being considered when the ASE normals definitions are being built.
    I suppose ASE isn't really a heavily supported format given the presence of FBX these days so tasks like resetting x-form seem reasonable fixes to get exports working right.
    It's just retaining nice pivots so hopefully I'll be able to figure out a nice way to keep those!


    Cheers for the help, I'll let you know how I get on.

    Dave
  • Mr Whippy
    Offline / Send Message
    Mr Whippy polycounter lvl 7
    Hmmm, resetting with the PEN tools with the pivot preserve box ticked and my pivot is not staying still haha, it's rotating as if I'd pressed reset x-form.

    I'm wondering now if the issue is that at some stage I've rotated the sub-object to tweak something and then I've also tweaked the pivot to get the alignment right. This means the mesh is all ok but there is a stack of orientation data that defines it that doesn't make it out of Max via ASE until the x-form is reset and bakes this other transform/pivot data into the mesh proper.


    I've had some luck simply cloning an instance of my instanced elements, rotating back to a nice orthographic orientation, resetting x-form, aligning the pivot nicely, then using it as a master to copy to other instances.


    However I have about 250 signs that are leaning or angled in several axis that are not instances of anything and resetting the pivot on them is gonna make tweaking them later a bit more time consuming.



    Does anyone know of a two-axis pivot reset tool? I have pivot2edge which works ok here to align one axis, but still leaves you having to do some funny pivot align work against extra ruler helpers to get the Z axis correct too.



    Thanks again

    Dave
  • Mr Whippy
    Offline / Send Message
    Mr Whippy polycounter lvl 7
    Hmmmm,

    Just done a test.


    I've sent a good and bad ASE out of one of my objects and compared the difference.

    All the normals data is different, and a few header values for the mesh orientation.

    All the verts/faces are the same.


    I'm guessing what is happening here is that the orientation data isn't being passed and transformed against the normals data. So the mesh is rebuilt without the orientation transform applied to the normals?!


    Reset x-form resets these header variables to 0 or 1, and obviously the normals then make sense.

    I'm guessing that the ase converter used isn't really happy unless things have x-form reset.




    So just curious what the bounding box actually relates to in Max.

    I have a bounding box, pivot and object shape all non-aligned here. So where is the bounding box information stored? No way to align that to the pivot too?


    Thanks

    Dave
  • Noors
    Offline / Send Message
    Noors greentooth
    Ah sorry to hear pen tool doesn't work. I used it a while ago and thought it worked.

    Try with that:
    https://dl.dropboxusercontent.com/u/13762052/polycount/JJTools-CleverResetXForm.mcr

    I don't know any exporter that deals fine with "corrupted" transform node.
    It's a good habit to reset xform an object once you've finished to model it. Even for unwrapping uv's, it could be annoying.
  • Mr Whippy
    Offline / Send Message
    Mr Whippy polycounter lvl 7
    Noors, I owe you a pint :D

    You have made my weekend!

    I've not tried it beyond a few objects yet but it seems to be doing exactly what I need.

    A clever little script. And it makes you wonder why over the years reset x-form hasn't been improved to function like this to begin with.
    Reset x-form always feels so destructive when used so it's nice to know that it doesn't have to be!



    The only difference is probably some Max internal orientation stuff that generally makes no difference except when external converters are not dealing with these offset rotation variables correctly!?

    I've never really hit this problem before and another direct from Max exporter works fine with these objects. I've been using UV tools on them ok for weeks too.

    In the end the meshes didn't seem too damaged, just something has clearly gone awry with the pivots in a way that ASE > game format parser doesn't like... ooops.


    Thank you!

    Dave
  • Noors
    Offline / Send Message
    Noors greentooth
    Thing is the transform node is above the mesh. If the object has been scaled, the uv projection, or stuff like relax tool..., gets scaled too and don't reflect the geometry, etc...
    Glad you sorted it out.
Sign In or Register to comment.