Blender Add-On for optimal import of my Mario Kart 8 rips - Ray Koopa - 10-08-2015
This add-on optimizes all my Mario Kart 8 model rips to be perfectly displayed in Blender.
OBJ/MTL or DAE imports are not perfect when importing them into Blender. I could fix it, but that would break the files in some other stupid programs. So I kept it at a compatible, but more ugly minimum. Specifically, OBJ/MTL imports have separate texture slots for alpha and color, resulting in a dirty border on alpha-transparent textures. Also, some textures are mapped incorrectly (mostly it's normal to diffuse slots for shaded objects like water). Just look at these horrible gray borders around leafs and the weird water normal texture:
My script fixes all this, and after importing the OBJ or DAE files with it, applying all the additional effects of normal, specular and emissive maps, it looks like this:
No more g( r )ay borders on the leafs, detailled sand and stone patterns and additional effects as soon as you render. Of course, the water turned transparent; but that's correct, as it's shaded in-game and the normal map is surely wrong as a diffuse texture!
The add-on is installed in a typical Blender way. This means: - Download my addon zip file here: http://ray.syroot.com/vg/rayobjdae/io_scene_rayobjdae.zip
- Go to your Blender installation directory, into the folders "<version>\scripts\addons".
- Into there, extract my addon (so that the two python code files will be placed inside a "<version>\scripts\addons\io_scene_rayobjdae" folder).
- Start Blender, and go to File > User Preferences.
- Switch to the "Add-ons" tab, and from the categories on the left side, select "Import-Export", or just search for "Ray"
- Tick the left box of the "Import-Export: Optimized OBJ/DAE import for Ray Koopa Rips" plugin row to enable it.
- Click "Save User Settings" to have it enabled every time you start Blender now.
- Instead of using File > Import > Collada (.dae) or Wavefront (.obj), use "OBJ/DAE Model Rip (.obj;.dae)".
- Browse to my downloaded rip OBJ or DAE file and double click it. The script will do its stuff after the default Blender importer imported it. If you want to see it in action (or get an error), watch the console.
That's it! The model has been loaded in a more perfect way now. If you have trouble with it, please send me the console output and I will see what I can do.
There are also some interesting options in the import dialog, but you don't normally have to touch them:
- Optimize Textures: Unticking this will keep the buggy texture slots and not recreate them from scratch.
- Remove DAE shininess: When importing a DAE, Blender sets an ugly high shininess on everything, this resets it back to 0.
- Force Version: Some textures, like the ones of trophies, come in different versions, recognizable from their filename. E.g., a trophy has a version "1" for gold, "2" for silver and "3" for bronze. Normally, the version mentioned in the OBJ file is used (mostly "1" for gold in my rips), but you can override it here to load the version "2" or "3", or whatever exists. Here's a quickly imported silver fire flower trophy, just by typing "2" there:
- This is guaranteed to work on rips by me. If you try it on other rips, the results may not be complete or erroneous, depending on how the others ripped their models. It's important texture files are in the same folder as the model file (not sure if my new add-on even handles textures in other folders).
- It does not load the *_Add, *_Alp, *_Trm or *_Mtl textures, as I don't know how to apply them (and what they are exactly). Please share information on how to apply them in Blender if you know about it!
- Since my rips do not include the bake texture coordinate layers, this script cannot add it back (even if the baked textures are included in the rips). The layers just created a horrible outcome for must cheap model editing programs, and I wasn't 100% sure on how to correctly apply it anyway, so I left it out.
- Some textures have a buggy transparency, depending on how (in)correctly TexConv2 converted them. That would have to be fixed in the texture image manually which I try to do in my rips, but I might have missed some spots. If you find a buggy texture, just remove the alpha channel out of the affected textures (SNES Donut Plains 3 for example had a weirdly striped road at first).
- It also doesn't fix the wrong repetition setting of textures as it can't know those settings (e.g. eye pupil overlays correctly would not repeat, Lakitu Referee's body would wrap-repeat...).
- 18.05.2016 - 1.1.0
- Now reusing already loaded textures instead of loading them multiple times.
- "Force Version" is disabled in the import dialog if "Optimize Textures" is unchecked, as it cannot be handled without that.
- When no texture name could be parsed, the texture slots are left as they are instead of discarding them.
- Smaller performance and code style optimizations.
- 17.05.2016 - 1.0.0
WTFPL. Do what you want with my add-on code, even using it as a base for your own add-ons; I don't care. Just play nice!
RE: Blender Script to optimize my Mario Kart 8 rips - iyenal - 10-30-2015
@Ray Koopa Can you upload some _Add, *_Alp, *_Trm and *_Mtl textures please, I want to know what is the texture map type for upgrading your very good script . Thanks !
RE: Blender Script to optimize my Mario Kart 8 rips - Ray Koopa - 10-30-2015
They are all included with the download, just not used by the script. Not every texture has it.
RE: Blender Script to optimize my Mario Kart 8 rips - TM67 - 11-15-2015
Are the textures named with "bake" (bake_CHARACTERNAME_g00_b00_f00, for example) in the characters' textures the emmisive textures? Aren't they Ambient Oclussion maps?
RE: Blender Script to optimize my Mario Kart 8 rips - Ray Koopa - 11-15-2015
Yes, but their map isn't included in my model rips.
RE: Blender Script to optimize my Mario Kart 8 rips - TM67 - 11-15-2015
(11-15-2015, 01:33 PM)Ray Koopa Wrote: Yes, but their map isn't included in my model rips.
OK Do you know know how to manually apply these maps to the model in Blender or 3DS Max?
RE: Blender Script to optimize my Mario Kart 8 rips - iyenal - 11-21-2015
(11-15-2015, 03:01 PM)TM67 Wrote: (11-15-2015, 01:33 PM)Ray Koopa Wrote: Yes, but their map isn't included in my model rips.
OK Do you know know how to manually apply these maps to the model in Blender or 3DS Max?
See this : http://wiki.polycount.com/wiki/Ambient_occlusion_map
RE: Blender Script to optimize my Mario Kart 8 rips - TM67 - 11-21-2015
(11-21-2015, 06:26 AM)iyenal Wrote: (11-15-2015, 03:01 PM)TM67 Wrote: (11-15-2015, 01:33 PM)Ray Koopa Wrote: Yes, but their map isn't included in my model rips.
OK Do you know know how to manually apply these maps to the model in Blender or 3DS Max?
See this : http://wiki.polycount.com/wiki/Ambient_occlusion_map
Thanks, it's really helpful But what I actually want is how to apply those ambient occlusion maps from the characters' files into to the models in 3DS Max
RE: Blender Script to optimize my Mario Kart 8 rips - Yarcaz - 11-26-2015
will the script work if one was to rip the mii costumes from mario kart 8?
RE: Blender Script to optimize my Mario Kart 8 rips - Ray Koopa - 11-26-2015
No, it does not rip data, just optimizes my existing rips.
RE: Blender Script to optimize my Mario Kart 8 rips - iyenal - 04-24-2016
Your script work with default Blender Render or Cycles ?
RE: Blender Script to optimize my Mario Kart 8 rips - Jinzo-Advance - 04-24-2016
I don't know about the other files, but I think MTL files are lists. If you have Notepad++ installed on your PC, try opening one with it.
Edit: Here, I'll show you what one looks like in Notepad++ if you think it will help. If you have other MTL files, try taking a look at them in Notepad++ if you think it might help you understand them better.
RE: Blender Script to optimize my Mario Kart 8 rips - iyenal - 04-25-2016
Yes MTL files are lists, DAE also (ASCII, not binary as in FBX) where textures coordinates (UV) and textures files directories are stored.
But MTL can't store normal and specular maps.
RE: Blender Script to optimize my Mario Kart 8 rips - iyenal - 04-25-2016
It don't work with Blender 2.77, the console tell me Optimizing "texture" but after no textures is imported, including diffuse.
RE: Blender Script to optimize my Mario Kart 8 rips - Ray Koopa - 05-16-2016
Did it throw an error? If so, can you give me the Python exception?
Otherwise, the OBJ / DAE file just has to lie in the same folder as the textures. You also need write access to that folder as I dumbly have to save a new blend file to make paths relative.
(My god, this was one of my first scripts. Maybe I should write it a little better next time).
|