I’m trying to write a Collada exporter which will export a Collada document from my application. Getting the integration object registered is no problem.
How do I call [i]createTo/i from my application? createTo is a protected function which creates restrictions in itself. Even if it were not protected, how would I get the integration object from DAE when no DAE objects exist yet?
I know I must call createTo explicitly but I’m overwhelmed just how to do this.
Hey RudeyPunk, I think you’ve uncovered a huge flaw in the integration templates. As you mention, the guide says you’re supposed to call createTo explicitly, but it’s a protected function, so that’s not possible. I don’t believe anyone’s tried to use the integration templates to create COLLADA data from scratch, so you’re probably the first person to discover the problem.
To be perfectly frank, the integration templates wouldn’t be very useful for creating COLLADA models from scratch based on your runtime objects, even if it were possible to get it working. My recommendation is not to use the integration templates for that purpose. In fact, instead of fixing the problem I intend to delete those functions. The integration templates will only be used to help convert a COLLADA document to your runtime structures, and even for that they don’t save you that much work.
For your situation, maybe you could add toCollada methods to your runtime classes. Then you call toCollada on the root of your model, and the model gets traversed and the COLLADA document gets built up along the way. No integration templates are necessary.
Let me know if this is an acceptable solution for you.
I was afraid of just exactly what you are saying. I started working on a solution independent of the integration classes and I’ll probably continue along that path until a better solution comes up.
I was kinda hoping one of the Collada powers that be would step up and explain my folly :oops: