TresCom Forums

TresCom : The Trespasser Fan Gateway...
It is currently Fri Jun 18, 2021 11:15 am

All times are UTC

Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Blender 2.80+ TPM Addon
PostPosted: Thu May 27, 2021 6:16 pm 
User avatar

Joined: Fri Nov 27, 2009 8:28 pm
Posts: 601
Location: England, UK
I've put together a new Blender addon for TPM import/export to support newer versions of Blender. Theoretically the addon should work with 2.80+, but in practice I've had issues with a few of the early 2.8x versions so I'd recommend just grabbing the latest version - I've developed and tested this on 2.92, which (as of time of writing) is the most recent release.

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.

  • 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 2.92\2.92\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)"

  • 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 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.

Attachments: [10.42 KiB]
Downloaded 15 times

Bringing TPA CRCs up the well, amongst other file format adventures.
Blender 2.80+ TPM Plugin

Legacy work below:
Spoiler: show
AUDIO PROJECTS // AnneAudioAdventure / Anne&Hammond
RESOURCES // Music List

PostPosted: Fri May 28, 2021 1:45 am 
T-Rex Killer
T-Rex Killer
User avatar

Joined: Thu Apr 24, 2003 11:20 pm
Posts: 12188
Location: Lima, Peru
Great! People have been wanting soemthing like that for quite a while...

Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files

PostPosted: Fri May 28, 2021 7:14 am 
User avatar

Joined: Thu Feb 20, 2014 9:13 pm
Posts: 3541
Location: Canada, eh?
Can't figure out how to use Blender for the life of me (not that Max is any easier), but I do hope that this allows more people to get involved in Trespasser modelling. Glad to see this. :)

Current Project: Cloning Facility | My Release Thread

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group