Skip to content
tespirit edited this page Feb 9, 2011 · 13 revisions

Importing data is done through the Bamporter application, or you can use the pandadroid Collada class (though there are limitations to file sizes).

###Bamporter Build the bamporter package and then go to File->Open and pick a Collada file or Bamboo Asset File. After it is loaded, you can see if the model looks right, and also find out the name of nodes. For the model data, you can make sure the correct blending method is being used, and set custom shader info (coming soon!).

For animations, a Player object will be created for the animation. You can select all valid skeletons to assign a player to and by default, the player will have the scene's animation assigned to it. You can create animation clips in the player, or you can merge in animations from other collada/bam files. Merging will automatically create a clip for the merged file.

After the asset is ready, save the file out to a Bamboo Asset File by going to File and then picking one of the save options. Save All is the easiest for saving all the contents into a single file. Though if you want to store the animation separately, you can pick that too.

###Pandadroid First make sure all the files are in the asset folder of the project. Currently bmp textures are the only textures supported so make sure the textures are bmps.

To load a bam file, just use the asset manager. This is the preferred method of loading a file.

BambooAsset asset = Assets.loadBamboo("myfile.bam");

To load a collada file:

BambooAsset asset = Assets.loadCollada("myfile.dae");

Now once you have your asset loaded, to get it into the PandadroidView add the following:

view.addBamboo(asset);
...
//and what if you want a node from a scenegraph that was imported?
Node node = Node.getNode("myobject"); //where the passed in string refers to the scenegraph node name in the collada file.
...

The BambooAsset has other data, such as animations and players. Please refer to Skeletal Animation on how to access this data.