|
You last visited: Today at 16:30
Advertisement
[Help] how to extract Rappelz character animations
Discussion on [Help] how to extract Rappelz character animations within the Rappelz Private Server forum part of the Rappelz category.
06/25/2023, 16:10
|
#1
|
elite*gold: 0
Join Date: Mar 2013
Posts: 125
Received Thanks: 15
|
[Help] how to open/edit Rappelz character animations file (.naf)
[Help] how to open/edit Rappelz character animations file (.naf)
is there any tool available?
up up
|
|
|
06/25/2023, 19:27
|
#2
|
elite*gold: 0
Join Date: Jul 2020
Posts: 190
Received Thanks: 85
|
Quote:
Originally Posted by hassuny
[Help] How to extract Rappelz character animations?
is there any tool available?
up up
|
Just extract the client and take the nafs that are defined in charactermotion?
|
|
|
06/26/2023, 17:36
|
#3
|
elite*gold: 0
Join Date: Mar 2013
Posts: 125
Received Thanks: 15
|
Sorry I meant how to edit the animation for character/monster?
|
|
|
06/26/2023, 17:53
|
#4
|
elite*gold: 0
Join Date: Feb 2020
Posts: 59
Received Thanks: 69
|
Quote:
Originally Posted by hassuny
[Help] how to open/edit Rappelz character animations file (.naf)
is there any tool available?
up up
|
There is no such a tool to open nafs directly into any form of 3d modelling / animation tools, at least not publicly.
|
|
|
06/26/2023, 22:10
|
#5
|
elite*gold: 0
Join Date: Mar 2013
Posts: 125
Received Thanks: 15
|
Quote:
Originally Posted by YamatosDeath
There is no such a tool to open nafs directly into any form of 3d modelling / animation tools, at least not publicly.
|
I got you, thanks for your response bro ^^
|
|
|
07/04/2023, 15:38
|
#6
|
elite*gold: 0
Join Date: Nov 2012
Posts: 943
Received Thanks: 257
|
Quote:
Originally Posted by hassuny
Sorry I meant how to edit the animation for character/monster?
|
Quote:
Originally Posted by YamatosDeath
There is no such a tool to open nafs directly into any form of 3d modelling / animation tools, at least not publicly.
|
Quote:
Originally Posted by hassuny
I got you, thanks for your response bro ^^
|
Actually there is.
Its a galalab tool I found In the source files. nfx something.
It can upload the models/meshes/sound effects and animation seperately and you could play the animation and change it.
You can see the mob and even edit its stances combat\resting stance.
Sadly I'm too lazy to post a picture of the tool its somewhere deep in my flashdrive, but it was funny to add 2 axes to this mob.
|
|
|
07/04/2023, 15:52
|
#7
|
elite*gold: 0
Join Date: Mar 2013
Posts: 125
Received Thanks: 15
|
Quote:
Originally Posted by thefear511
Actually there is.
Its a galalab tool I found In the source files. nfx something.
It can upload the models/meshes/sound effects and animation seperately and you could play the animation and change it.
You can see the mob and even edit its stances combat\resting stance.
Sadly I'm too lazy to post a picture of the tool its somewhere deep in my flashdrive, but it was funny to add 2 axes to this mob.
|
does it allow to export models+animations as .Fbx format?
|
|
|
07/04/2023, 21:16
|
#8
|
elite*gold: 0
Join Date: Feb 2020
Posts: 59
Received Thanks: 69
|
Quote:
Originally Posted by thefear511
Actually there is.
Its a galalab tool I found In the source files. nfx something.
It can upload the models/meshes/sound effects and animation seperately and you could play the animation and change it.
You can see the mob and even edit its stances combat\resting stance.
Sadly I'm too lazy to post a picture of the tool its somewhere deep in my flashdrive, but it was funny to add 2 axes to this mob.
|
that's just stool, completely irrelevant to what the topic is about
he wants a way to import .NAF in a 3d modelling tool// export them in another format to edit them not to just view them
|
|
|
07/04/2023, 22:30
|
#9
|
elite*gold: 0
Join Date: Mar 2013
Posts: 125
Received Thanks: 15
|
Quote:
Originally Posted by YamatosDeath
that's just stool, completely irrelevant to what the topic is about
he wants a way to import .NAF in a 3d modelling tool// export them in another format to edit them not to just view them
|
exactly
|
|
|
07/05/2023, 13:59
|
#10
|
elite*gold: 0
Join Date: Nov 2012
Posts: 943
Received Thanks: 257
|
Quote:
Originally Posted by YamatosDeath
that's just stool, completely irrelevant to what the topic is about
he wants a way to import .NAF in a 3d modelling tool// export them in another format to edit them not to just view them
|
yes thats the name stool, nice tool. maybe i understood his request wrong.
|
|
|
07/05/2023, 15:34
|
#11
|
elite*gold: 0
Join Date: Apr 2017
Posts: 200
Received Thanks: 113
|
Quote:
Originally Posted by thefear511
yes thats the name stool, nice tool. maybe i understood his request wrong.
|
ofc you do.
btw, where server?
|
|
|
07/05/2023, 15:47
|
#12
|
elite*gold: 0
Join Date: Oct 2013
Posts: 128
Received Thanks: 108
|
If you want to edit the NAF file, you need to write an importer yourself.
You can do it by reading the NAF structure with BinaryReader.
You can take this code as an example and write it for blender with python.
Example C# NAF BinaryReader code
Code:
NAF E = new NAF();
E.BTRF = StringReader(myFile, 4);
E.header_size = myFile.ReadInt32();
E.major_version = myFile.ReadInt16();
E.minor_version = myFile.ReadInt16();
E.header_pos = myFile.ReadInt32();
int header_naf_pos = 0;
E.header_naf_pos = E.header_size + 8;
header_naf_pos = E.header_size + 8;
stream.Seek(header_naf_pos, SeekOrigin.Begin);
GUID guid = new GUID();
guid.guid_size = myFile.ReadInt32();
int guid_size = guid.guid_size / 18;
List<GUID> guid_list = new List<GUID>();
for (int i = 0; i < guid_size; i++)
{
byte[] b;
b = myFile.ReadBytes(16);
Guid guid2 = new Guid(b);
guid_list.Add(new GUID { GUIID = guid2 });
}
header_naf_pos = header_naf_pos + guid.guid_size + 4;
stream.Seek(header_naf_pos, SeekOrigin.Begin);
int ls = myFile.ReadInt32();
int string_count = myFile.ReadInt32();
List<STRINGS> string_list = new List<STRINGS>();
for (int i = 0; i < string_count; i++)
{
string bone_name;
bone_name = ReadFixedString(myFile);
string_list.Add(new STRINGS { bone_names = bone_name });
}
header_naf_pos = header_naf_pos + ls + 4;
stream.Seek(header_naf_pos, SeekOrigin.Begin);
int next_header_pos = myFile.ReadInt32();
int block_num = myFile.ReadInt32();
for (int i = 0; i < block_num; i++)
{
myFile.ReadBytes(3); // Unkown
byte type = myFile.ReadByte();
int block_size = myFile.ReadInt32();
short temp_index = myFile.ReadInt16();
string guid_table_index = guid_list[i].GUIID.ToString();
if (guid_table_index == "81bce021-ad76-346f-9c7d-19885fd118b6")
{
nx3_version_header ver = new nx3_version_header();
ver.version = myFile.ReadInt32();
}
else if (guid_table_index == "e8f9296b-b9dd-4080-8bc7-6c69e0aa3feb")
{
nx3_bone_ani_header bone_ani_header = new nx3_bone_ani_header();
bone_ani_header.bone_count = myFile.ReadInt32();
bone_ani_header.channel_count = myFile.ReadInt32();
bone_ani_header.nx3_bone_ani_channel_index = myFile.ReadInt16();
string nx3_bone_ani_channel = guid_list[bone_ani_header.nx3_bone_ani_channel_index - 1].GUIID.ToString();
if (nx3_bone_ani_channel == "81b3c137-b2b8-40b0-a3ad-d149467f5932")
{
nx3_bone_ani_channel bone_ani_channel = new nx3_bone_ani_channel();
bone_ani_channel.channel_name = myFile.ReadInt32();
bone_ani_channel.channel_flag = myFile.ReadInt32();
bone_ani_channel.channel_time_span = myFile.ReadInt32();
bone_ani_channel.channel_frame_rate = myFile.ReadInt32();
bone_ani_channel.bone_ani_size = myFile.ReadInt32();
myFile.ReadInt32(); // Unkown
myFile.ReadInt32(); // Unkwon
bone_ani_channel.nx3_bone_ani_index = myFile.ReadInt16();
string nx3_bone_anis = guid_list[bone_ani_channel.nx3_bone_ani_index - 1].GUIID.ToString();
if (nx3_bone_anis == "b84344de-a1b6-4aa7-afd6-22ca8a4b0cee")
{
nx3_bone_ani bone_ani = new nx3_bone_ani();
bone_ani.bone_count = myFile.ReadInt32();
for (int d = 0; d < bone_ani.bone_count; d++)
{
myFile.ReadInt32(); // Unkown
bone_ani.bone_szname = myFile.ReadInt32();
bone_ani.parent_id = myFile.ReadInt32();
myFile.ReadBytes(64); // bn_tm
bone_ani.flag = myFile.ReadInt32();
bone_ani.pos_time_size = myFile.ReadInt32();
int pos_time_size = bone_ani.pos_time_size / 4;
myFile.ReadByte(); // Unkown
for (int c = 0; c < pos_time_size; c++)
{
bone_ani.pos_time = myFile.ReadInt32();
}
bone_ani.pos_key_size = myFile.ReadInt32();
int pos_key_size = bone_ani.pos_key_size / 12;
myFile.ReadByte(); // Unkown
for (int l = 0; l < pos_key_size; l++) // Point3
{
float x = myFile.ReadSingle();
float y = myFile.ReadSingle();
float z = myFile.ReadSingle();
}
bone_ani.rot_time_size = myFile.ReadInt32();
myFile.ReadByte(); // Unkown
int rot_time_size = bone_ani.rot_time_size / 4;
for (int o = 0; o < rot_time_size; o++)
{
bone_ani.rot_time = myFile.ReadInt32();
}
bone_ani.rot_key_size = myFile.ReadInt32();
myFile.ReadByte(); // Unkown
int rot_key_size = bone_ani.rot_key_size / 16;
for (int ae = 0; ae < rot_key_size; ae++) // Quad
{
float x = myFile.ReadSingle();
float y = myFile.ReadSingle();
float z = myFile.ReadSingle();
float w = myFile.ReadSingle();
}
bone_ani.child_size = myFile.ReadInt32();
myFile.ReadByte(); // Unkown
int child_size = bone_ani.child_size / 4;
for (int op = 0; op < child_size; op++)
{
bone_ani.child_index = myFile.ReadInt32();
}
}
}
}
}
}
|
|
|
07/06/2023, 01:47
|
#13
|
elite*gold: 0
Join Date: Apr 2017
Posts: 200
Received Thanks: 113
|
Quote:
Originally Posted by Anothers
If you want to edit the NAF file, you need to write an importer yourself.
You can do it by reading the NAF structure with BinaryReader.
You can take this code as an example and write it for blender with python.
Example C# NAF BinaryReader code
Code:
NAF E = new NAF();
E.BTRF = StringReader(myFile, 4);
E.header_size = myFile.ReadInt32();
E.major_version = myFile.ReadInt16();
E.minor_version = myFile.ReadInt16();
E.header_pos = myFile.ReadInt32();
int header_naf_pos = 0;
E.header_naf_pos = E.header_size + 8;
header_naf_pos = E.header_size + 8;
stream.Seek(header_naf_pos, SeekOrigin.Begin);
GUID guid = new GUID();
guid.guid_size = myFile.ReadInt32();
int guid_size = guid.guid_size / 18;
List<GUID> guid_list = new List<GUID>();
for (int i = 0; i < guid_size; i++)
{
byte[] b;
b = myFile.ReadBytes(16);
Guid guid2 = new Guid(b);
guid_list.Add(new GUID { GUIID = guid2 });
}
header_naf_pos = header_naf_pos + guid.guid_size + 4;
stream.Seek(header_naf_pos, SeekOrigin.Begin);
int ls = myFile.ReadInt32();
int string_count = myFile.ReadInt32();
List<STRINGS> string_list = new List<STRINGS>();
for (int i = 0; i < string_count; i++)
{
string bone_name;
bone_name = ReadFixedString(myFile);
string_list.Add(new STRINGS { bone_names = bone_name });
}
header_naf_pos = header_naf_pos + ls + 4;
stream.Seek(header_naf_pos, SeekOrigin.Begin);
int next_header_pos = myFile.ReadInt32();
int block_num = myFile.ReadInt32();
for (int i = 0; i < block_num; i++)
{
myFile.ReadBytes(3); // Unkown
byte type = myFile.ReadByte();
int block_size = myFile.ReadInt32();
short temp_index = myFile.ReadInt16();
string guid_table_index = guid_list[i].GUIID.ToString();
if (guid_table_index == "81bce021-ad76-346f-9c7d-19885fd118b6")
{
nx3_version_header ver = new nx3_version_header();
ver.version = myFile.ReadInt32();
}
else if (guid_table_index == "e8f9296b-b9dd-4080-8bc7-6c69e0aa3feb")
{
nx3_bone_ani_header bone_ani_header = new nx3_bone_ani_header();
bone_ani_header.bone_count = myFile.ReadInt32();
bone_ani_header.channel_count = myFile.ReadInt32();
bone_ani_header.nx3_bone_ani_channel_index = myFile.ReadInt16();
string nx3_bone_ani_channel = guid_list[bone_ani_header.nx3_bone_ani_channel_index - 1].GUIID.ToString();
if (nx3_bone_ani_channel == "81b3c137-b2b8-40b0-a3ad-d149467f5932")
{
nx3_bone_ani_channel bone_ani_channel = new nx3_bone_ani_channel();
bone_ani_channel.channel_name = myFile.ReadInt32();
bone_ani_channel.channel_flag = myFile.ReadInt32();
bone_ani_channel.channel_time_span = myFile.ReadInt32();
bone_ani_channel.channel_frame_rate = myFile.ReadInt32();
bone_ani_channel.bone_ani_size = myFile.ReadInt32();
myFile.ReadInt32(); // Unkown
myFile.ReadInt32(); // Unkwon
bone_ani_channel.nx3_bone_ani_index = myFile.ReadInt16();
string nx3_bone_anis = guid_list[bone_ani_channel.nx3_bone_ani_index - 1].GUIID.ToString();
if (nx3_bone_anis == "b84344de-a1b6-4aa7-afd6-22ca8a4b0cee")
{
nx3_bone_ani bone_ani = new nx3_bone_ani();
bone_ani.bone_count = myFile.ReadInt32();
for (int d = 0; d < bone_ani.bone_count; d++)
{
myFile.ReadInt32(); // Unkown
bone_ani.bone_szname = myFile.ReadInt32();
bone_ani.parent_id = myFile.ReadInt32();
myFile.ReadBytes(64); // bn_tm
bone_ani.flag = myFile.ReadInt32();
bone_ani.pos_time_size = myFile.ReadInt32();
int pos_time_size = bone_ani.pos_time_size / 4;
myFile.ReadByte(); // Unkown
for (int c = 0; c < pos_time_size; c++)
{
bone_ani.pos_time = myFile.ReadInt32();
}
bone_ani.pos_key_size = myFile.ReadInt32();
int pos_key_size = bone_ani.pos_key_size / 12;
myFile.ReadByte(); // Unkown
for (int l = 0; l < pos_key_size; l++) // Point3
{
float x = myFile.ReadSingle();
float y = myFile.ReadSingle();
float z = myFile.ReadSingle();
}
bone_ani.rot_time_size = myFile.ReadInt32();
myFile.ReadByte(); // Unkown
int rot_time_size = bone_ani.rot_time_size / 4;
for (int o = 0; o < rot_time_size; o++)
{
bone_ani.rot_time = myFile.ReadInt32();
}
bone_ani.rot_key_size = myFile.ReadInt32();
myFile.ReadByte(); // Unkown
int rot_key_size = bone_ani.rot_key_size / 16;
for (int ae = 0; ae < rot_key_size; ae++) // Quad
{
float x = myFile.ReadSingle();
float y = myFile.ReadSingle();
float z = myFile.ReadSingle();
float w = myFile.ReadSingle();
}
bone_ani.child_size = myFile.ReadInt32();
myFile.ReadByte(); // Unkown
int child_size = bone_ani.child_size / 4;
for (int op = 0; op < child_size; op++)
{
bone_ani.child_index = myFile.ReadInt32();
}
}
}
}
}
}
|
Thanks for hint Zone, can you maybe explain a bit more ?  would be helpful
|
|
|
07/06/2023, 21:08
|
#14
|
elite*gold: 0
Join Date: Mar 2013
Posts: 125
Received Thanks: 15
|
Quote:
Originally Posted by Anothers
If you want to edit the NAF file, you need to write an importer yourself.
You can do it by reading the NAF structure with BinaryReader.
You can take this code as an example and write it for blender with python.
Example C# NAF BinaryReader code
Code:
NAF E = new NAF();
E.BTRF = StringReader(myFile, 4);
E.header_size = myFile.ReadInt32();
E.major_version = myFile.ReadInt16();
E.minor_version = myFile.ReadInt16();
E.header_pos = myFile.ReadInt32();
int header_naf_pos = 0;
E.header_naf_pos = E.header_size + 8;
header_naf_pos = E.header_size + 8;
stream.Seek(header_naf_pos, SeekOrigin.Begin);
GUID guid = new GUID();
guid.guid_size = myFile.ReadInt32();
int guid_size = guid.guid_size / 18;
List<GUID> guid_list = new List<GUID>();
for (int i = 0; i < guid_size; i++)
{
byte[] b;
b = myFile.ReadBytes(16);
Guid guid2 = new Guid(b);
guid_list.Add(new GUID { GUIID = guid2 });
}
header_naf_pos = header_naf_pos + guid.guid_size + 4;
stream.Seek(header_naf_pos, SeekOrigin.Begin);
int ls = myFile.ReadInt32();
int string_count = myFile.ReadInt32();
List<STRINGS> string_list = new List<STRINGS>();
for (int i = 0; i < string_count; i++)
{
string bone_name;
bone_name = ReadFixedString(myFile);
string_list.Add(new STRINGS { bone_names = bone_name });
}
header_naf_pos = header_naf_pos + ls + 4;
stream.Seek(header_naf_pos, SeekOrigin.Begin);
int next_header_pos = myFile.ReadInt32();
int block_num = myFile.ReadInt32();
for (int i = 0; i < block_num; i++)
{
myFile.ReadBytes(3); // Unkown
byte type = myFile.ReadByte();
int block_size = myFile.ReadInt32();
short temp_index = myFile.ReadInt16();
string guid_table_index = guid_list[i].GUIID.ToString();
if (guid_table_index == "81bce021-ad76-346f-9c7d-19885fd118b6")
{
nx3_version_header ver = new nx3_version_header();
ver.version = myFile.ReadInt32();
}
else if (guid_table_index == "e8f9296b-b9dd-4080-8bc7-6c69e0aa3feb")
{
nx3_bone_ani_header bone_ani_header = new nx3_bone_ani_header();
bone_ani_header.bone_count = myFile.ReadInt32();
bone_ani_header.channel_count = myFile.ReadInt32();
bone_ani_header.nx3_bone_ani_channel_index = myFile.ReadInt16();
string nx3_bone_ani_channel = guid_list[bone_ani_header.nx3_bone_ani_channel_index - 1].GUIID.ToString();
if (nx3_bone_ani_channel == "81b3c137-b2b8-40b0-a3ad-d149467f5932")
{
nx3_bone_ani_channel bone_ani_channel = new nx3_bone_ani_channel();
bone_ani_channel.channel_name = myFile.ReadInt32();
bone_ani_channel.channel_flag = myFile.ReadInt32();
bone_ani_channel.channel_time_span = myFile.ReadInt32();
bone_ani_channel.channel_frame_rate = myFile.ReadInt32();
bone_ani_channel.bone_ani_size = myFile.ReadInt32();
myFile.ReadInt32(); // Unkown
myFile.ReadInt32(); // Unkwon
bone_ani_channel.nx3_bone_ani_index = myFile.ReadInt16();
string nx3_bone_anis = guid_list[bone_ani_channel.nx3_bone_ani_index - 1].GUIID.ToString();
if (nx3_bone_anis == "b84344de-a1b6-4aa7-afd6-22ca8a4b0cee")
{
nx3_bone_ani bone_ani = new nx3_bone_ani();
bone_ani.bone_count = myFile.ReadInt32();
for (int d = 0; d < bone_ani.bone_count; d++)
{
myFile.ReadInt32(); // Unkown
bone_ani.bone_szname = myFile.ReadInt32();
bone_ani.parent_id = myFile.ReadInt32();
myFile.ReadBytes(64); // bn_tm
bone_ani.flag = myFile.ReadInt32();
bone_ani.pos_time_size = myFile.ReadInt32();
int pos_time_size = bone_ani.pos_time_size / 4;
myFile.ReadByte(); // Unkown
for (int c = 0; c < pos_time_size; c++)
{
bone_ani.pos_time = myFile.ReadInt32();
}
bone_ani.pos_key_size = myFile.ReadInt32();
int pos_key_size = bone_ani.pos_key_size / 12;
myFile.ReadByte(); // Unkown
for (int l = 0; l < pos_key_size; l++) // Point3
{
float x = myFile.ReadSingle();
float y = myFile.ReadSingle();
float z = myFile.ReadSingle();
}
bone_ani.rot_time_size = myFile.ReadInt32();
myFile.ReadByte(); // Unkown
int rot_time_size = bone_ani.rot_time_size / 4;
for (int o = 0; o < rot_time_size; o++)
{
bone_ani.rot_time = myFile.ReadInt32();
}
bone_ani.rot_key_size = myFile.ReadInt32();
myFile.ReadByte(); // Unkown
int rot_key_size = bone_ani.rot_key_size / 16;
for (int ae = 0; ae < rot_key_size; ae++) // Quad
{
float x = myFile.ReadSingle();
float y = myFile.ReadSingle();
float z = myFile.ReadSingle();
float w = myFile.ReadSingle();
}
bone_ani.child_size = myFile.ReadInt32();
myFile.ReadByte(); // Unkown
int child_size = bone_ani.child_size / 4;
for (int op = 0; op < child_size; op++)
{
bone_ani.child_index = myFile.ReadInt32();
}
}
}
}
}
}
|
thanks a lot, this is what I was looking for. would you mind explain it further. this will be so useful
|
|
|
07/07/2023, 01:13
|
#15
|
elite*gold: 0
Join Date: Oct 2013
Posts: 128
Received Thanks: 108
|
Quote:
Originally Posted by yosiemelo
Thanks for hint Zone, can you maybe explain a bit more ?  would be helpful
|
Quote:
Originally Posted by hassuny
thanks a lot, this is what I was looking for. would you mind explain it further. this will be so useful 
|
I don't know how to explain, but I did a proper research and wrote the python NAF Reader without knowing python.
If anyone knows how to script or animate in Blender can use this code.
Like I said, this is reader only.
You will add their functionality.
What exactly do you want to know about this NAF?
NAF Reader With Python(It was made without knowing Python. Sorry if your eyes bleed.)
Code:
#Python 3.10
#Written by ZONE
file_path = "C:\\asm_cbt_attack01_c_biped.naf"
file = open(file_path, "rb") # "rb" modu ile binary dosyayı açın
BTRF = file.read(4)
print(BTRF)
header_size = file.read(4)
print(int.from_bytes(header_size, "little"), "Header Size")
major_version = file.read(2)
print(int.from_bytes(major_version, "little"), "MJ Ver")
minor_version = file.read(2)
print(int.from_bytes(minor_version, "little"), "MN Ver")
header_pos = file.read(4)
print(int.from_bytes(header_pos, "little"), "HEADER POS")
headers = int.from_bytes(header_size, "little")
header_naf_pos = headers + 8
print(header_naf_pos, "Header")
file.seek(header_naf_pos)
guid_size = file.read(4)
file.tell()
iGuidSize = int.from_bytes(guid_size, "little")
nwGuidSize = iGuidSize / 18
print(nwGuidSize)
GuidSizeList = readGuid(file, int(nwGuidSize))
print(GuidSizeList)
header_naf_pos = header_naf_pos + int(iGuidSize) + 4
file.seek(header_naf_pos)
ls = file.read(4)
pw = int.from_bytes(ls,"little")
string_count = int.from_bytes(file.read(4), "little")
print(string_count, "String Count")
stringCountArr = []
for l in range(string_count):
strings = ReadFixedString(file)
stringCountArr.append(strings)
print(stringCountArr)
header_naf_pos = header_naf_pos + int(pw) + 4
file.seek(header_naf_pos)
next_header_pos = file.read(4)
block_num = file.read(4)
blocks_num = int.from_bytes(block_num,"little")
for w in range(blocks_num):
us = file.read(3)
types = file.read(1)
block_size = file.read(4)
temp_index = file.read(2)
guidtableIndex = GuidSizeList[w]
if guidtableIndex == uuid.UUID('21e0bc81-76ad-6f34-9c7d-19885fd118b6'):
version = file.read(4)
ver = int.from_bytes(version,"little")
print(ver,"Version")
if guidtableIndex == uuid.UUID('6b29f9e8-ddb9-8040-8bc7-6c69e0aa3feb'):
bone_count = file.read(4)
bCount = int.from_bytes(bone_count,"little")
channel_count = file.read(4)
nx3_bone_ani_channel_index = file.read(2)
bone_ani_channel_index = int.from_bytes(nx3_bone_ani_channel_index,"little")
boneGUID = GuidSizeList[bone_ani_channel_index - 1]
if boneGUID == uuid.UUID('37c1b381-b8b2-b040-a3ad-d149467f5932'):
channel_name = file.read(4)
channel_flag = file.read(4)
channel_time_span = file.read(4)
channel_frame_rate = file.read(4)
bone_ani_size = file.read(4)
file.read(4)
file.read(4)
nx3_bone_ani_index = file.read(2)
bone_ani_index = int.from_bytes(nx3_bone_ani_index,"little")
BoneAniIndex = GuidSizeList[bone_ani_index - 1]
if BoneAniIndex == uuid.UUID('de4443b8-b6a1-a74a-afd6-22ca8a4b0cee'):
bone_count = file.read(4)
bCount = int.from_bytes(bone_count,"little")
print(bCount,"Bone Count")
boneArray = []
for b in range(bCount):
file.read(4)
boneSzName = file.read(4)
boneNm = int.from_bytes(boneSzName,"little")
BoneName = stringCountArr[b]
parent_id = file.read(4)
file.read(64) #BONE TM
flag = file.read(4)
pos_time_size = file.read(4)
iPsTimeSize = int.from_bytes(pos_time_size,"little")
PosTimeSize = iPsTimeSize / 4
file.read(1)
for p in range(int(PosTimeSize)):
pos_time = file.read(4)
pos_key_size = file.read(4)
iPsKeySize = int.from_bytes(pos_key_size,"little")
PosKeySize = iPsKeySize / 12
file.read(1)
for ky in range(int(PosKeySize)):
x = file.read(4)
y = file.read(4)
z = file.read(4)
xFloat = struct.unpack('f',x)
yFloat = struct.unpack('f',y)
zFloat = struct.unpack('f',z)
rot_time_size = file.read(4)
iRotTimeSize = int.from_bytes(rot_time_size,"little")
RotTimeSize = iRotTimeSize / 4
file.read(1)
for rt in range(int(RotTimeSize)):
rot_time = file.read(4)
rot_key_size = file.read(4)
iRotKeySize = int.from_bytes(rot_key_size,"little")
RotKeySize = iRotKeySize / 16
file.read(1)
for rk in range(int(RotKeySize)):
x = file.read(4)
y = file.read(4)
z = file.read(4)
w = file.read(4)
xFloat = struct.unpack('f',x)
yFloat = struct.unpack('f',y)
zFloat = struct.unpack('f',z)
wFloat = struct.unpack('f',w)
child_size = file.read(4)
iChildSize = int.from_bytes(child_size,"little")
ChildSize = iChildSize / 4
file.read(1)
for cl in range(int(ChildSize)):
child_index = file.read(4)
|
|
|
Similar Threads
|
[GUIDE/ANIMATIONS] Creating run/walk animations which work properly
09/25/2012 - Metin2 PServer Guides & Strategies - 2 Replies
Good afternoon elitepvpers,
in this brief guide I will explain how to create any animation that implies a movement of the model in the world space. Many have been wondering why new run or walk animations wouldn't work properly, and today I will explain the reason. I'm sorry but I did not include any screenshot, for lack of both willingness and time.
An animations works by moving various bones, and I think this part is clear to everyone. The thing is, the Granny3D engine cannot know if the...
|
All times are GMT +1. The time now is 16:33.
|
|