Loading from memory (string)

Following the COLLADA RT code I can read in a scene when loading from a file on the local disk.
However I can’t load the same file when given as a daeString.
Some things get loaded but the URL of the scene doesn’t get resolved, namely the Instance_visual_scene ends up being pending:

dom->getScene()->getInstance_visual_scene()->getUrl().getState() == daeURI::uri_pending

I think this is due to the initial URL or name parameter in load()

daeInt load(daeString name, daeString docBuffer)

…which I don’t know what to set it to, since the URL would be pointing to docBuffer in memory…

What should I do ? 8)

Thank you,

Hi Davide. In the DOM, all documents are identified via a URI, regardless of whether the document physically exists at the specified URI or not. When working with an in-memory document, just give it a URI to use as an ID. It won’t try to write to that location on disk or anything, unless you tell it to by calling DAE::save.

dae.load("myDocument.dae", pointerToDoc);


OK, I think I understand the problem now. The ID has to end for .dae or .xml. If I use just “myDocument” instead, it fails !

It would be nice if this info was included in the docs 8)

Thank you !

That shouldn’t be the case. Please file a bug report.