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.)
thanks, what version of blender supports python 3.10?
and what do you mean by "adding functionality?"
This is simply to import the data into blender, You can use this to set the keyframes yourself, What I recommend doing instead as this is probably too hard if you don't know how to program hit up someone called AOR and see if he's willing to sell some animations as I'm pretty sure he's got it figured out
This is simply to import the data into blender, You can use this to set the keyframes yourself, What I recommend doing instead as this is probably too hard if you don't know how to program hit up someone called AOR and see if he's willing to sell some animations as I'm pretty sure he's got it figured out
thanks for replying, I know how to program but I don't know how to script with Blender. My aim is to extract models and animations and use them in unity3d.
what do you mean by "You can use this to set the keyframes yourself"?
Do you mean creating new animations? if that is so I'm not interested in creating new animations.
thanks for replying, I know how to program but I don't know how to script with Blender. My aim is to extract models and animations and use them in unity3d.
what do you mean by "You can use this to set the keyframes yourself"?
Do you mean creating new animations? if that is so I'm not interested in creating new animations.
Keyframes are points in the timeline which indicate a rotation or location changing at a certain time point
Now I tried the script with Blender 2.78, and it did not work. do you know which version of Blender this Naf script (by Zone) works with?
I have the official animations on unity and what I can tell you is that the first thing to do will be to convert the naf DIFK to naf BTRF, 90%+ of the character animations are in difk.
Please contact me for more information and to see if I can help you. I'm not often on epvp, so don't be surprised if I don't answer directly.
I have the official animations on unity and what I can tell you is that the first thing to do will be to convert the naf DIFK to naf BTRF, 90%+ of the character animations are in difk.
Please contact me for more information and to see if I can help you. I'm not often on epvp, so don't be surprised if I don't answer directly.
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.)
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.)
Read prefs: C:\Users\Acer\AppData\Roaming\Blender Foundation\Blender\3.0\config\userpref.blend
b'BTRF'
4 Header Size
1 MJ Ver
1 MN Ver
72 HEADER POS
12 Header
4.0
Traceback (most recent call last):
File "\Text", line 26, in <module>
NameError: name 'readGuid' is not defined
Error: Python script failed, check the message in the system console
Read prefs: C:\Users\Acer\AppData\Roaming\Blender Foundation\Blender\3.0\config\userpref.blend
b'BTRF'
4 Header Size
1 MJ Ver
1 MN Ver
72 HEADER POS
12 Header
4.0
Traceback (most recent call last):
File "\Text", line 26, in <module>
NameError: name 'readGuid' is not defined
Error: Python script failed, check the message in the system console
You can do it with this but I'm not sure it's exactly correct.
You add functions.
Blender 3.0 NAF Reader
Code:
#Writed By ZONE
import bpy
import uuid
import struct
import mathutils
class NAF():
def __init__(self):
self.BTRF = ""
self.header_size = 0
self.major_version = 0
self.minor_version = 0
self.header_pos = 0
def ReadFixedString(file):
test = ""
while True:
c = file.read(1)
lw = int.from_bytes(c, "big")
sd = c.decode('utf-8')
if lw == 0:
break
test += str(sd)
return test
def readGuid(file, sdw):
print(sdw)
tewa = []
for x in range(sdw):
w = file.read(16)
dsw = uuid.UUID(bytes=w)
tewa.append(dsw)
return tewa
def ReadInt(file):
return struct.unpack("i",file.read(4))[0]
def ReadBTRF(file):
return struct.unpack("4s",file.read(4))[0].decode()
def ReadShort(file):
return struct.unpack("h",file.read(2))[0]
def ReadFloat(file):
return struct.unpack("f",file.read(4))[0]
def ProcessFile():
file_path = "C:\\asm_cbt_attack01_c_biped.naf"
with open(file_path,"rb") as file:
E = NAF()
E.BTRF = ReadBTRF(file)
E.header_size = ReadInt(file)
E.major_version = ReadShort(file)
E.minor_version = ReadShort(file)
E.header_pos = ReadInt(file)
header_naf_pos = E.header_size + 8
file.seek(header_naf_pos)
print(file.tell())
GUIDSIZE = ReadInt(file)
print("GUID SİZE",GUIDSIZE)
sz = int(GUIDSIZE / 18)
GuidSizeList = readGuid(file,sz)
print(GuidSizeList)
header_naf_pos = header_naf_pos + int(GUIDSIZE) + 4
file.seek(header_naf_pos)
print("Current Pos",file.tell())
ls = ReadInt(file)
stringArray = []
string_count = ReadInt(file)
for s in range(string_count):
strings = ReadFixedString(file)
stringArray.append(strings)
print(stringArray)
header_naf_pos = header_naf_pos + int(ls) + 4
file.seek(header_naf_pos)
print("Current Pos",file.tell())
next_header_pos = ReadInt(file)
block_num = ReadInt(file)
for b in range(block_num):
file.read(3)
types = file.read(1)
block_size = ReadInt(file)
temp_index = ReadShort(file)
guidTableIndex = GuidSizeList[b]
if guidTableIndex == uuid.UUID('21e0bc81-76ad-6f34-9c7d-19885fd118b6'):
version = ReadInt(file)
print("Version",version)
if guidTableIndex == uuid.UUID('6b29f9e8-ddb9-8040-8bc7-6c69e0aa3feb'):
bone_counts = ReadInt(file)
channel_count = ReadInt(file)
ani_channel_index = ReadShort(file)
Bone_GUID = GuidSizeList[ani_channel_index - 1]
if Bone_GUID == uuid.UUID('37c1b381-b8b2-b040-a3ad-d149467f5932'):
channel_name = ReadInt(file)
channel_flag = ReadInt(file)
channel_time_span = ReadInt(file)
channel_frame_rate = ReadInt(file)
bone_ani_size = ReadInt(file)
file.read(4)
file.read(4)
bone_ani_index = ReadShort(file)
Bone_Ani_GUID = GuidSizeList[bone_ani_index-1]
if Bone_Ani_GUID == uuid.UUID('de4443b8-b6a1-a74a-afd6-22ca8a4b0cee'):
bCount = ReadInt(file)
for bk in range(bCount):
file.read(4)
boneSName = ReadInt(file)
boneName = stringArray[bk]
print("Bone Name : ", boneName)
parent_id = ReadInt(file)
parentName = stringArray[parent_id]
file.read(64) #Bone TM
flag = ReadInt(file)
pos_time_size = int(ReadInt(file) / 4)
file.read(1)
posTimeArray = []
for ps in range(pos_time_size):
pos_time = ReadInt(file)
posTimeArray.append(pos_time)
print("POS Time Array ",posTimeArray)
posKeyArray = []
pos_key_size = int(ReadInt(file) / 12)
file.read(1)
for pk in range(pos_key_size):
x = ReadFloat(file)
y = ReadFloat(file)
z = ReadFloat(file)
matk = mathutils.Vector((x,y,z))
posKeyArray.append(matk)
print("Pos Key Array",posKeyArray)
rotTimeArray = []
rot_time_size = int(ReadInt(file) / 4)
file.read(1)
for rt in range(rot_time_size):
rot_time = ReadInt(file)
rotTimeArray.append(rot_time)
print("Rot Time Array",rotTimeArray)
rotKeyArray = []
rot_key_size = int(ReadInt(file) / 16)
file.read(1)
for rk in range(rot_key_size):
x = ReadFloat(file)
y = ReadFloat(file)
z = ReadFloat(file)
w = ReadFloat(file)
mats = mathutils.Quaternion([w,x,y,z])
mats.invert()
rotKeyArray.append(mats)
print("Rot Key Array",rotKeyArray)
child_size = int(ReadInt(file) / 4)
file.read(1)
for cz in range(child_size):
child_index_array = ReadInt(file)
ProcessFile()
Not to sound like a douche, But I really don't think anyone is going to give you a fully working work flow for free, Unless you're willing to put in the effort yourself I'm pretty sure you probably wont get it.
Not to sound like a douche, But I really don't think anyone is going to give you a fully working work flow for free, Unless you're willing to put in the effort yourself I'm pretty sure you probably wont get it.
I agree with you and appreciate your advice. nevertheless, I got a lot of information from this thread.
[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...