Page 1 of 3

[Request] James Cameron Avatar the game models

Posted: Thu Apr 08, 2010 3:15 am
by bas
The contents of this post was deleted because of possible forum rules violation.

Re: [Request] James Cameron Avatar the game models

Posted: Wed Apr 28, 2010 8:20 pm
by FurryFan
The vertexes are stored as signed16byte integers, There is also a face index when I tried to view it after using some microsoft excel formulas the vertexes appearead fine, but when I added a face list the faces do not align properly. Here is a picture, I will do more work on this later this week.

Image

Re: [Request] James Cameron Avatar the game models

Posted: Sat May 15, 2010 10:50 pm
by bas
great thanks;

almost gave up on this

dunno if you still plan to continue on this;
but I would appreciate it very much if you could share with me what you have found so I can continue working with it

Edit: got 2 coords of the vertices (side view of the model is correctly) but the 3rd is still a mess

Re: [Request] James Cameron Avatar the game models

Posted: Tue May 18, 2010 5:42 pm
by Szkaradek123
It is a part of python script in blender.

for i in range(numverts):
xyz = struct.unpack(3*'h',plik.read(6))
v1 = xyz[0]*2**-12
v2 = xyz[1]*2**-12
v3 = xyz[2]*2**-12
vertexy.append([v1,-v2,v3])
uv = struct.unpack(3*'H',plik.read(6))
u = uv[1]*2**-10 #???
v = uv[2]*2**-10 #???
uvcoord.append([u,v])
plik.read(28)

numfaces = struct.unpack('i',plik.read(4))[0]
print struct.unpack('i',plik.read(4))

for i in range(numfaces/3):
f= struct.unpack('HHH',plik.read(3*2))
faceslist.append([f[0],f[1],f[2]])

Re: [Request] James Cameron Avatar the game models

Posted: Tue May 18, 2010 6:38 pm
by FurryFan
Szkaradek123 wrote:It is a part of python script in blender.

for i in range(numverts):
xyz = struct.unpack(3*'h',plik.read(6))
v1 = xyz[0]*2**-12
v2 = xyz[1]*2**-12
v3 = xyz[2]*2**-12
vertexy.append([v1,-v2,v3])
uv = struct.unpack(3*'H',plik.read(6))
u = uv[1]*2**-10 #???
v = uv[2]*2**-10 #???
uvcoord.append([u,v])
plik.read(28)

numfaces = struct.unpack('i',plik.read(4))[0]
print struct.unpack('i',plik.read(4))

for i in range(numfaces/3):
f= struct.unpack('HHH',plik.read(3*2))
faceslist.append([f[0],f[1],f[2]])
Thats great can you tell me how to use this script in blender , if for example I have 3 files, one with the 32bitVertexes, one with the UV, and one with the Face index. Where would I insert the number of vertexes into the script?

Re: [Request] James Cameron Avatar the game models

Posted: Wed May 19, 2010 10:25 pm
by elypter
i would also like to know how to do this

Re: [Request] James Cameron Avatar the game models

Posted: Thu May 20, 2010 6:20 pm
by Szkaradek123
The contents of this post was deleted because of possible forum rules violation.

Re: [Request] James Cameron Avatar the game models

Posted: Fri May 21, 2010 4:07 pm
by elypter
thats cool.
i hope you can modify this script to import other models as well.
if not generally possible could you please post instructions on how to modify the script for other models

Re: [Request] James Cameron Avatar the game models

Posted: Sun May 23, 2010 1:59 pm
by Szkaradek123
The contents of this post was deleted because of possible forum rules violation.


Update 2014-06-30:

http://www.mediafire.com/download/18g3f ... BPC%5D.zip

Re: [Request] James Cameron Avatar the game models

Posted: Sun May 23, 2010 8:02 pm
by elypter
many thanks.
thats awsome !

but i still have a little problem:
i don't get any textures.

in the console some xbm and xbt files are listed, so it seems to find the files.

Code: Select all

=============================================================
corp_samson_01_closeddoor.xbg
=============================================================
HSEM
(42, 6, 4571, 59310, 0, 0, 0, 0, 55178, 14, 0, 0, 10, 0)
LTMR
CORP_SAMSON_EXTERIOR
graphics\av_vehicles_corp\samson_01\_textures\corp_vehicle_samson_exterior.xbt
graphics\av_vehicles_corp\samson_01\_textures\corp_vehicle_samson_exterior_s.xbt

graphics\av_vehicles_corp\samson_01\_textures\corp_vehicle_samson_exterior_n.xbt

CORP_SAMSON_ALPHA_HELLSGATE
graphics\av_vehicles_corp\samson_01\_textures\corp_vehicle_samson_alpha.xbt
graphics\av_vehicles_corp\samson_01\_textures\corp_vehicle_samson_alpha_s.xbt
graphics\av_environment\_rainforest\cubemap\rf_cm_blur_01.xbt
SAMSON_INTERIOR_PROPS
graphics\av_vehicles_corp\samson_01\_textures\corp_vehicle_samson_interior_d.xbt

graphics\av_vehicles_corp\samson_01\_textures\corp_vehicle_samson_id1_s.xbt
EDON
numbones =  1
DIKS
DNKS
SULC
SDOL
(1, 0, 53106, 14, 53086, 14, 0, 0, 4, 0, 0, 16928, 1, 0, 3018, 0, 32, 0, 13060,
0)
(0, 3)
numvertices 13060
(0, 0, 0, 0, 11656, 0, 0)
(0, 0, 1, 24168, 12169, 373024, 0)
(0, 0, 2, 25860, 13059, 389440, 0)
(128, 96, 6, 0)
3
(3, 2, 1)
2064
419984
numfaces 9408
11
(11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1)
476448
  ûB
maybe i just don't know how to handle blender correctly. i'm an absolute noob.

heres a screenshot:

Re: [Request] James Cameron Avatar the game models

Posted: Sun May 23, 2010 9:10 pm
by Szkaradek123
Thanks for reply.
Blender import materials and textures but they are not joint with objects,
because i have problem with UV coord for meshes.
To see textures:
1. in 3d view select object
2. in buttons window select material button and click on existing materials.

Re: [Request] James Cameron Avatar the game models

Posted: Sun May 23, 2010 11:47 pm
by elypter
thanks again! now it works.

if i see it correctly, the converted mesh originaly consisted out of several different meshes and also out of different textures (3 in the case of corp_samson_01_closeddoor.xbg). could it be, that the textures should only be applied to the individual meshes? i hope this is a solvable problem.

In the case, that this is not scriptable but still only a problem of texturescaling, is there a practical way to correct this by hand? I tried to tweak "sizeX" and "sizeY" by hand 0.10 each every step but havn't found anything good looking between 0.00 and 5.00
Is there a script that can run through this, where you can press stop if you think it looks correct? other question: is the ration between scaleX and scaleY 1:1 at all?

i made a screenshot with activated "shadeless" option to see the texture better.

Re: [Request] James Cameron Avatar the game models

Posted: Mon May 24, 2010 12:19 am
by FurryFan
I see someone has beat me to it. :) The problem with the way I was doing it, was that my Excel formulas used were off by an offset.
Image

Re: [Request] James Cameron Avatar the game models

Posted: Mon May 24, 2010 1:47 am
by bas
cool thanks;

was very close to solve it myself, but easier if someone else does it

Re: [Request] James Cameron Avatar the game models

Posted: Wed May 26, 2010 8:04 pm
by elypter
i hope someone is working on the uv coordinate problem.
it would be so cool to have correct textures.
thanks again for all the work and research.