TresCom Forums

TresCom : The Trespasser Fan Gateway...
It is currently Tue May 24, 2022 1:00 pm

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Blender 3.0 TPM Addon
PostPosted: Thu May 27, 2021 6:16 pm 
Offline
Gallimimus
Gallimimus
User avatar

Joined: Fri Nov 27, 2009 8:28 pm
Posts: 604
Location: England, UK
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.


Attachments:
io_mesh_tpm-0.4.1.zip [10.53 KiB]
Downloaded 52 times

_________________
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



Last edited by LtSten on Tue Jan 18, 2022 6:23 pm, edited 3 times in total.
Top
 Profile  
 
PostPosted: Fri May 28, 2021 1:45 am 
Offline
T-Rex Killer
T-Rex Killer
User avatar

Joined: Thu Apr 24, 2003 11:20 pm
Posts: 12225
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


Top
 Profile  
 
PostPosted: Fri May 28, 2021 7:14 am 
Offline
T-Rex
T-Rex
User avatar

Joined: Thu Feb 20, 2014 9:13 pm
Posts: 3823
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
Image


Top
 Profile  
 
PostPosted: Thu Jun 24, 2021 4:35 pm 
Offline
Brachiosaurus
Brachiosaurus
User avatar

Joined: Wed Nov 18, 2015 8:17 pm
Posts: 113
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!


Top
 Profile  
 
PostPosted: Sun Jul 25, 2021 3:51 pm 
Offline
T-Rex Killer
T-Rex Killer
User avatar

Joined: Mon Dec 06, 2004 5:21 pm
Posts: 13369
Location: Isla Sorna
A crucial addition to the Tres modding app arsenal, many thanks...

_________________
->Tres2020 Starter Kit

"Well, as long as you're under there, you can check the breakers," Thorne said. ... "There's a box right behind the front bumper. Over on the left."
"I see it." [said Sarah]
...
"The box is in backward. Flip all the switches the other way. Are you dry?"
"No, Doc. I'm soaking wet, lying in the damn mud."

~Michael Crichton


Top
 Profile  
 
PostPosted: Wed Dec 15, 2021 6:11 pm 
Offline
Gallimimus
Gallimimus
User avatar

Joined: Fri Nov 27, 2009 8:28 pm
Posts: 604
Location: England, UK
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

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



Top
 Profile  
 
PostPosted: Wed Dec 15, 2021 8:47 pm 
Offline
Dinosaur egg
Dinosaur egg

Joined: Thu Jun 24, 2021 12:59 am
Posts: 15
Legend!


Top
 Profile  
 
PostPosted: Mon Dec 20, 2021 10:58 am 
Offline
Dinosaur egg
Dinosaur egg

Joined: Sat Dec 11, 2021 3:07 am
Posts: 4
Location: 'Straya (That place where half of all Trespasser bird noises come from)
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.


Top
 Profile  
 
PostPosted: Sun Jan 16, 2022 12:30 am 
Offline
-=TresCom Website Manager=-
-=TresCom Website Manager=-

Joined: Sun Nov 10, 2002 9:41 pm
Posts: 1449
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:
File comment: The TPM which was damaged upon export from Blender.
DamagedTPM.7z [204.01 KiB]
Downloaded 43 times

_________________
You can usually find me on our Discord.

Image
https://www.trescom.org/download/trespasser-2020-a-trespasser-modding-starter-kit/
Image
https://www.trescom.org/download/trespasser-arena/
Top
 Profile  
 
PostPosted: Tue Jan 18, 2022 6:22 pm 
Offline
Gallimimus
Gallimimus
User avatar

Joined: Fri Nov 27, 2009 8:28 pm
Posts: 604
Location: England, UK
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

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



Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 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:  
cron

Powered by phpBB® Forum Software © phpBB Group