Results 1 to 4 of 4

Thread: problems with changes in daeURI

  1. #1
    Junior Member
    Join Date
    Apr 2007
    Posts
    5

    problems with changes in daeURI

    Hi guys. I year ago I wrote my collada exporter where I was using this (and similar constructs for creating the <triangles> part in the geometry:
    Code :
    domInputLocal * pinput = (domInputLocal*)vertices->createAndPlace(COLLADA_ELEMENT_INPUT);
    daeURI posURI;
    posURI.setElement(positions);
    posURI.resolveURI();
    pinput->setSource(posURI);
    pinput->setSemantic("POSITION");
    Due to the changes in the daeURI class this is not working anymore. According to http://collada.org/mediawiki/index.p..._compatibility i ran into the type of problem where I should ask here how to achieve the same with the new api.

    I already tried out
    Code :
    domInputLocal * pinput = (domInputLocal*)vertices->createAndPlace(COLLADA_ELEMENT_INPUT);
    daeURI posURI(*positions);
    pinput->setSource(posURI);
    pinput->setSemantic("POSITION");

    which I thought to be the right way to do that, but here all the source Attributes are empty.

    Could you tell me how to solve my problem?
    grassi

  2. #2
    Senior Member
    Join Date
    Aug 2004
    Location
    California
    Posts
    771

    Re: problems with changes in daeURI

    Quote Originally Posted by grassi3000
    I already tried out
    domInputLocal * pinput = (domInputLocal*)vertices->createAndPlace(COLLADA_ELEMENT_INPUT);
    daeURI posURI(*positions);
    pinput->setSource(posURI);
    pinput->setSemantic("POSITION");
    which I thought to be the right way to do that, but here all the source Attributes are empty.

    Could you tell me how to solve my problem?
    grassi
    I think the part in red seems to be the where your problem is. You don't show the creation of "positions" and if it's not placed in the same document as "pinput" then the URI won't construct and resolve correctly.

  3. #3
    Junior Member
    Join Date
    Apr 2007
    Posts
    5
    Hi, the creation of positions is done the following way:


    Code :
    domGeometry* geomElement;
    domLibrary_geometries * myLib;
    int res = dae->getDatabase()->getElement((daeElement**)&myLib, 0,NULL, COLLADA_ELEMENT_LIBRARY_GEOMETRIES, NULL);
     
    geomElement = (domGeometry*)myLib-> createAndPlace(COLLADA_ELEMENT_GEOMETRY);
    //stuff done with geomElement
     
    domMesh *meshEl = (domMesh*)geomElement-> createAndPlace(COLLADA_ELEMENT_MESH);
    domVertices * vertices = (domVertices*)meshEl-> createAndPlace(COLLADA_ELEMENT_VERTICES);
    //stuff done with vertices
     
    domSource * positions = (domSource*) meshEl-> createAndPlace(COLLADA_ELEMENT_SOURCE);
    Everything is done in the same dae. The elements were resolved correctly with the old collada dom, but this one seems as if it either isn't able to resolve it or doesn't resolve it at all. Do I have to call something so that the resolving takes place before i do the dae->saveAs(...)?

    The current output of this looks like that:

    Code :
    <vertices id="gum_tree-Geometry-Vertex">
    	<input semantic="POSITION" source=""/>
    </vertices>

    Where nothing is in the source attribute.

  4. #4
    Senior Member
    Join Date
    Aug 2004
    Location
    California
    Posts
    771
    Does the "positions" element have an "id" attribute value?

Posting Permissions

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