KhronosGroup / OpenCOLLADA

652 stars 252 forks source link

UV Data in channels above [1] getting re-ordered/scrambled on Import #638

Open Lunaretic opened 4 years ago

Lunaretic commented 4 years ago

The following was done with MAX2018; but may persist across other versions of OpenCOLLADA.

When Importing a DAE file with more than one UV channel above [1], the UV channels above that are scrambled into a different order. In the example attached, the UV Data goes from [VColor] [UV1] [UV2] [UV3] [UV4] to [VColor] [UV1] [UV3] [UV4] [UV2]

The initial DAE was generated using OpenCOLLADA, and reflects the correct state of the model as seen in 3DS. (Each UV channel has all of the UV Coordinates set to [1,1]/[2,2]/[3,3], etc. to reflect it's shown UV layer in 3DS)

Importing the Initial DAE back into 3DS using OpenCOLLADA will shift this order, despite the DAE semantics in the initial file showing the correct ordering for these layers.

Furthermore, repeating the process (Exporting the DAE file, then importing that exported DAE again) will shift the UV channels further, with the result then being:

[VColor] [UV1] [UV4] [UV2] [UV3]

If nothing else, simply importing then exporting a DAE already generated by OpenCOLLADA should not be significantly changed DAE file on output.

Attached DAE's including input state, 1st round output, and 2nd round output (Just a simple 1 width box centered at [0,0,0] for ease of testing) : DAEs.zip