Recreating bcmdl-files?

Discussion in '3DS - ROM Hacking, Translations and Utilities' started by xXDungeon_CrawlerXx, Oct 23, 2015.

  1. xXDungeon_CrawlerXx
    OP

    xXDungeon_CrawlerXx GBAtemp Maniac

    Member
    1,187
    510
    Jul 29, 2015
    Liverpool
    Hey Guys,

    I just extracted a model from a bcmdl and edited it.
    Now I want to import this obj to bcmdl but there's no tool which is able to do this.
    EFE can't reinsert models...

    So I thought I could create a bcres file and convert/compile it to bcmdl?
    Or is there a way to replace the model inside of the bcmdl with a edited one ?
    Warning: Spoilers inside!
    Anyone a idea how I could do this?
     
  2. xXDungeon_CrawlerXx
    OP

    xXDungeon_CrawlerXx GBAtemp Maniac

    Member
    1,187
    510
    Jul 29, 2015
    Liverpool
    /push
     
  3. gdkchan

    gdkchan GBAtemp Regular

    Member
    159
    189
    Jul 8, 2015
    Brazil
    The original file is obviously LZSS compressed. To make it work on the game, you'll need to compress the new file back. Well, that assuming that this cgfx you created is actually correct.

    Edit: bcres and bcmdl are basically the same thing. "bcmdl" basically means that the file only contains model data, while "bcres" means that it may contain model and other stuff too, such as textures, animations and so. but they are all the same format.
     
    Last edited by gdkchan, Oct 24, 2015
  4. xXDungeon_CrawlerXx
    OP

    xXDungeon_CrawlerXx GBAtemp Maniac

    Member
    1,187
    510
    Jul 29, 2015
    Liverpool
    thanks dude :D Will try it when I'm home ;)
    btw. is it just a error of EFE that it shows the alpha of a texture if I only use one Texture at the same place?
    Normally Nintendo uses more than one Texture at the same position (closed eyes, open eyes, y'know).
    EFE exports this with just one Texture (instead of using Model_01_c00, Model_01_c01,...) it exports it with Model_01_eyes.
    Now I tried to add all Textures back to the file by changing the "Model_01_eyes" to "Model_01_c00,..." in mtl and obj.
    For example:
    Code:
    newmtl Model_01_c00
    	Ns 10.0000
    	Ni 1.5000
    	d 1.0000
    	Tr 0.0000
    	Tf 1.0000 1.0000 1.0000 
    	illum 2
    	Ka 0.5880 0.5880 0.5880
    	Kd 0.5880 0.5880 0.5880
    	Ks 0.0000 0.0000 0.0000
    	Ke 0.0000 0.0000 0.0000
    	map_Ka Model_01_c00.png
    	map_Kd Model_01_c00.png
    	map_d Model_01_c00.png
    
    newmtl Model_01_c01
    	Ns 10.0000
    	Ni 1.5000
    	d 1.0000
    	Tr 0.0000
    	Tf 1.0000 1.0000 1.0000 
    	illum 2
    	Ka 0.5880 0.5880 0.5880
    	Kd 0.5880 0.5880 0.5880
    	Ks 0.0000 0.0000 0.0000
    	Ke 0.0000 0.0000 0.0000
    	map_Ka Model_01_c01.png
    	map_Kd Model_01_c01.png
    	map_d Model_01_c01.png
    
    newmtl Model_01_c02
    	Ns 10.0000
    	Ni 1.5000
    	d 1.0000
    	Tr 0.0000
    	Tf 1.0000 1.0000 1.0000 
    	illum 2
    	Ka 0.5880 0.5880 0.5880
    	Kd 0.5880 0.5880 0.5880
    	Ks 0.0000 0.0000 0.0000
    	Ke 0.0000 0.0000 0.0000
    	map_Ka Model_01_c02.png
    	map_Kd Model_01_c02.png
    	map_d Model_01_c02.png
    
    instead of
    Code:
    newmtl Model_01_mouth
    	Ns 10.0000
    	Ni 1.5000
    	d 1.0000
    	Tr 0.0000
    	Tf 1.0000 1.0000 1.0000 
    	illum 2
    	Ka 0.5880 0.5880 0.5880
    	Kd 0.5880 0.5880 0.5880
    	Ks 0.0000 0.0000 0.0000
    	Ke 0.0000 0.0000 0.0000
    	map_Ka Model_01_c00.png
    	map_Kd Model_01_c00.png
    	map_d Model_01_c00.png
    
    I thought this could work to add all Textures back to the bcmdl-file but I'm not sure if this will work Ingame (because it looks creepy in EFE).
    But hey: All textures are back in the bcmdl-file like in the original one!
    If I use the original, unedited mtl and obj file with EFE, it just import the "main"-Textures (Model_00, Model_01_c00, Model_02_c00) and the others are missing.
    Do you have a Idea how to do it correctly, @gdkchan?
     
    Last edited by xXDungeon_CrawlerXx, Oct 24, 2015
  5. gdkchan

    gdkchan GBAtemp Regular

    Member
    159
    189
    Jul 8, 2015
    Brazil
    when you convert the file to .obj, a lot of the original model is lost. obj is a really basic format you see. Some stuff is very specific on the 3ds gpu, for that reason Nintendo have a program called NintendoWare CreativeStudio, its part of the NintendoWare for Ctr kit. If you can get your hands on that kit would be the fastest solution for you, it have a Maya/3dsmax plugin, bch/bcmdl converter and lots of neat stuff.

    I dont think the different number of textures (from what I understood) will make the game refuse your edited file. The lack of sections may be a problem through, afaik EFE only creates the model section, so if the file have animations or smth else it will be lost.
     
  6. xXDungeon_CrawlerXx
    OP

    xXDungeon_CrawlerXx GBAtemp Maniac

    Member
    1,187
    510
    Jul 29, 2015
    Liverpool
    Yea, I understood. The funny thing is: The file does not contain any lights, animations, skeletons or something else.
    It just contains the Model and the textures (probably the file uses the animations and such from another files?).
    NW4C would be awesome and I really want it but I don't know how I should get it...
     
  7. gdkchan

    gdkchan GBAtemp Regular

    Member
    159
    189
    Jul 8, 2015
    Brazil
    So, you compressed the file back, tested on the game and it just freezes? If that is the game its probably a problem related to EFE, maybe you should report this to the author of the tool (through I think he isnt even working on this tool anymore).
     
  8. Apache Thunder

    Apache Thunder I have cameras in your head!

    Member
    4,101
    4,024
    Oct 7, 2007
    United States
    Levelland, Texas
    EFE hasn't been updated in ages and doesn't support a lot of things that will likely result in your model not working correctly once ingame. For one thing, alpha blending, material animations, skeleton information, and light objects being among many things EFE doesn't handle right now. At this point, EFE is really only useful for creating CGFX files to be used as banners for home menu apps. :P

    If you are doing texture mods, Ohana3DS does a good job at allowing you to replace textures in a cgfx/bcmdl without breaking the light, material animations, skeleton, etc data. I do recall Ohana being useful in regards to changes to the model as well. It supports more things model related. EFE is more of a general purpose tool.
     
    Last edited by Apache Thunder, Oct 24, 2015
  9. xXDungeon_CrawlerXx
    OP

    xXDungeon_CrawlerXx GBAtemp Maniac

    Member
    1,187
    510
    Jul 29, 2015
    Liverpool
    Yea, absolutly true.
    This bcmdl-files I want to edit just contains a Model + some Textures (10 different textures).
    I edited the model (removed some parts) and want to use this ingame.
    The problem: There's no way to get this file to work ingame just by rebuilding the file with EFE + compress it with LZSS :/