thanks, what version of blender supports python 3.10?Quote:
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)
and what do you mean by "adding functionality?"