Friday, July 24, 2015

blender to cocos2dx

In the doc of cocos2dx, it is mentioned that you can use blender to export fbx and convert it into c3t/c3b for sprite3D. But it does not say how. I googled around and found a few posts helpful.

http://a2dr.blogspot.com/2015/05/cocos2d-x-converting-fbx-to-c3b.html

I exported my crate, but have not tested animation yet.

Here are the steps
1. Edit your object in blender.
2. Export the selected object to fbx. Check "selected objects" and leave other options default. Some says you need select FBX 6.1 ASCII, but default FBX 7.4 binary works for me.
3. Convert fbx to c3b/c3t with the binary fbx-conv in cocos2dx tools folder.
4. Add c3b/c3t and texture to project Resources folder. This step is critical, the converted fbx or c3b/c3t do not contain texture in them. Some says you need a sub folder named Tex to hold textures, but I just put them under root of Resource.
5. Create your Sprite3D with the converted c3b files.




No comments:

Post a Comment