Blender 4.0 TPM Addon

List your programs here (game-related or other software).

Moderators: scallenger, Rebel, madppiper, TresCom Support Team

User avatar
LtSten
Gallimimus
Gallimimus
Posts: 609
Joined: Fri Nov 27, 2009 8:28 pm
Antispam: No
Location: England, UK

Blender 4.0 TPM Addon

Post by LtSten »

Since Blender has evolved somewhat with the old plugins we had for TPM support, I've developed one for the latest versions of Blender:
  • Add-on versions 1.x.y are the current versions, and intended for use with Blender 4.z
  • Add-on versions 0.x.y were developed against Blender 3.z
  • Early versions of the add-on were developed for 2.xx from 2.80 onwards
Blender 4.x is now the current version, so the 2.xx version is no longer available, and the 3.x versions are unlikely to be significantly developed further.

Development primarily takes place on GitHub - please do open an issue if you have feedback, a feature request, or wish to report a bug.

This is still a reasonably untested extension - I am aware of it having been used by a few people, but I would urge you to (for the moment) have a backup of your work/.blend before you use this extension, just in case.

Versions:
The latest stable version is 1.0.0, which moves to supporting Blender 4.0.
Alternatively, see the GitHub releases page.

Documentation:
Please see the GitHub page, especially the user guide.
Attachments
io_mesh_tpm-1.0.0.zip
(34.61 KiB) Downloaded 38 times
io_mesh_tpm-0.5.2.zip
(15.44 KiB) Downloaded 73 times
Last edited by LtSten on Tue Nov 14, 2023 8:49 pm, edited 14 times in total.
Bringing TPA CRCs up the well, amongst other file format adventures.
Blender 3.0 TPM Plugin [Project GitHub]
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: Blender 2.80+ TPM Addon

Post by machf »

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
User avatar
TheIdiot
T-Rex
T-Rex
Posts: 4343
Joined: Thu Feb 20, 2014 9:13 pm
Location: Canada, eh?

Re: Blender 2.80+ TPM Addon

Post by TheIdiot »

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. :)
User avatar
Deadeyeguy_45
Brachiosaurus
Brachiosaurus
Posts: 138
Joined: Wed Nov 18, 2015 8:17 pm

Re: Blender 2.80+ TPM Addon

Post by Deadeyeguy_45 »

This was very cool to read about! Always wanted this for Tres, and seems it's easy enough to install. I can't wait to give this a try later down the line!
In 2012, I was abused by a Weird Al lookalike. :nerd: :cry:
User avatar
Draconisaurus
T-Rex Killer
T-Rex Killer
Posts: 14032
Joined: Mon Dec 06, 2004 5:21 pm
Antispam: No
Location: Isla Sorna
Contact:

Re: Blender 2.80+ TPM Addon

Post by Draconisaurus »

A crucial addition to the Tres modding app arsenal, many thanks...
User avatar
LtSten
Gallimimus
Gallimimus
Posts: 609
Joined: Fri Nov 27, 2009 8:28 pm
Antispam: No
Location: England, UK

Re: Blender 2.80+/3.0 TPM Addon

Post by LtSten »

I've updated the original post to include a 3.0 version, which appears to work mostly unchanged and will be the version I maintain from now on.
Bringing TPA CRCs up the well, amongst other file format adventures.
Blender 3.0 TPM Plugin [Project GitHub]
User avatar
codemuk3y
Triceratops
Triceratops
Posts: 89
Joined: Thu Jun 24, 2021 12:59 am

Re: Blender 2.80+/3.0 TPM Addon

Post by codemuk3y »

Legend!
"If I have seen further it is by standing on the shoulders of Giants" Isaac Newton
DuderinoMagnificus
Dinosaur egg
Dinosaur egg
Posts: 4
Joined: Sat Dec 11, 2021 3:07 am
Location: 'Straya (That place where half of all Trespasser bird noises come from)

Re: Blender 2.80+/3.0 TPM Addon

Post by DuderinoMagnificus »

Wow, thanks for the early Christmas present! Glad I can use this through Steam now too.
This is my ost, notice there is no "P" in it.
MikeTheRaptor
-=TresCom Website Manager=-
-=TresCom Website Manager=-
Posts: 1495
Joined: Sun Nov 10, 2002 9:41 pm
Antispam: No

Re: Blender 2.80+/3.0 TPM Addon

Post by MikeTheRaptor »

Hey LtSten, something strange cropped up today when I was using your plugin. I was able to replicate the issue in Blender 3.0 with plugin 0.4.0 and Blender 2.93 with plugin 0.3.1.

Issue: TPM was originally designed to handle multiple meshes being exported into a single TPM file. Both versions of the Blender TPM plugin have been importing TPMs containing multiple meshes without issue. But when I attempt to export those same meshes back into a single TPM file, the resulting TPM file has lots of missing faces and additional unexpected and out of scale geometry.

Image

Workaround: Anyone experiencing this issue should export each individual mesh into its own TPM file. Doing this allowed me to export without any issues.

Attachments: I've attached a screenshot of the issue with some descriptive text as well as one of the affected TPM files.
Attachments
DamagedTPM.7z
The TPM which was damaged upon export from Blender.
(204.01 KiB) Downloaded 156 times
User avatar
LtSten
Gallimimus
Gallimimus
Posts: 609
Joined: Fri Nov 27, 2009 8:28 pm
Antispam: No
Location: England, UK

Re: Blender 2.80+/3.0 TPM Addon

Post by LtSten »

MikeTheRaptor wrote:Hey LtSten, something strange cropped up today when I was using your plugin. I was able to replicate the issue in Blender 3.0 with plugin 0.4.0 and Blender 2.93 with plugin 0.3.1.

Issue: TPM was originally designed to handle multiple meshes being exported into a single TPM file. Both versions of the Blender TPM plugin have been importing TPMs containing multiple meshes without issue. But when I attempt to export those same meshes back into a single TPM file, the resulting TPM file has lots of missing faces and additional unexpected and out of scale geometry.

Image

Workaround: Anyone experiencing this issue should export each individual mesh into its own TPM file. Doing this allowed me to export without any issues.

Attachments: I've attached a screenshot of the issue with some descriptive text as well as one of the affected TPM files.
Thanks Mike. I'm hoping this should be fixed in 0.4.1 - give it a go and let me know.
Bringing TPA CRCs up the well, amongst other file format adventures.
Blender 3.0 TPM Plugin [Project GitHub]
User avatar
LtSten
Gallimimus
Gallimimus
Posts: 609
Joined: Fri Nov 27, 2009 8:28 pm
Antispam: No
Location: England, UK

Re: Blender 3.0 TPM Addon

Post by LtSten »

I've performed a small update to 0.4.2 in order to more gracefully handle missing texture maps. It should now report this more clearly, with only a warning (in particular, the import should still succeed), and will create a placeholder material instead.
Bringing TPA CRCs up the well, amongst other file format adventures.
Blender 3.0 TPM Plugin [Project GitHub]
User avatar
LtSten
Gallimimus
Gallimimus
Posts: 609
Joined: Fri Nov 27, 2009 8:28 pm
Antispam: No
Location: England, UK

Re: Blender 3.0 TPM Addon

Post by LtSten »

As of 0.4.3, I've added partial support for skin blocks - these will be imported as meshes (so in particular, vertex bone assignments are not preserved). For example, this now means you should be able to import dinosaurs in a limited capacity.
Bringing TPA CRCs up the well, amongst other file format adventures.
Blender 3.0 TPM Plugin [Project GitHub]
User avatar
codemuk3y
Triceratops
Triceratops
Posts: 89
Joined: Thu Jun 24, 2021 12:59 am

Re: Blender 3.0 TPM Addon

Post by codemuk3y »

Thanks for the plugin and your continued improvement, it's made my life so much easier :)
"If I have seen further it is by standing on the shoulders of Giants" Isaac Newton
User avatar
LtSten
Gallimimus
Gallimimus
Posts: 609
Joined: Fri Nov 27, 2009 8:28 pm
Antispam: No
Location: England, UK

Re: Blender 3.0 TPM Addon

Post by LtSten »

I've performed a reasonable refactor of the addon and introduced bone/skin support in a new version, a (release candidate for) 0.5.0 which is now available. I'm holding off on recommending this as the go-to choice until I've gathered some more feedback and it's been tested more widely - for that reason, the latest stable version should still be considered to be 0.4.3 and is still available for download. However, please do feel free to try out 0.5.0 and let me know if it works for you or you encounter any issues.

The main post has been updated accordingly - give it a read and as mentioned, do send any feedback my way as usual (either here or on Discord).

As part of this, I noticed that the TPM spec says:
Skins include an extra index for each vertex, which is the bone number. This number may be zero, meaning it is not bound to any bone
However, there are valid bones ending 00 actually assigned to vertices in TPMs generated from TresEd, Trespasser itself expects to index joints from 0, and the 3ds Max plugin (tpmimport2.ms) has the following comments:
NOTE: Following the Trespasser convention, bone numbers start at zero, as
do the bone indicies in the vertex definitions.
... <snip> ...
-- Return list of bones for given mesh, searching through the given object list
-- Bone name is of form "$J%NN" Where % is the mesh name, and NN is a number
-- If zeroIsValid is false, bone number 'k' is returned in list position 'k' as expected.
-- If zeroIsValid is true, then 00 is a valid bone number, and bone number 'k' is
-- returned in position 'k+1' in the list (because MAX lists can only start at 1...)
Consistent with the former, zeroIsValid seems to be passed as true at the call site further down.

This perhaps seems like something we should mention in the file format documentation, or just change outright due to the in-practice generation of TPMs (perhaps leaving a "this was a breaking change" note). I've followed the convention of using 0 as a valid bone index in my implementation as well - being incompatible with TresEd or even Trespasser itself would make this part of the addon pretty redundant otherwise. Does anyone here have any insight on the matter?
Bringing TPA CRCs up the well, amongst other file format adventures.
Blender 3.0 TPM Plugin [Project GitHub]
User avatar
LtSten
Gallimimus
Gallimimus
Posts: 609
Joined: Fri Nov 27, 2009 8:28 pm
Antispam: No
Location: England, UK

Re: Blender 3.0 TPM Addon

Post by LtSten »

For those who are interested, I've setup a GitHub repo to better manage the development of this plugin. I'll keep providing files here and updating the main post of this thread as required, but hopefully the benefit of having a GitHub presence for the add-on will be that it's easier to support this as an (admittedly small) piece of software. Additionally (now that there is a dedicated page), if anyone is interesting in contributing, do get in touch and we can talk about what you'd be interested in adding and what would be beneficial to work on.

Also, feel free to use the issues tab for bugs and/or feature requests, as usual.
Bringing TPA CRCs up the well, amongst other file format adventures.
Blender 3.0 TPM Plugin [Project GitHub]
Post Reply