Convert c3t to c3b

Hi everyone,

I created a .c3t and .c3b file by using fbx-conv from a .fbx file. Unfortunatly it wasn’t exactly what I needed and so I changed a few things directly in the .c3t file. Is there a way to convert my .c3t file now directly to a .c3b file?

If not is there at least a method to save meshes as .c3b in cocos2d-x, so that I can build my own converter? Unfortunatly the fbx-conv has only a c3t and c3b writer and cocos only a c3t and c3b reader as far as I’ve seen, which seem to have very different internal structures and I have a hard time to make them compatible.

Thanks and Regards

I’d like to bump this question if anyone has an answer. In addition, fbx-conv has a bug where we seem to “lose” whether a file has clamping on its textures or not. I had a working .obj file that I used fbx-conv on, which stopped working as a result of this. I modified the c3t file by changing “wrapModeU” and wrapModeV from REPEAT to CLAMP but would like to go back to a c3b if anyone can advise (or advise on how to get the wrap mode right.)

@slackmoehrle, @ricardo any advice on this?

it would be best to make a GitHub Issue out of this, please. This puts it in front of the team…

I’ve made a github issue for my problem regarding clamping. Any guidance regarding converting c3t files to c3b files?

so you are saying you don’t still have the original fbx?

Check out this this talks quickly about the tool but shows you various switches for selecting the output format, i.e c3b, c3t.

This is initial development so I’m using free .obj resources (in particular the following: http://tf3dm.com/3d-model/hn48-flying-car-10381.html). Disregarding the fact that the model has a ton of vertices, I can do fbx-conv.exe -a “Filename.obj” and it will output a c3t and c3b file. Unfortunately, given the bug I have filed (https://github.com/cocos2d/cocos2d-x/issues/12546) the c3b and c3t files are not preserving clamping on the 3d resource.

Thus, I manually change the wrapModeU and wrapModeV from REPEAT to CLAMP in the c3t file to make it work. Ideally I would then like to convert the c3t file to a c3b for space purposes.

@MichaelMahn2 would you like explain what you have changed in .c3t file? so maybe we can have some idea to handle it.

in my side, i change texture name only.

Hi,

I actually fixed this for myself now. I built a program upon cocos and fbx-conv which converts c3t to c3b, but it currently only works on linux since the call of the converter is in proj.linux/main.cpp and the file name is hardcoded, since this was enough for my needs. You can find it here https://github.com/MichaelMahn/c3t2c3b/blob/master/README.md .

This is far from being perfect but feel free to use it as a basis maybe.

Edit: Unfortunatly it’s pretty big since it contains the whole cocos framework.

Cool. so if we change the main.cpp in other platform, it should works, right?

Didn’t test it, but I’m pretty sure that it should.