Collada dilemma

I’ll give the long explanation why I need Collada support, then the technical issues at the end. Skip ahead four paragraphs if you don’t need to hear the story!

I help on a high school robotics team, and at the start of each year is a competition that runs for about three months. During that time the team has six weeks to build a 100+ pound robot, typically 4 to 5 feet tall, that needs to compete in a challenge game against other robots.

As well as the actual tournament there are other prizes to be had, for animations, marketing, web site, and so on. Autodesk usually sponsor the competition by letting the schools use Inventor or Max, and so those tools are used for the sideline contests. The students are allowed to use other tools towards their entries, so long as the tools are ones that any other team could also have used, without having to pay money. That makes some tools ok, such as iMovie or even Garage Band, because anyone on any team who had a Mac probably had those included for free. Same can be argued for Windows Movie Maker.

With Unity now being free, it becomes a tool that the kids could use in the competition. Unfortunately, the other main non-Autodesk tool that they will all use is SketchUp. Until version 7.1 came out, SketchUp couldn’t really be used, as you need the Pro version to export 3D models (unless you hacked the KMZ file, which isn’t always successful). With 7.1 there is a direct export to Collada, which means that the free version can be used.

In a perfect world we would do all our modeling in SketchUp, and all the playback in Unity, but alas Unity can only take in the simplest of Collada files. Sometimes even the simplest ones fails. We could go via a converter, but it would have to be a free one. The failure of Unity to import the files isn’t all Unity’s fault, the same files don’t read into Preview correctly either, nor Blender, nor the Autodesk FBX converter. The only programs that can view the files are SketchUp and Photoshop, and neither of those can export FBX (the Pro one can, as can LightUp, but those both cost money, and so are not allowed).

So there’s the challenge. Can anyone help me find a way to get a Collada file into Unity, without it involving the purchase of extra software beyond the free versions that all the teams have access to?

BTW, the Unity roadmap talks about Collada, and how it uses the FBX toolkit, and that if the toolkit is lacking in some way we should pester Autodesk. But to do that you really have to sign up as developers with Autodesk. There is a forum, but it’s more chaotic than this one, and you don’t get the feeling that any appeal there would get through. I somehow feel that Unity should be the ones to ask Autodesk for help on import Collada using the FBX toolkit, after all, they’re the ones who are Autodesk developers.

Meanwhile, if you’re still reading, here is a fairly simple building for you to use as a test case in getting it into Unity:

http://xfiles.funnygarbage.com/~colinholgate/files/baltimorehouse.zip

Colin,

I am having the exact same problem. Neither Unity or Autodesk FBXConverter will import the DAE file from the latest Sketchup 7.1.

However, what is interesting is that the previous version of Sketchup Pro (7.0) exported Collada files which Unity could import just fine. Autodesk FBX Converter 2010.2 could also successfully convert it to FBX.

Also interesting, if I run the command-line Collada coherency tester (COLLADA Refinery - COLLADA Public Wiki) the results are as follows…
DAE from SketchUp 7.0 - fails
DAE from Sketchup 7.1 - passes

So this kinda makes me a bit suspicious of the Unity importer, since the coherency tester right off the Collada site indicates no problem with the DAE from Sketchup 7.1.

I have played with a number of other conversion pipelines, but none are very great. Blender will import the Collada file and then re-export it such that Unity can import it.

UT, any thoughts here?

It seems odd that the coherence test fails with 7.0 and that works in the FBX converter, and works with 7.1, which doesn’t work in the FBX converter. That seems the opposite of what you would expect.

When I used to hack the KMZ files to get the DAE for trying SU 7.0 models in Unity, that would crash Unity 2.5. I think Unity 2.6 doesn’t crash, but I think it still shows no geometry.

Yeah, I agree. At this point I’m not sure what is coherent and what is not, myself included.

What is Unity’s FBXImporter based on? It seems like I read somewhere here that they leveraged Autodesk’s FBX Converter SDK? Or, very possibly, am I just imagining things. However, if that is indeed the case, it might explain the similar behavior.

The Collada format/standard sure seems promising, but so far I’m not impressed with the industry’s support for it.

Yes, Unity uses the FBX SDK, which in a way is part of the difficulty. Presumably neither Google or Adobe use the SDK, and so they can import the files ok.

Do any of the files that work contain animation?

I was able to get my Collada exporter to work with static files only - the FBX importer of Collada has at least two requirements that a standard Collada importer does not have - no internal ids can contain spaces and no forward references allowed in the file. After rearranging my exporter to comply with this my static meshes load fine and load fully textured (as long as there are no spaces in the texture file names !!). But any file I create that contains animation fails to load at all. Even a skeleton with no animation fails.

I even exported a simple file from Max to Collada, which should use a matching exporter and Unity can not load it. So Collada appears to be only for static models at this point which is causing me great problems.

Just wondered if any of the files that you were testing that DID work contained any animation?

None of the files I’ve tested with have animation.

I’ve had a reply from someone on the SketchUp team about some of the issues I’ve told them about. The main one that affects Unity is that the Autodesk FBX converter won’t handle the files, and it doesn’t give any sort of error to be able to then figure out why it’s failing.

One question, when trying to import the DAE there is a white document as part of the blue cube icon in the project list, and the Console shows:

ImportFBX Errors:
Couldn’t import file /path_to_the_dae.
Unidentified error

Is there any way to find out what the unidentified error is?

Not that I know of. That is why I’m searching for an animated Collada file that Unity WILL load, so I have something to compare to and keep changing mine to match until it works. That was the only way I could figure out why it wouldn’t load valid Collada static files and change my exporter to match.

Colin, I won’t tell anyone you just did a GREAT presentation for Director Forum (I’m assuming that was you?).

I don’t know much about SketchUp, but here’s what I tried and it worked, maybe it’s not what you need though.

I first took your supplied file, the Baltimore Hall and imported into Blender 2.49b using the Collada 1.4 import option. This brought in the model without the textures.

I’m no Blenderhead either, so I left it untextured. I then saved the .blend file into the Assets folder of Unity (Unity takes .blend files) and let it import it that way.

I then brought the textures supplied with the .dae file into the Unity Asset folder and did my best guessing on where they went on the model. Here’s what I have in Unity.

I hope this helps.

TheLorax

228573--8216--$houseinunity_187.png

I like people using any given tool to know the abilities of other tools. The Director Forum one was me trying to explain Flash to Director users. Last Wednesday I showed Unity and GameSalad at a Flash meeting. I would have shown Unity in the Director Forum, only Hanford showed it the previous week.

Apparently the Baltimore House one, and many other 3D Warehouse models, have a known issue where the textures were stored in the wrong place in the XML. I haven’t tried it, but apparently exporting from SU 7.1 does it correctly, and maybe that would have a better chance with Blender. Even exported from v7.1, that model doesn’t work in the FBX converter.

Meanwhile, I’ve been trying to narrow down the issues with the Autodesk FBX Converter, because if that can’t cope then you wouldn’t expect the FBX SDK to work. My plan was to start with the simplest possible model, and then get more complicated, until it failed.

Well, it turns out that a single straight line exported from SketchUp is all it takes to fail. I tried a Collada export of a cube from Cheetah, and that went through the converter ok, and also comes into Unity as both DAE and converted to FBX.

I looked through the XML for a cube from SketchUp and the cube from Cheetah, and I started to rearrange the entries in the Cheetah XML to match the order in the SketchUp XML. I found that it did break the file. In particular, SketchUp puts <library_visual_scenes> near the top, but Cheetah puts it near the bottom. By moving the <library_visual_scenes> to the bottom of the SketchUp DAE, I could then send it through the converter ok.

Alas, the successfully converted to FBX file still does not import into Unity, but it does import into Cheetah ok. Also, although moving that block of the XML to the bottom was enough to fix my simple tests, and also the Baltimore House one, it wouldn’t fix more complicated scenes.

Anyway, I’m continuing to try to narrow down what it is in the SketchUp DAE that upsets the FBX converter, and what is wrong that would prevent an FBX converted file from going into Unity ok.

Hi,
here is a Ruby script you can use to save collada files in sketchup 7.1, then you can load it up in unity. It’s not perfect but it works for me.

Just drop it in the Sketchup’s plugin directory and select “tools->Export Scene to unity dae”

http://jump.fm/UYVNN

Just FYI, in regards to the FBXConverter issue with Collada files, I received a reply from Trevor at Autodesk support, he writes…

Note this implies there are issues with reader and writer in FBXConverter SDK. So, hopefully Unity will incorporate any SDK import fixes when they are released.

I had given up on this (it was too late for using Unity and SketchUp this year, there’s now 10 months to solve the problem for next year so that the 300,000 potential Unity users I have in mind can use the tools together). I had tried getting through to AutoDesk via a friend who does work for them, but it’s a big enough company that it didn’t help in the end.

I was popping back here to post another appeal, hoping that 10 months would be enough time to get a fix developed! Then I saw the two new messages.

The Export Scene to Unity DAE .rb doesn’t fix anything. At a glance it looks like it’s doing the removing of the lines that the FBX SDK can’t cope with, but it doesn’t make the model work. I also tried removing all line breaks from that DAE, and still it doesn’t work in Unity.

The news from AutoDesk is at least more definitive, and if they can’t think of a work around, maybe there isn’t one.

I can think of a work around for the Unity team. Ditch Autodesk’s importer and go with an open source alternative, something else which will actually work from another company, or write their own. >P

Hi,

I thought I should join in on the conversation, since I was quoted a few posts above. We in the FBX QA team at Autodesk work closely with the folks at Unity to ensure interoperability between DCC packages and Unity 3D works well. If you have FBX or Collada issues to report, please do log them directly to us. Yes, Collada issues are relevant to us, as we have both published Collada/FBX readers and writers in our FBX SDK. You can log bugs by visiting this webpage: Autodesk | 3D Design, Engineering & Construction Software

Supporting lines and linestrip in our Collada reader/writer is not a task we can fit into our proposed upcoming release and we’re currently looking into scheduling it for a future release (reference number: 348171). So long as we know about the issues our users are facing, we can address them. Since Collada is an open format, small changes in one software package can indeed break readers/writers in another. For SketchUp Pro users, you have the option to export to FBX, OBJ, and other common Unity-supported formats, as a workaround solution.

If you have issues to discuss or feedback to give us about our FBX Technology, we have an email alias that directly contacts myself and two others here in the FBX QA team: fbxplugins@autodesk.com. For FBX SDK-related inquiries, we have the fbxsdk@autodesk.com email alias that reaches our FBX developers directly.

We are very end-user-focused here in the FBX team and with our multiple releases of software throughout the year, we always make sure our features and bug fixes are focused entirely on solving/addressing the popular end-user’s reported issues and requests. If you get in touch with us with your requests and bug fixes, I’d like to prove that to you.

Regards,
Trevor Adams, FBX QA Lead

Hi Trevor,

Thanks for joining in! I’ve been pestering both Google and Unity about this for a long time, and when I’ve looked into contacting AutoDesk it seems like you have to be a paying registered developing to get any access to report problems. I’ll make use of the links you gave later!

Meanwhile, are you able to describe the nature of the problem in a way that might enable us to make our own utility to fix the issue? If it’s just a matter of rearranging the XML a but, that shouldn’t be too hard to do.

Thanks again,

Colin

I’ve logged a bug with Autodesk, giving the simplest possible example file too. The bug reference number is 352130.

Hi Colin,

First, thanks for logging the issue directly to us. I tested your .dae file in the FBX Converter version 2010.2 and it fails, as you mentioned. However, since then, we’ve done some development work on the converter and it looks like, after some testing with your file and a few others, the failure is no longer reproducible. In other words, the conversion seems to succeed. Again, as you mentioned in the log, the file is a simple rectangle, so I’m not too sure what this finding actually represents. I’ve attached the resulting FBX file for you to test in Unity (exported as FBX 2010, compatible with Unity 2.6). Let me know if that works well (it should).

Going further, if you have any other example files you’d like me to test, I’d be willing. We’re developing our next releases at this very moment (targeting a Spring 2010 release) and if there are remaining issues that we can actually fix, now’s the time to investigate. Again, I can’t do much about the lack of Collada 1.4.1. linestrip support, but this file worked just fine.

Alternatively, if you’d like to join our beta program and test the latest converter yourself, you’re more than welcome. Drop me an email at FBXbeta@autodesk.com and I’ll take care of the rest.

Unfortunately I do not know how you could modify the files yourself in order to make them 2010.2 FBX Converter-compatible, sorry.

Thanks,
Trevor

264984–9529–$squareconverted_712.zip (3.52 KB)

Thanks, this is exciting! I’ll send an email about the beta, and test the file when I get to work.

Although you can’t suggest a workaround to the “1.4.1 linestrip” problem, can you say what the problem is? If you can express it in terms of: the data is like “this” and it should be like “that”, then I feel sure it would be possible for us to make a utility that fixes the data.

I tried the square, and it works well. I’ll email about the beta now!