Costume Quest 2 (.mesh)

Skeletons, animations, shaders, texturing, converting, fixing and anything else related to read game models
Doctor Loboto
Posts: 376
Joined: Sun May 31, 2015 2:23 am

Costume Quest 2 (.mesh)

Post by Doctor Loboto »

I'm pretty much out of ideas with this project so far, so now I need a little help. So far they seems fairly organized. I just need a way to get them out with proper shape and UV's. The textures are simple DDS files. Even a proper OBJ would be fine with me.

https://www.dropbox.com/s/pq0w2d1qja1280e/CQ2-files.zip?dl=0
finale00z
Posts: 6
Joined: Thu Aug 13, 2015 8:19 pm

Re: Costume Quest 2 (.mesh)

Post by finale00z »

The header files hold metadata, while the actual data is stored in the corresponding names.

eg: .mesh.header will define materials, vertex counts, and index counts, among other things, while .mesh holds vertex and indices.
Doctor Loboto
Posts: 376
Joined: Sun May 31, 2015 2:23 am

Re: Costume Quest 2 (.mesh)

Post by Doctor Loboto »

Any way we can stick them together to be converted into something like an OBJ or something? I've been trying this for a while with no results.
Szkaradek123
Posts: 124
Joined: Sat Aug 29, 2015 1:13 pm

Re: Costume Quest 2 (.mesh)

Post by Szkaradek123 »

Hi

To get correct meshes and shapes you must use:

- short floats for vertex position
- 48 bytes for vertex stride
- half floats for vertex uv
- send all meshes to bounding box for correct shapes

Here is a python script for Blender old version 249 for import skinned and rigged (if *.rig.header file exists) models.
How use:
-install Blender 249 and Python 2.6.6.
-click on Blender249.blend
-in Blender Text Window press alt+p
-select files with *.mesh.header extension
Doctor Loboto
Posts: 376
Joined: Sun May 31, 2015 2:23 am

Re: Costume Quest 2 (.mesh)

Post by Doctor Loboto »

That is AWESOME. Thank you SO MUCH. I wish I could get this sort of solution for my Magicka Wizard Wars project. Thank you very very much, this really helps!
CriticalError
Posts: 204
Joined: Thu Aug 14, 2014 8:52 pm

Re: Costume Quest 2 (.mesh)

Post by CriticalError »

ummm very interesting, you can provide the unpacker of this game?
Doctor Loboto
Posts: 376
Joined: Sun May 31, 2015 2:23 am

Re: Costume Quest 2 (.mesh)

Post by Doctor Loboto »

Certainly, here is what I used to get all data from it's files.

https://www.dropbox.com/s/y8p9h5aq0ursiwg/doublefinetool2.zip?dl=0
CriticalError
Posts: 204
Joined: Thu Aug 14, 2014 8:52 pm

Re: Costume Quest 2 (.mesh)

Post by CriticalError »

thanks for that bro, grateful for share.
TGE
Posts: 38
Joined: Sat Dec 20, 2014 5:14 pm

Re: Costume Quest 2 (.mesh)

Post by TGE »

I'm interested to know how you scaled the model to its stored bounding box
Szkaradek123
Posts: 124
Joined: Sat Aug 29, 2015 1:13 pm

Re: Costume Quest 2 (.mesh)

Post by Szkaradek123 »

Code: Select all

def setBox(box,meshList):
   E=[[],[],[]]
   for mesh in meshList:
      for n in range(len(mesh.vertPosList)):
         x,y,z=mesh.vertPosList[n]
         E[0].append(x)
         E[1].append(y)
         E[2].append(z)   
   skX=(box[3]-box[0])/(max(E[0])-min(E[0]))
   skY=(box[4]-box[1])/(max(E[1])-min(E[1]))
   skZ=(box[5]-box[2])/(max(E[2])-min(E[2]))
   sk=min(skX,skY,skZ)
   trX=(box[3]+box[0])/2
   trY=(box[4]+box[1])/2
   trZ=(box[5]+box[2])/2
   
   
   for mesh in meshList:
      for n in range(len(mesh.vertPosList)):
         x,y,z=mesh.vertPosList[n]
         mesh.vertPosList[n]=[trX+x*skX,trY+y*skY,trZ+z*skZ]
      #mesh.draw()   
Doctor Loboto
Posts: 376
Joined: Sun May 31, 2015 2:23 am

Re: Costume Quest 2 (.mesh)

Post by Doctor Loboto »

Hey uh, I seem to recall this at one point working with Costume Quest 1 as well, however now, even with the same setup directed for use, Costume Quest 1 models fail with an error similar to:
"Traceback (most recent call last):
File "starter.py", line 168, in Parser
headerParser(filename,g)
File "starter.py", line 107, in headerParser
g.f(10)
File "C:\Users\User\Downloads\Blender249[CustomQuest2][mesh.header][2015-08-29]\newGameLib\myLibraries\binaresLib.py", line 212, in f
data=struct.unpack(self.endian+n*'f',self.inputFile.read(n*4))
File "C:\Python25\Lib\struct.py", line 87, in unpack
return o.unpack(s)
struct.error: unpack requires a string argument of length 40"

Tested it with python 2.5.2 and blender2.4.9, as well as python 2.6.6 and blender 2.4.9b.

Here's a sample file.

https://www.dropbox.com/s/luuegkrxrhhrp ... a.zip?dl=0