I've put together a new Blender addon for TPM import/export to support newer versions of Blender. This addon was initially developed for 2.xx from 2.80 onwards (although it had issues with a few of the early 2.8x versions - 2.92 worked well, and was the latest version at time of authoring).
Blender 3.0 has since been released, and is readily available. As such, I'm dropping any support for 2.xx and only providing a 3.0 version. Feedback is welcome if you find anything which is behaving strangely.
This is still a reasonably untested extension - MikeTheRaptor has very kindly been my main guinea pig for this, but I would urge you to (for the moment) have a backup of your work/.blend before you use this extension, just in case. Expect to be able to break it and find things that don't work or aren't great. If you do have constructive feedback, please feel free to either leave it here or let me know on Discord.
Versions:The latest version is 0.4.1, which contains a bugfix for 0.4.0.
Change log:- Spoiler: show
- 0.4.1: Fixed a bug where the data exported from the TPM had been freed (bmesh now persists until after writing the TPM). This would lead to incorrect export results.
Installation:- You should be able to install it as you would any other plugin. If you're having trouble, simply extract the contents of the zip into a new folder named io_mesh_tpm in your Blender addons folder (e.g. Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons). Remember to enable it in the preferences - search for "Trespasser".
- It should appear under "File > Import" and "File > Export" as "Trespasser Model (.tpm)"
Importing:- The Import dialog conists of a file explorer with some additional options on the right-hand side. Browse to a TPM file you wish to import (only one file at a time is supported, but this may contain multiple models)
- You can hover over the options to display a tooltip explaining what they do.
- By default, textures are expected to be located in the same directory as the TPM. This can be overriden by specifying a path in the "Texture path override" option.
- By default, "Ignore texture directories" is enabled. This means that any prefix in the material's maps (usually of the form "Map\lab", "Map\be", etc) are discarded. Use this if your textures live in the same directory as the TPM.
- "Import to Active Collection" will add the TPM's contents to the current scene collection. Enabling this tickbox will instead create a new collection.
- "Overwrite existing materials" will replace any materials with the same name already located in the .blend file.
- "Bone" and "Skin" blocks are not currently supported and will be skipped on import.
Use notes:- Blender does not support duplicate faces, which are sometimes used in Tres models for double-sided alpha faces. These will be silently ignored, since Blender defaults to rendering faces two-sided.
- Any errors should be reported as a tooltip. If you want to view more verbose output, enable the Blender console under "Window > Toggle System Console".
- Materials make use of nodes. It is best to examine the setup of an imported model to see how you should set up your own materials. However, generally you should consider the following:
- The surface should be of BRDF or BSDF type
- Each texture input should be an "Image Texture" node
- The "colormap" image should connect to the base/diffuse colour slot
- The "bumpmap" should go through a Bump module and be input into the Normal slot
- The "opacitymap" texture should go into the "Alpha" slot and the material's Blend Mode should be set to Alpha Clip.
- There is no valuetable/tscript support, nor are subobjects linked to their parents.
- Instances are respected - you should use positions, rotations, and scales relative to the underlying mesh.
Exporting:- Exporting works with the current selection. You should select the meshes you want to include when performing an export.
- All directory prefixes are stripped from texture names upon export. This is to prevent paths such as "C:/Users/..." etc from being included. Currently, this means it is not possible to export with "Map\mapname" prefixes. If this is required, you should adjust them manually after export.
- Due to Blender not supporting duplicate faces, you must decide how to export alpha faces. These only apply when a material has an alpha node input. The options act as follows:
- "Forward Only" exports only the forward-facing face
- "Double Sided" duplicates the front face and flips the winding order
- "Use Material Backface Culling" examines the "Backface Culling" material option (so occurs on a per-material basis) and writes the back face if and only if this is disabled.
_________________
Bringing TPA CRCs up the well, amongst other file format adventures.
Blender 3.0 TPM Plugin
Legacy work below:
- Spoiler: show
- AUDIO PROJECTS // AnneAudioAdventure / Anne&Hammond
RESOURCES // Music List