Page 1 of 2

[release] Blender *.PKG Import/Export AddOn

Posted: Sun Feb 28, 2016 11:58 pm
by aaro4130
BLENDER PKG IMPORT/EXPORT
Welcome to the thread for the Blender (https://blender.org) PKG import/export addon

NOTE: All of the documentation in this post is available locally in the readme.txt found in v0.11 and above.

Image

Requirements
The addon was created in Blender 2.76. If you have any issues with the addon in a previous Blender version, I will NOT provide support!!

Installation
Blender 32 Bit
On 32 bit Blender installations, extract the downloaded ZIP file to

Code: Select all

C:\Program Files (x86)\Blender Foundation\Blender\2.76\scripts\addons
Blender 64 Bit
On 64 bit Blender installations, extract the downloaded ZIP file to

Code: Select all

C:\Program Files\Blender Foundation\Blender\2.76\scripts\addons
After you extract the Add-on, it will NOT show up in your import/export list by default!

After extracting the Add-on, start Blender. Once Blender is started, open up File->User Preferences, and navigate over to the Add-ons tab. Find "Import-Export: Midtown Madness 2 PKG Format", and enable it. Click "Save User Preferences" on the bottom of the dialog, and close the dialog.

Now you will be able to use the Add-on.

Importing
Textures
Textures with the format BMP, PNG, TGA will be imported. TEX is NOT supported.

MTX Files
MTX files will automatically be imported if found

Geometry Flags
Because geometry flags are done via geometry, and not via material. These are NOT imported.

Exporting
Reflections
To change the "Shininess" of a material, change the "Reflectivity" property under the "Mirror" section. It doesn't matter if the property is grayed out; it is still editable and will affect export.

Geometry Flags
Applying the "Shadeless" tick in Materials settings will export any geometry with that material as shadeless in MM2

Textures
When exporting, the default texture name for a material will be the material name. If that material has a texture assigned to it in the textures tab, then the texture name will be used.

Matte materials should be named "mm2:notexture". It does not matter if Blender adds .001, .002, etc to the end of this, the exporter will ignore that.

XRefs
To define an xref, simply name an empty object "xref:xrefname". Where xrefname is the name of the PKG file to xref e.g. "sp_parkmtr_f". Again it does not matter if Blender adds the .001 and so on. Make sure not to include the ".pkg" extension in the xref name.

XRefs will not export their rotation. Only their position.

Paintjobs
In the export dialog, in the bottom left, there is a text box called "Material Replacement Info". This text box is there for creating multiple paintjobs.

The paintjobs system in this Add-on differs from the one in ZModeler, but works in the same way in the end.

To define a paintjob replacement, use this format:

Code: Select all

_yellow,_red
To define multiple paintjob replacements, use this format:

Code: Select all

_yellow,_red|_yellow,_blue
MTX Files
MTX files will be created if the location of an object is not 0,0,0. Objects do not need the :m suffix. Adding the :m suffix will crash the game, because it will be exported with that name into the PKG file.

Export Type
Export type (Dashboard, Trailer, Prop) will be automatically determined. And all types of objects such as city props, buildings, etc should work automatically

Transparency
Transparency is done using Blenders native system. Tick "Transparency" in the Material panel, and change the Alpha, to make transparent materials.

Vertex Colors
Vertex colors can be exported by ticking "Vertex Colors" in the export dialog

FAQ
How do you know what questions are frequently asked, if you are just releasing this now?
Trust me, I know

I imported my PKG file, I have my textures in the right format, but I don't see them in Blender!?
You have to be in Material render mode, rather than Solid. You also must have lighting in the scene to see materials.

Why do the imported normals get overwritten when I enter edit mode?
Blender automatically recalculates the normals when entering edit mode. To restore original, or close to original normals for default vehicles, use the remove doubles tool, then apply the Edge Split modifier at an angle above 80 degrees

Upcoming/Planned Features
-BND/BBND Import-export

Downloads
v0.1, Feb 28 2016 : https://xmx.fyi/aaro4130/io_scene_pkg.zip
v0.11, Feb 29 2016 : https://xmx.fyi/aaro4130/io_scene_pkg_011.zip
v0.12, Feb 29 2016 : https://xmx.fyi/aaro4130/io_scene_pkg_012.zip
v0.13, Mar 02 2016 : https://xmx.fyi/aaro4130/io_scene_pkg_013.zip
latest public build (Aug 2016) : https://github.com/Dummiesman/PKGImport ... master.zip

Posted: Mon Feb 29, 2016 12:43 am
by Diatosta
Time in Zmod: 2 centuries
Time in Blender: 2 minutes
Downforce added: 1 thousand

I mean, the results speak for themselves amirite?

Image

But really, it was so much easier than using Zmodeler, which in fact won't even launch in my PC for some unknown reason

Posted: Mon Feb 29, 2016 4:22 am
by aaro4130
Here's my first mod. Ford Mustang Ute. Took only 10 minutes too :D
Image

Version 0.11 Released
-Fixed MTX file export
-General code improvements

Posted: Mon Feb 29, 2016 8:23 pm
by Franch88
Very nice work. :D I'll see to try it, I tried Blender time ago and I've now updated it.

Posted: Mon Feb 29, 2016 9:00 pm
by Kunal2045
Awesome. I think I'll consider using blender ;)

Posted: Tue Mar 01, 2016 3:01 am
by aaro4130
Version 0.12 Released
-General code improvements
-Added Auto bound. A feature to automatically generate default-style bounds. Availible in the export options
Image

Posted: Wed Mar 02, 2016 11:48 pm
by aaro4130
Version 0.13 Released
-General code improvements

-Added geometry flags support on exporting, as well as importing. This fixes imports for some models that would previously not import. Regarding exporting: See the Export part of the documentation for information

-Fixed an error where the 'Shininess' value would not be imported. However, it was exported. This would cause shiny vehicle underbodies, among other issues.

Posted: Thu Mar 10, 2016 6:45 pm
by aaro4130
Version 0.14 Released
Changelogs from now on will be listed in the commits to GIT
https://github.com/Dummiesman/PKGImport ... e518c1a70a

Download in first post

Posted: Wed Mar 30, 2016 6:52 am
by aaro4130
Version 0.2 Released
Changelogs from now on will be listed in the commits to GIT
https://github.com/Dummiesman/PKGImport ... 46cbfeb63e

This version includes support for a major discovery, Vertex colors!
Image
Image

Image

Image

Download in first post

Posted: Wed Mar 30, 2016 5:32 pm
by aaro4130
Version 0.21 Released
Changelogs from now on will be listed in the commits to GIT
https://github.com/Dummiesman/PKGImport ... 18544f2169

This version includes finished off support for Midnight Club imports
Image

Download in first post

Posted: Sun Apr 24, 2016 3:43 am
by aaro4130
Version 0.22 Released

Change summary : This version fixes UV and vertex color mismatches, which would cause the mesh to be exported incorrectly in many cases

Changelogs from now on will be listed in the commits to GIT
https://github.com/Dummiesman/PKGImport ... iff=split9

Download in first post

Posted: Tue Apr 26, 2016 10:38 pm
by Franch88
Very good work so far. :wink: The vertex colors feature is really cool and interesting. :D

I advice you that, apparently, the add-on doesn't work with the latest 2.77a version.

Posted: Wed Apr 27, 2016 2:08 am
by aaro4130
Very good work so far. :wink: The vertex colors feature is really cool and interesting. :D

I advice you that, apparently, the add-on doesn't work with the latest 2.77a version.
Works fine here. Did you install it into the 2.77 folder? (it needs to be reinstalled after upgrading Blender versions)

Posted: Fri Apr 29, 2016 9:39 pm
by COOLGUY200
Here's my first mod. Ford Mustang Ute. Took only 10 minutes too :D
Image
OMG you should release it :P I love it when people edit the default cars :D

Posted: Sat Jul 23, 2016 4:10 am
by aaro4130
Updated to 0.2.3
- added support for traffic light exporting
- added apply modifiers option for exporting
- changed material color import behaviour, this should fix improperly colored wheels, etc.
- incremented version number to 0.2.3

Download in first post