problem with Xith to Collada XML

Hi i am using Collada DaeSaver class

DaeSaver.save(CurrentContext.sceneBase,"C:\\scene.xml");

but am getting exception which am not able to deciper

 java.io.IOException
     at org.xith3d.loaders.dae.whoola.misc.JaxbCoder.encode(JaxbCoder.java:85)
     at org.xith3d.loaders.dae.whoola.collada.ColladaSaver.toString(ColladaSaver.java:98)
     at org.xith3d.loaders.dae.whoola.DaeSaver.toString(DaeSaver.java:116)
     at org.xith3d.loaders.dae.whoola.DaeSaver.println(DaeSaver.java:82)
     at org.xith3d.loaders.dae.whoola.DaeSaver.println(DaeSaver.java:66)
     at com.ayaam.applicationFramework.gui.controller.toolBarControllers.StandToolBarController.dispatchMethodCalls(Unknown Source)
     at com.ayaam.applicationFramework.gui.controller.toolBarControllers.ToolBarsController.dispToRespBarContr(Unknown Source)
     at com.ayaam.applicationFramework.gui.stateMgmt.UiStateManager.run(Unknown Source)
     at java.lang.Thread.run(Thread.java:595)
 Caused by: javax.xml.bind.ValidationException
  - with linked exception:
 [com.sun.xml.bind.serializer.AbortSerializationException: a required field "InstanceEffect" is missing an object]
     at org.collada._2005._11.colladaschema.impl.runtime.ValidatorImpl.validate(Unknown Source)
     at org.collada._2005._11.colladaschema.impl.runtime.ValidatorImpl.validateRoot(Unknown Source)
     at org.xith3d.loaders.dae.whoola.misc.JaxbCoder.encode(JaxbCoder.java:74)
     ... 8 more
 java.io.IOException
     at org.xith3d.loaders.dae.whoola.misc.JaxbCoder.encode(JaxbCoder.java:85)
     at org.xith3d.loaders.dae.whoola.collada.ColladaSaver.toString(ColladaSaver.java:98)
     at org.xith3d.loaders.dae.whoola.DaeSaver.toString(DaeSaver.java:116)
     at org.xith3d.loaders.dae.whoola.DaeSaver.println(DaeSaver.java:82)
     at org.xith3d.loaders.dae.whoola.DaeSaver.println(DaeSaver.java:66)
     at com.ayaam.applicationFramework.gui.controller.toolBarControllers.StandToolBarController.dispatchMethodCalls(Unknown Source)
     at com.ayaam.applicationFramework.gui.controller.toolBarControllers.ToolBarsController.dispToRespBarContr(Unknown Source)
     at com.ayaam.applicationFramework.gui.stateMgmt.UiStateManager.run(Unknown Source)
     at java.lang.Thread.run(Thread.java:595)
 Caused by: javax.xml.bind.ValidationException
  - with linked exception:
 [com.sun.xml.bind.serializer.AbortSerializationException: a required field "InstanceEffect" is missing an object]
     at org.collada._2005._11.colladaschema.impl.runtime.ValidatorImpl.validate(Unknown Source)
     at org.collada._2005._11.colladaschema.impl.runtime.ValidatorImpl.validateRoot(Unknown Source)
     at org.xith3d.loaders.dae.whoola.misc.JaxbCoder.encode(JaxbCoder.java:74)
     ... 8 more
 java.io.IOException
     at org.xith3d.loaders.dae.whoola.misc.JaxbCoder.encode(JaxbCoder.java:85)
     at org.xith3d.loaders.dae.whoola.collada.ColladaSaver.toString(ColladaSaver.java:98)
     at org.xith3d.loaders.dae.whoola.DaeSaver.toString(DaeSaver.java:116)

Croft you have any idea about this …what am i doing wrong

Yes, the key line is this:
[com.sun.xml.bind.serializer.AbortSerializationException: a required field “InstanceEffect” is missing an object]

Look for a missing “instance_effect” element, probably in one of your “material” elements.

I figured out how to make the XML validator tell which line the error is on. If enough people keep having this problem, I will implement as part of the error reporting.

hmmm…ok will look into it …thanks for the help :slight_smile:

Hi Croft
from where can i get whoola_collada_jaxb.jar code :-\
baiscally i want code for org.collada._2005._11.colladaschema package to debug ,
as i am not getting whats the problem for required field “InstanceEffect” is missing an object]

It is created by the JAXB compiler based on the XML schema. You probably want to look at the COLLADA XML schema instead. You can get to it from www.COLLADA.org.

Yaa …you are right , I have managed it to get working but not convincingly , have to look at source code properly.
Its ignoring many classes like Background and also Groups , will look on that too.
Thanks for the help and it was really very easy to use :slight_smile:

COLLADA does not have a background node so I convert it into an “extra” node:
http://earth.whoola.com:8080/javadoc/xith-tk/src-html/org/xith3d/loaders/dae/whoola/DaeExporter.html#line.1260

BranchGroup and TransformGroup should be supported but other types of Group such as OrderedGroup are not yet implemented. If you need it, let me know.

Oops. I see it might be disabled:
http://earth.whoola.com:8080/javadoc/xith-tk/src-html/org/xith3d/loaders/dae/whoola/DaeExporter.html#line.1296

I think I was planning to fix it when I upgraded to JAXB 2.

Hi Croft ,
How is the scalablity of collada , i mean if my Scene is very big than i think writing it to XML file can be very time consuming ,havent tried it though but i feel that this approach may not scale .have you tried with big scene where number of Vertices being rendered are very high .

I’m not sure about exporting, but for importing I have one high polygon count model that I use as a test. Load this URL into Whoola Cyberspace (F1 key):
http://earth.whoola.com:8080/space/cyber/examples/swim/swimmer_woman.dae

It seems to work OK.

I have started reading the JAXB 2 spec.

yup…when i saw the wireframe model …its indeed rendering lots of vertices… ;D

I finished the JAXB 2 upgrade:
https://collada.org/public_forum/viewtopic.php?p=1640&sid=0c993c43b94c9a78958ac7533e6e9752#1640

This should permit me to fix the export of the background node.

Cool :slight_smile: , so we just have to take the new whoola_collada_jaxb.jar , anyway right now i am busy with implementing Zoom at a point rather than centre , have done it but am thinking that their can be genral utility methods for visualisation purposes in Xith-tk .
Like :
1) Zoom at point so method should be like

 zoom(Point3f pointOfZoom ,float scale )
          2) Rotation about an arbitary axis passing through a given point . 
 rotateAboutPoint (Point3f point ,Vector3f axis,float angle )
          3) 3-4 classes dedicated for conversion of [b]mouse-To-World cordinates[/b].
                                                        Aim here should be that  :: if a point click gives me some world-cordinates than even after Pan,Zoom,Rotate ,changing the view direction that point still should give the same co-ordinate, its still the same point in the world cordinate .
                  I have done some work on it , and it would be great if we can come up with something like this in Xith

The export of background nodes might work now.

You can get it here:
http://sourceforge.net/project/showfiles.php?group_id=114095&package_id=154144