When programming with the COLLADA-DOM, there are 3 sections that refuse to initialize properly. I don’t know what it is i’m doing wrong, could you please look over these small snippets? I’ve removed everything but the necessary parts.
Here, I can not add any children to the domInstance_effect::domSetparam* object. When I compile it the element doesn’t add itself, and when I try set a parameter the compiler fails and says: use of undefined type ‘domCommon_color_or_texture_type’
Here I can’t set any of the parameters for the domInputLocal object, it compiles okay but the fields are blank. Same when I set chardata for the domP* object.
I reconstructed your code snippets, and recompiled the code without problem. I also disabled most of the code to run just the last part, it ran without problem. Please see the test code below:
Perhaps you forgot to include the needed DOM dae header files?
What does it mean when you say “domTechnique doesn’t show up”?
Can you narrow the problem down by including the compiler error messages along with the offending code section? It is not entirely clear to me which code section does not compile and which compiles OK but runs with logic error.
If the code was compiled OK, is the “file_name” path valid? i.e. is the app finding “filen_ame”
If so, is file_name validated OK against the COLLADA 1.4 schema?
There are the headers I’ve included: #include <dom/domCOLLADA.h> #include <dom/domAsset.h> #include “dae.h”
Even with your modified snippet I still get the compiler error:
1>.\convert_mesh.cpp(273) : error C2027: use of undefined type ‘domProfile_COMMON’
1> Z:\Projects\Revival\external-libs\collada-dom\dom\include\1.4\dom/domElements.h(774) : see declaration of ‘domProfile_COMMON’
Sorry for not being clearer. When I say that the domTechnique doesn’t show up, what I mean is that the element is not being appended to the DAE document when I write it to disk.
is when I set the attributes for domInputLocal and domP, the values fail to append to the document when I write it. So when i’ve set the semantic and source of the input and the char data for p, the DAE looks like this below. (I have no problem setting the triangle count).
domTriangles* triangles = (domTriangles*) mesh->add("triangles");
domInputLocal* triinput = (domInputLocal*) triangles->add("input");
domP* trip = (domP*) triangles->add("p");
triangles->setCount(index[0].index_s / 3); // Works
triinput->setSemantic("VERTEX"); // Doesn't write to the DAE document.
triinput->setSource("#this"); // Access Violation when I compile the program.
trip->setCharData(index_arr.c_str()); // Doesn't write to the DAE document.
Check the comments on the side to indicate the problem. I have included the headers (which previously I hadn’t): #include <dom/domTriangles.h> #include <dom/domInputLocal.h> #include <dom/domP.h>
Also, I can’t find any methods to set the protected members in the shader class (for example, domProfile_COMMON::domTechnique::domPhong).
domPhong has the member domPhong::elemAmbient, how do I set this? I’ve scanned the wiki, programming guide and programming reference but I can’t find it. :?:
Also, I can’t find any methods to set the protected members in the shader class (for example, domProfile_COMMON::domTechnique::domPhong).
domPhong has the member domPhong::elemAmbient, how do I set this? I’ve scanned the wiki, programming guide and programming reference but I can’t find it. :?:
Check out domProfile_COMMON::domTechnique::domPhong::registerElement(DAE& dae) in colladadom\dom\src\1.4\dom[b]domProfile_COMMON.cpp
[/b]
mea = new daeMetaElementAttribute( meta, cm, 1, 0, 1 );
mea->setName( "ambient" );
mea->setOffset( daeOffsetOf(domProfile_COMMON::domTechnique::domPhong,elemAmbient) );
mea->setElementType( domCommon_color_or_texture_type::registerElement(dae) );
cm->appendChild( mea );