OOTP Developments Forums

OOTP Developments Forums (https://forums.ootpdevelopments.com//index.php)
-   OOTP Mods - 3D Models (https://forums.ootpdevelopments.com//forumdisplay.php?f=3879)
-   -   Small Utility: MTLfixer (https://forums.ootpdevelopments.com//showthread.php?t=361290)

eriqjaffe 03-14-2025 11:07 AM

Small Utility: MTLfixer
 
I made this for my own use and figure that the other stadium makers may find it useful. It's a node.js app that goes through an MTL file and makes some adjustments to the file and to some files in the textures folder.

It does require you to be a little comfortable on the command line because I haven't packaged it as a stand-alone executable. It requires node.js and yarn to be accessible along your system path.

Code:

git clone https://github.com/eriqjaffe/mtlfixer && cd mtlfixer
yarn
cd /path/to/mtlfile 
node ./path/to/script/index.js mtlfile.mtl (optional --night)

What it does:
  • Create a backup of the mtl file.
  • Parse the mtl file and replace matching text blocks* with the corresponding 3d audience texture block.
  • Any texture files that end in "_day.jpg" will be converted to png format (which is required by OOTP), the jpg files will be deleted and the mtl file updated accordingly.
  • Optionally create corresponding "_night" files for any "_day" files. This will overwrite any _night files that already exist in the textures folder!
  • Write the updated mtl file.
https://github.com/eriqjaffe/mtlfixer

* - regular expressions are used to match the text blocks - I'm using the same crowd textures that silvam released years ago and that's what this is looking for. If it doesn't find the right blocks, it won't replace the crowds.

silvam14 03-15-2025 09:45 AM

Very cool. Must save a lot of time


Sent from my iPhone using Tapatalk


All times are GMT -4. The time now is 08:45 AM.

Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright © 2024 Out of the Park Developments