Fragment in extra tag

Hi,

I’ve been writing an importer for COLLADA and everything has been going great till today. My issue is that I’m using OpenCOLLADA so cameras have an extra node that specifies a target. Now this means I have the normal camera data and a


      </optics>
      <extra>
        <technique profile="OpenCOLLADA3dsMax">
          <target>#Camera01.Target</target>
        </technique>

And for the life of me I can’t resolve this back to the node that actually points at this. If anyone could provide me with a hint how to resolve that fragment back to the node element it points at I would really appreciate it.


  <node id="node-Camera01.Target" name="Camera01.Target">
        <matrix>-1.6 -4.3 -1 -3.0 -1 7.1 1.6 -6.9 0 1 -4.3 15.0 0 0 0 1</matrix>
      </node>

I’ve tried


	daeElement *target = camera->getDescendant("target");
	domAny* target_val = daeSafeCast<domAny>(target);
	daeSIDResolver resolver(target->getAncestor("visual_scene"), target_val->getValue());

	daeElement *element = resolver.getElement();

but this always returns a state of 2 (so it can’t find the element) while the node is clearly there. Anyone have any ideas?

Ok so the problem is that OpenCOLLADA when exporting the camera sets the nodes name not id to the name it gives in the target of the camera instance. Is there anyway to resolve the fragment based on name and not id?

This looks like a bug in OpenCOLLADA. The name attribute is not functional. It is user metadata only.

That <target> element appears to be a URI fragment (type xs:anyURI) and so must point to an id attribute in the same document.

Thanks for the reply Marcus :slight_smile: From reading the spec this is what I figured but was looking for confirmation. I’ll give the Max inbuilt COLLADA exporter a try to see if it does any better otherwise I’ll just go ahead an submit a bug report. Other than OpenCOLLADA are there any other free plugins for 3ds Max that export .dae export that you’re aware of?

OpenCOLLADA is the actively developed open source plug-in for Max and Maya these days. if you want to contribute bug fixes or features then I suggest focusing on that project.

Another inactive project is ColladaMaya on sourceforge.

See all the the project links at the top of the Implementation forum.