Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converting MBAC files to OBJ #7

Closed
Durik256 opened this issue Feb 28, 2020 · 17 comments
Closed

Converting MBAC files to OBJ #7

Durik256 opened this issue Feb 28, 2020 · 17 comments

Comments

@Durik256
Copy link

@Durik256 Durik256 commented Feb 28, 2020

Hi, help me, I’ve been looking for information about editing ".mbac" for the third day now, all I found was exporting ".bac / .tra" to 3ds max, and converting them to ".mbac / .mtra" and viewing them but there is no reverse process, or at least conversion to ".obj". And I saw "tool / mbac2obj.py" with you, but I don’t understand how to use it, opening it gives an error in the blender, could you write a brief import instruction let's say "moodel.mbac" in a blender ???? thanks for earlier (my brains have already melted ...)

@minexew
Copy link
Member

@minexew minexew commented Mar 4, 2020

Do you have any experience with running Python programs? The utilities in this repository require a certain proficiency with the command line, they are not really targeted towards the "general public".

@Durik256
Copy link
Author

@Durik256 Durik256 commented Mar 6, 2020

Do you have any experience with running Python programs? The utilities in this repository require a certain proficiency with the command line, they are not really targeted towards the "general public".

I need a very brief instruction, I can handle it)

@minexew
Copy link
Member

@minexew minexew commented Mar 6, 2020

Assuming you're on Windows:

  • installed latest version of Python (default options should be fine)
  • open the command line
  • use the CD command to navigate to the directory where you have downloaded mbac2obj.py (but download the entire repository, other files are needed by the script)
  • execute python mbac2obj.py <mbacpath> converted.obj
    (substitute <mbacpath> with the full path to your model file)
  • if you are lucky and get no error, "converted.obj" will be generated next to the script, and you can load it into blender normally
  • keep in mind that textures need to be matched manually, since the MBAC file does not contain any info about them
@Durik256
Copy link
Author

@Durik256 Durik256 commented Mar 6, 2020

Thanks a lot, everything turned out, I made a GUI shell for windows(https://github.com/Durik256/MBAC-to-OBJ).
converts a little wrong(flip polygon and incorrect UV);
"https://i.ibb.co/vwpHpMS/export.png"
And through your scripts, can you convert .mbac and .mtra to fbx?
many files are not converted :(

@minexew
Copy link
Member

@minexew minexew commented Mar 6, 2020

Thanks a lot, everything turned out, I made a GUI shell for windows

Glad that you got it sorted out, and nice work on the tool!

converts a little wrong(flip polygon and incorrect UV);

Ok, this is interesting! If you can send me the MBAC + texture, I will look into this. Perhaps there is some UV scaling necessary that is hard-coded somewhere outside the mbac file?

And through your scripts, can you convert .mbac and .mtra to fbx?

I'm afraid not, for one because FBX is not an open format, but also because we haven't cracked MTRA yet, I believe we have an MTRA parser, but it only outputs a textual description.

many files are not converted :(

If you tell me more about what the issue is, I can investigate.

@minexew minexew changed the title HELP ME PLEASE!!!!!!!!!!!!!!!!! Converting MBAC files to OBJ Mar 6, 2020
@Durik256
Copy link
Author

@Durik256 Durik256 commented Mar 6, 2020

here is the link to the jar game : "https://drive.google.com/open?id=1RjBxe-r_Oj1DBZMMv0J-R17rk5-lpwDH" Many models cannot be converted from this game, including character models (pers_killer.mbac, etc.)! The model that incorrectly converted (UAZ1_00.mbac ant tx: t1.bmp). Thanks for answers)))

@minexew
Copy link
Member

@minexew minexew commented Mar 8, 2020

In the meantime, I'd recommend looking into this release instead: https://drive.google.com/open?id=1FqefgZKaK5qee14vx0-z0FIC9FzOTyb_; while targeting 176x220 instead of 240x320, it actually has textures in higher resolution (256x256) and no carrier branding. This is the one that I am working on and it seems we will be able to decode all the models and match textures.

@Durik256
Copy link
Author

@Durik256 Durik256 commented Mar 8, 2020

All the same, does not convert all models))

@minexew
Copy link
Member

@minexew minexew commented Mar 8, 2020

I have updated the scripts today, you can try again.
Also have a look here: https://minexew.github.io/mbac-gallery/Stalker.html (not all models are textured, because at the moment I have to do the assignment one by one)

@Durik256
Copy link
Author

@Durik256 Durik256 commented Mar 9, 2020

everything works, cool)))

@minexew
Copy link
Member

@minexew minexew commented Mar 10, 2020

Great. I still haven't decided how to systematically deal with the model rotation (since it doesn't affect other games that I tested)
Also, if you can provide me with more model<->texture mappings, I will incorporate them and re-render the gallery. Eventually, I'd like to include other games as well.

@minexew
Copy link
Member

@minexew minexew commented Mar 10, 2020

Cool, I guess I can extract texture names from the .mtl files?
(since what I really need are just the MBAC<->BMP pairings)

@minexew
Copy link
Member

@minexew minexew commented Mar 11, 2020

I have updated the gallery with your texture mappings and corrected model coordinate system.

@Durik256
Copy link
Author

@Durik256 Durik256 commented Mar 11, 2020

excellent work) in the models that I sent you, the coordinate system is also fixed)

@minexew
Copy link
Member

@minexew minexew commented Mar 29, 2020

I believe this is now resolved! :)

@minexew minexew closed this Mar 29, 2020
@minexew
Copy link
Member

@minexew minexew commented Apr 11, 2020

FWIW, this is the code I used to extract the texture names: https://gist.github.com/minexew/480984467fa374335581b6d833fb3817

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants