No animations found in collada file!

Started by jaychang0917, March 07, 2017, 10:48:12 AM

Previous topic - Next topic

jaychang0917

Hi, I am trying the sample "ProceduralAnimationSample", it throws the following exception when i use my own .dea file. I want to ask if the animations is necessary? It is because i animate the model programatically, so there is no predefined animations in the model.


Exception in thread "main" java.lang.IllegalArgumentException: ColladaStorage contains no skins.
at raft.jpct.bones.BonesImporter.importCollada(BonesImporter.java:52)
at bones.samples.ProceduralAnimationSample.initialize(ProceduralAnimationSample.java:84)
at bones.samples.AbstractSample.loop(AbstractSample.java:91)
at bones.samples.ProceduralAnimationSample.main(ProceduralAnimationSample.java:312)


Thanks!

raft

most possibly if there is no animation, skeleton data is not exported. just try to put a dummy animation

jaychang0917

#2
Thanks raft. I will try and get back to you.

Also I saw a sample that uses .bone file format, is it faster in terms of loading the model? Is it similar with the serialization object format in jpct-ae? How can I covert my .dae file to .bone?

Does bone support .obj format?

Sorry, too many questions. Thanks.

raft

yes, Bones' binary format should be faster and more important it has no runtime dependency other then Bones and jPCT. remember when loading Collada or Ogre3D format, Ardor3D's or jME's loader / parser is used, then converted to Bones format.

this has nothing to do with .obj format. just a binary representation of Bones animation model.

you can use the scripts in the /scripts folder to convert to Bones' binary format. they should provide help with -help switch

jaychang0917

#4
Quotethis has nothing to do with .obj format
you means that i can covert .obj to .bone format too?

jaychang0917

In my .dae file, it defines some texture file paths like

<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
  <asset><contributor><author></author><authoring_tool>FBX COLLADA exporter</authoring_tool><comments></comments></contributor><created>2017-03-03T10:42:33Z</created><keywords></keywords><modified>2017-03-03T10:42:33Z</modified><revision></revision><subject></subject><title></title><unit meter="0.010000" name="centimeter"></unit><up_axis>Y_UP</up_axis></asset>
  <library_images>
    <image id="file3-image" name="file3"><init_from>file://D:/Project/myproject/sourceimages/mymodel/file3.png</init_from></image>
    <image id="file2-image" name="file2"><init_from>file://D:/Project/myproject/sourceimages/mymodel/file2.png</init_from></image>
    <image id="file6-image" name="file6"><init_from>file://D:/Project/myproject/sourceimages/mymodel/file6.png</init_from></image>
    <image id="file5-image" name="file5"><init_from>file://D:/Project/myproject/sourceimages/mymodel/file5.png</init_from></image>
    <image id="file1-image" name="file1"><init_from>file://D:/Project/myproject/sourceimages/mymodel/file1.png</init_from></image>
    <image id="file4-image" name="file4"><init_from>file://D:/Project/myproject/sourceimages/mymodel/file4.png</init_from></image>
  </library_images>
...


How can i tell .bone where my texture are?

jaychang0917

i am wondering why bones need the animations compulsorily? it is because there is a case that we animate the model programatically instread of playing a predefined animation.

raft

Quote
you means that i can covert .obj to .bone format too?
nope, you cannot. unless you write an importer for that ;)

Quote
How can i tell .bone where my texture are?
texture names are not imported. you need to set texture after Animated3D is constructed, check the samples. and for sure this also means same Animated3D cannot have multiple textures. unless you modify textures of polygons "manually"

Quote
i am wondering why bones need the animations compulsorily? it is because there is a case that we animate the model programatically instread of playing a predefined animation.
because typically exporters do not export skeleton without animation. no skeleton -> no programatic animation

jaychang0917

Quote
because typically exporters do not export skeleton without animation. no skeleton -> no programatic animation
Actually i have no idea what the animation defined in .dae file is about. My model is a human head, and i want to programatically animate the mouth based on facial landmarks detected. If i put a dummy animation in my .dae file, is the function of dummy animation only make exportation (.dae -> bones) works?

raft

what is facial landmarks?

Bones only support skeleton animation in Collada files (yet dont know if other type of animation exist in Collada files, anyway) for sure you need a skeleton rigged to your model for that.

facial animations are generally pose animations (although not a strict rule), Bones only support it via Ogre3D not via Collada. have a look at FacialAnimationSample for that

jaychang0917

I got a new model from designer yesterday. But unfortunately it still can't be loaded, same error "ColladaStorage contains no skins." shows. I used text editor to open the working .dae file (Seymour.dae) and my model .dae file, i found there are two differences that my model lacks two nodes (library_controllers and library_physics_scenes).

Is this the root cause of the error? Thanks!

raft

you compare it with what?

yes, possibly missing library_controllers is the reason

jaychang0917

Quote from: raft on March 29, 2017, 11:04:36 AM
you compare it with what?

yes, possibly missing library_controllers is the reason

New errors occurred, it shows `There are more than one skeletons in ColladaStorage.` Have any idea?


Exception in thread "main" java.lang.IllegalArgumentException: There are more than one skeletons in ColladaStorage.
at raft.jpct.bones.BonesImporter.findUniqueArdorSkeleton(BonesImporter.java:359)
at raft.jpct.bones.BonesImporter.importCollada(BonesImporter.java:66)
at bones.samples.ProceduralAnimationSample.initialize(ProceduralAnimationSample.java:84)
at bones.samples.AbstractSample.loop(AbstractSample.java:91)
at bones.samples.ProceduralAnimationSample.main(ProceduralAnimationSample.java:311)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

raft

well, the error is descriptive I suppose :) there are multiple skeletons. maybe you are exporting multiple models with separate skeletons?

you can have multiple models and all should be attached to a single skeleton

jaychang0917

Quote from: raft on March 30, 2017, 12:20:03 PM
well, the error is descriptive I suppose :) there are multiple skeletons. maybe you are exporting multiple models with separate skeletons?

you can have multiple models and all should be attached to a single skeleton

You mean the designer doesn't put the models under a root model?