FBX produces not usable collada

Hi,

I tried to use the FBX SDK (2011.3.1) to load FBX files and save them as Collada files in order to be able to import FBX files in Panda3D.
Unfortunately the resulting Collada files are not usable for several reasons, among them:

  • There’s a Maya specific extra technique
<diffuse>
    <texture texture="Map__2-image" texcoord="CHANNEL0">
        <extra>
            <technique profile="MAYA">
                <wrapU sid="wrapU0">TRUE</wrapU>
                <wrapV sid="wrapV0">TRUE</wrapV>
                <blend_mode>ADD</blend_mode>
            </technique>
        </extra>
    </texture>
</diffuse>
  • It assigns a texcoord channel name that isn’t referenced anywhere else in the file (in the previous code sample, no geometry uses “CHANNEL0”…)

  • Every polygon is exported twice, a first time with a basic material (only diffuse color, specular color, etc.) and a second time with a textured material --> this doubles the number of polygons of each model without any valuable reason

Anyway, the resulting Collada file cannot be opened correctly either with OpenCOLLADA or Panda3D’s “dae2egg”.

Anyone has any experience on how to “fix” it and make it understandable by “dae2egg”?

Thanks

I can perhaps add support for the extra Maya technique when I find time- could you file a bug report on the tracker for it?

As for the other errors, it sounds like either there’s a bug in Panda, or in the FBX loader. Showing us the erroneous .dae file might help.

Perhaps an option is to import the FBX file in Maya or 3dsmax and then export to .egg or .dae from there?

Thanks for your answer.
You can find here a small archive (<1Mb) containing the original FBX file and the resulting Collada file:
dl.dropbox.com/u/3545118/Water_Reservoir_FBX.zip

My goal is to allow importing FBX files in my Panda application, even if no Maya/3ds Max is installed (I integrated the FBX SDK in the app) so using an external app is not an option.

Do you know about a FBX to egg converter?

I’ve resolved one of the issues:
[.dae to.egg and UV)

Many thanks for your efforts rdb.
If this can be of any help, here’s how I solved all the issues I’ve identified on my side (including the UV one):

dl.dropbox.com/u/3545118/fix_bad … rom_fbx.py