Results 1 to 4 of 4

Thread: Loading from memory (string)

  1. #1
    Junior Member
    Join Date
    Oct 2007
    Posts
    2

    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:
    Code :
    dom->getScene()->getInstance_visual_scene()->getUrl().getState() == daeURI::uri_pending
    I think this is due to the initial URL or name parameter in load()
    Code :
    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,
    Davide

  2. #2
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    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.
    Code :
    dae.load("myDocument.dae", pointerToDoc);
    Steve

  3. #3
    Junior Member
    Join Date
    Oct 2007
    Posts
    2
    Quote Originally Posted by sthomas
    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.
    Code :
    dae.load("myDocument.dae", pointerToDoc);
    Steve
    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 !
    Davide

  4. #4
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    That shouldn't be the case. Please file a bug report.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •