Results 1 to 2 of 2

Thread: Questions about setting attribute data, dom installation

  1. #1
    jat82
    Guest

    Questions about setting attribute data, dom installation

    Hi, I've installed the 1.4.1 collada sdk, based on the collada 0.2.2 dom from Sourceforge. I built the libs for Visual Studio 9 (I'm using Visual Studio 2008 Express), but i've noticed the files it generated were named *21 (ex, libcollada14dom21-sd.lib) - is this normal? The zip file and folders created during extraction are named *22, as are the filenames listed in the installation instructions, so I'm guessing something is wrong, but i'm not sure where.

    I have built some sample applications however, and am rather flustered over the setting of attribute data in two particular cases, the first being for setting image width/height for images in library_images. My problem with this, is that some data is set automatically and i don't want it to be. This is the code i'm using;
    Code :
    char* samplename = "whatever.bmp";
    	daeElement* image =	libraryimages->add("image");
    	image->setAttribute("id", samplename);
    	image->setAttribute("name",samplename);
    	image->add("init_from")->setCharData(samplename);
    ..and this is the output..
    Code :
    <image id="whatever.bmp" name="whatever.bmp" height="0" width="0">
    			<init_from>whatever.bmp</init_from>
    		</image>
    This is just test code to get used to the sdk, but at no point have I set the height or width, nor do i wish for it to be in my final output. Is there a way to remove it?

    My other big issue, is that i can not seem to be able to set the "type" attribute of a node, to anything besides "JOINT". Here's what i'm doing..
    Code :
    anode->setAttribute("id","object_name-node");
    			anode->setAttribute("name","object_name");
    			anode->setAttribute("type","NODE");
    ..and the output..
    Code :
    <node id="object_name-node" name="object_name"/>
    However, if i use this..
    anode->setAttribute("type","JOINT");
    ..then i get this..
    Code :
    <node id="object_name-node" name="object_name" type="JOINT"/>
    Am i missing something? I've also tried casting to a domNode and using setType..
    Code :
    domNode* anode = (domNode*)visualscene->add("node");
    			anode->setType(NODETYPE_NODE);
    ..but this results in precisely the same problem.

    Any advice would be appreciated.

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

    Re: Questions about setting attribute data, dom installation

    The height and width attributes are optional in the schema. The DOM should not be adding those without explicit values being set, as they are hints. You can safely ignore/override them on import of image files that contain that information.

    The <node> type attribute has a default value of "NODE" and so the DOM is eliding that from the export. The value is only a hint (to DCC tools) and is not functionally significant to the <node>.

Posting Permissions

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