Engineer Durik256 Posted November 9, 2023 Engineer Share Posted November 9, 2023 (edited) MESSIAH game support : +(Diablo Immortal, Ace Racing, Fantasy Westward Journey, 1 unk) \\\\\\\\\\\MeshToOBJ.exe Link on github: MeshToOBJ.exe \\\\\\\\\\\Noesis for Noesis for *.mesh/*.model link on github: fmt_mesh_diablo.py Edited February 17 by Durik256 description 1 1 Link to comment Share on other sites More sharing options...
Rinorsi Posted July 27 Share Posted July 27 On 11/10/2023 at 12:28 AM, Durik256 said: MESSIAH game support : +(Diablo Immortal, Ace Racing, Fantasy Westward Journey, 1 unk) \\\\\\\\\\\MeshToOBJ.exe Link on github: MeshToOBJ.exe \\\\\\\\\\\Noesis for Noesis for *.mesh/*.model link on github: fmt_mesh_diablo.py How did you obtain these models? I tried parsing the visible strings, MESSIAH, Compressed_P_C_N_UV1_TB, W4B_I4B, but I couldn't get any clue. The parsed vertex data, xyz, all contain abnormal values. Could you please share how you successfully read and converted the .mesh file to .obj? Thank you very much! I know mesh to obj can read the models, but I want to know the method so that I can integrate it into my Python script for execution. I'm researching ACE Racing. mesh.rar Link to comment Share on other sites More sharing options...
Engineer Durik256 Posted July 27 Author Engineer Share Posted July 27 (edited) 2 hours ago, Rinorsi said: How did you obtain these models? I tried parsing the visible strings, MESSIAH, Compressed_P_C_N_UV1_TB, W4B_I4B ... Compressed: P - (12bytes) as 3float C - (4bytes) N - (4bytes) UV1/2 - (4bytes) as 2HalfFloat TB - (8bytes) Other: template: [target][count][type] sample: W4B = target:Weight, count:4, type:Byte On my githab there is a plugin(python) for diablo, it also uses MESSIAH. (you can see the implementation there) Edited July 27 by Durik256 1 Link to comment Share on other sites More sharing options...
Rinorsi Posted July 27 Share Posted July 27 Thank you, I spent the whole day trying to understand, but even after modifying the Noesis plugin (fmt_mesh_diablo.py) according to the data you provided, it still doesn't seem to work and causes Noesis to crash. Or perhaps, how can I batch convert .mesh files to .obj using Python? Besides models, AceRacing also includes many FX or particles that are compressed with LZMA. I want to use a Python script to batch convert models to precisely extract the parts that belong to models from all the decompressed files. If you can assist me, I would be very grateful. AceRacing-Mesh.rar Link to comment Share on other sites More sharing options...
Engineer Durik256 Posted July 27 Author Engineer Share Posted July 27 5 hours ago, Rinorsi said: Noesis plugin (fmt_mesh_diablo.py) why did you remove (author's name) from the script? MeshToOBJ supports batch processing. i made plugin for Noesis for AceRacing fmt_mesh_AceRacing.py *(Later I’ll make a universal for everyone messiah) 1 Link to comment Share on other sites More sharing options...
Rinorsi Posted July 28 Share Posted July 28 (edited) 13 hours ago, Durik256 said: why did you remove (author's name) from the script? MeshToOBJ supports batch processing. i made plugin for Noesis for AceRacing fmt_mesh_AceRacing.py *(Later I’ll make a universal for everyone messiah) thx!!! I apologize, I use chatgpt so i dont know why it remove author's name from the script. …… I have encountered some issues that seem to be unable to execute properly, so I have modified the plugin to ensure that it can now execute properly. I fixed some bugs in fmt_mesh_AceRacing.py, and now it can correctly read .messiah model information (perhaps the data differs between the Chinese version and the global version; I have only tested models obtained from the Chinese version with .MESSIAH, which can be read correctly). Noesis-Plugins/fmt_mesh_AceRacing.py at master · Durik256/Noesis-Plugins (github.com) Fixes include: Changed the file header check in the noepyCheckType function to match the first 8 bytes (.MESSIAH) instead of bytes 1 to 8. Replaced bs.read with bs.readBytes in the noepyLoadModel function to correctly handle the reading of binary data. This ensures the read operations correctly interpret the data formats. Corrected the method name for binding UV buffers from rapi.rpgBindUVXBufferOfs to rapi.rpgBindUV1BufferOfs, which is the correct method available in the Noesis API for binding UV buffers. Edited July 28 by Rinorsi Link to comment Share on other sites More sharing options...
Engineer Durik256 Posted July 28 Author Engineer Share Posted July 28 (edited) 3 hours ago, Rinorsi said: Fixes include: I'll duplicate the answer from Github: 1)magic check is correct. (it doesn’t matter how many bytes you check, it’s just to check the validity of the file). I just skip the first dot (I don’t remember why I did this, maybe in other MESSIAH games there was another symbol instead of a dot) 2)reading bytes through bs.read() is the same as through bs.readBytes(), this can be seen in the Noesis code ``` def read(self, fmtStr): if isinstance(fmtStr, str): self.toUnpacker(); r = noeSuper(self).read(fmtStr); self.fromUnpacker(); return r else: return self.readBytes(fmtStr) #assume byte count ``` 3)rpgBindUVXBufferOfs is used to set the UVS to the desired channel. It is not necessary to use an explicit method for the desired channel. especially when there are several channels or more than 2 from Noesis documentation: ``` {"rpgBindUVXBuffer", RPGBindUVXBuffer, METH_VARARGS, "binds uvx buffer. (Oiiii)"}, //args=bytes for uv2's, dataType, stride, uv index, uv elem count By replacing rpgBindUVXBufferOfs with rpgBindUV1BufferOfs, you broke the code, since some models have several UVs channels. you always set UVs to the zero channel. that is, if there are multiple UVs you will only get the last one. ``` so I think all your changes are unnecessary the only thing that can be used is the magic check. *(send me the file that gave the error) The plugin is absolutely functional and does not need any corrections Edited July 28 by Durik256 Link to comment Share on other sites More sharing options...
Rinorsi Posted July 28 Share Posted July 28 5 minutes ago, Durik256 said: I'll duplicate the answer from Github: magic check is correct. (it doesn’t matter how many bytes you check, it’s just to check the validity of the file). I just skip the first dot (I don’t remember why I did this, maybe in other MESSIAH games there was another symbol instead of a dot) 2) reading bytes through bs.read() is the same as through bs.readBytes(), this can be seen in the Noesis code def read(self, fmtStr): if isinstance(fmtStr, str): self.toUnpacker(); r = noeSuper(self).read(fmtStr); self.fromUnpacker(); return r else: return self.readBytes(fmtStr) #assume byte count rpgBindUVXBufferOfs is used to set the UVS to the desired channel. It is not necessary to use an explicit method for the desired channel. especially when there are several channels or more than 2 from Noesis documentation: {"rpgBindUVXBuffer", RPGBindUVXBuffer, METH_VARARGS, "binds uvx buffer. (Oiiii)"}, //args=bytes for uv2's, dataType, stride, uv index, uv elem count By replacing rpgBindUVXBufferOfs with rpgBindUV1BufferOfs, you broke the code, since some models have several UVs channels. you always set UVs to the zero channel. that is, if there are multiple UVs you will only get the last one. so I think all your changes are unnecessary the only thing that can be used is the magic check. *(send me the file that gave the error) 该插件绝对功能强大,不需要任何更正 Okay, I'm not quite sure what the problem might be, maybe it's a version issue? Anyway, I sincerely thank you for your help! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now