From 24e982a0ada5213c507522026f9e59af358bc265 Mon Sep 17 00:00:00 2001 From: Colin Basnett Date: Tue, 15 Apr 2025 03:10:29 -0700 Subject: [PATCH] UT2K4 can now do automatic texture lookups from material names --- io_scene_ase/writer.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/io_scene_ase/writer.py b/io_scene_ase/writer.py index ccfa73a..164fa72 100644 --- a/io_scene_ase/writer.py +++ b/io_scene_ase/writer.py @@ -118,6 +118,12 @@ class ASEWriter(object): submaterial_node.push_child('MATERIAL_NAME').push_datum(material) diffuse_node = submaterial_node.push_child('MAP_DIFFUSE') diffuse_node.push_child('MAP_NAME').push_datum('default') + # For inscrutible reasons, the UT2K4 ASE importer uses the BITMAP value + # when doing material lookups on import. It also has a hard-coded bit of logic to + # strip off the extension, so we must oblige and tack on the .bmp extension. + # In addition, it must have a leading backslash in order to find the beginning + # of the path. + diffuse_node.push_child('BITMAP').push_datum(f'\\{material}.bmp') diffuse_node.push_child('UVW_U_OFFSET').push_datum(0.0) diffuse_node.push_child('UVW_V_OFFSET').push_datum(0.0) diffuse_node.push_child('UVW_U_TILING').push_datum(1.0)