Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Black Desert Online File Formats (PAB, PAC, PAA)

Post questions about game models here, or help out others!
parttimegamer15
advanced
Posts: 40
Joined: Thu Jun 16, 2016 7:00 pm
Has thanked: 12 times
Been thanked: 2 times

Re: Black Desert Online File Formats (PAB, PAC, PAA)

Post by parttimegamer15 »

Thanks for taking your time to look into this! Yes it does work with the 3rd Jan version of the blend file :-) Thanks again
shakotay2 wrote:Seems it's a matter of the blend-file version.
I used the files you sent me:
phw_00_nude_0001_noalpha.pac
phw_01.pab

phw_06_01_stand_idle_00.paa
phw_04_01_move_run_r_00.paa

with Blender249.blend as of 3.1.2015 (3rd January) and all works fine
(apart from some oddities with the blender timeline window where the Play/Stop button had to be pressed several times)
newkuro
ultra-n00b
Posts: 2
Joined: Mon Jan 18, 2010 6:55 am

Re: Black Desert Online File Formats (PAB, PAC, PAA)

Post by newkuro »

black desert - new character(15_pdw) not import (.pac)
help
ciabiss
ultra-n00b
Posts: 1
Joined: Sat Nov 25, 2017 2:46 pm

Re: Black Desert Online File Formats (PAB, PAC, PAA)

Post by ciabiss »

i need help...
first i get an error in the blender console saying:
SyntaxError: Missing parentheses in call to 'print'
so i fix that and then this happened:
You do not have the required permissions to view the files attached to this post.
Demrok
ultra-n00b
Posts: 4
Joined: Sat Jan 07, 2017 7:46 pm

Re: Black Desert Online File Formats (PAB, PAC, PAA)

Post by Demrok »

Is there an updated version of these scripts that is needed to run the .PAA extraction?
I am using blender 249 and the script fails and says "Missing parentheses in call to 'print' (inside blender)
I'm just trying to extract the animations, but I can not get it to work...
Anyone have any help/advice/tutorial?

Thanks!
User avatar
ngovandang
veteran
Posts: 121
Joined: Sun Aug 10, 2014 10:33 am
Has thanked: 32 times
Been thanked: 17 times
Contact:

Re: Black Desert Online File Formats (PAB, PAC, PAA)

Post by ngovandang »

Szkaradek123 wrote:Hi

Here is an animation importer for models from this game.
It requires Blender version 249 and Python 26.
I used chrrox script for Noesis viewtopic.php?f=16&t=10909 and ArthainBaka file format research .

Steps:
1.unpack importer
2.run Blender249.blend
3.in Blender Text Window press alt+p and select:
-pac file - for importing a skinned mesh
-pab file - for importing a skeleton
-paa file - for importing an animation
-pam file - for importing static objects

Updated 2015-01-10:
-added pam importer

Updated 2015-01-06:
- added new animation importer
Can you please update the script? Its not working with many models in new recent game version
jreyesl85
ultra-n00b
Posts: 2
Joined: Wed Sep 28, 2016 3:05 am

Re: Black Desert Online File Formats (PAB, PAC, PAA)

Post by jreyesl85 »

I used the method halftofloat from PAZ unpacker code to get 4bytes float values from 2bytes data representing float values
It worked for both formats PAC an PAB, even PAA keyframe values seem normal values but rotation and translation are quite weird, you can see tha t is moving but with an unacceptable result. Hope this put some light into this matter
jreyesl85
ultra-n00b
Posts: 2
Joined: Wed Sep 28, 2016 3:05 am

Re: Black Desert Online File Formats (PAB, PAC, PAA)

Post by jreyesl85 »

public ushort FloatToHalf(float float32)
{
int si32 = BitConverter.ToInt32(BitConverter.GetBytes(float32),0);
int num1 = si32 >> 16 & 32768;
int num2 = (si32 >> 23 & (int) byte.MaxValue) - 112;
int num3 = si32 & 8388607;
if (num2 <= 0)
{
if (num2 < -10)
return (ushort) num1;
int num4 = num3 | 8388608;
int num5 = 14 - num2;
int num6 = (1 << num5 - 1) - 1;
int num7 = num4 >> num5 & 1;
int num8 = num4 + num6 + num7 >> num5;
return (ushort) (num1 | num8);
}
if (num2 == 143)
{
if (num3 == 0)
return (ushort) (num1 | 31744);
int num4 = num3 >> 13;
return (ushort) (num1 | 31744 | num4 | (num4 == 0 ? 1 : 0));
}
int num9 = num3 + 4095 + (num3 >> 13 & 1);
if ((num9 & 8388608) != 0)
{
num9 = 0;
++num2;
}
if (num2 > 30)
throw new ArithmeticException("Half: Hardware floating-point overflow.");
return (ushort) (num1 | num2 << 10 | num9 >> 13);
}
//---------------------------------------------
public float HalfToFloat(ushort ui16)
{
int num1 = (int)ui16 >> 15 & 1;
int num2 = (int)ui16 >> 10 & 31;
int num3 = (int)ui16 & 1023;
if (num2 == 0)
{
if (num3 == 0)
return num1 << 31;
while ((num3 & 1024) == 0)
{
num3 <<= 1;
--num2;
}
++num2;
num3 &= -1025;
}
else if (num2 == 31)
{
if (num3 == 0)
return num1 << 31 | 2139095040;
return num1 << 31 | 2139095040 | num3 << 13;
}
int num4 = num2 + 112;
int num5 = num3 << 13;
int bytes = num1 << 31 | num4 << 23 | num5;
return BitConverter.ToSingle(BitConverter.GetBytes(bytes), 0);
}
yang4228907
ultra-n00b
Posts: 4
Joined: Wed Nov 27, 2019 11:58 am

Re: Black Desert Online File Formats (PAB, PAC, PAA)

Post by yang4228907 »

please help~~
PEARLABYSS paa animation

How to open and what are the steps

Thank you very very very much!
You do not have the required permissions to view the files attached to this post.
yang4228907
ultra-n00b
Posts: 4
Joined: Wed Nov 27, 2019 11:58 am

Re: Black Desert Online File Formats (PAB, PAC, PAA)

Post by yang4228907 »

hlep error
You do not have the required permissions to view the files attached to this post.
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4291
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1151 times
Been thanked: 2244 times

Re: Black Desert Online File Formats (PAB, PAC, PAA)

Post by shakotay2 »

yang4228907 wrote: Thu Nov 28, 2019 10:37 am please help~~
PEARLABYSS paa animation
what is this? A request? How do you think anyone could know what your problem is?
How to open and what are the steps

Thank you very very very much!
In blender 2.49b: with the suiting blend file open (yes, there are several .blend file versions, which version/date are you talking about?)

with the mouse cursor in blender's script window:
- press alt-p, load pac (the mesh)
- press alt-p, load pab (the skeleton)
- press alt-p, load paa (the animation)

result:
.
m0001_07_goblin_boss_armor_0001.png
console output:
Compiled with Python version 2.6.2.
Checking for installed Python... got it!
M0001_07_Goblin_Boss_Armor_0001
WARNING: no log
WARNING: no log
WARNING: no log
...
You do not have the required permissions to view the files attached to this post.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
Docwastaken
ultra-n00b
Posts: 1
Joined: Sun Feb 08, 2015 2:34 am
Has thanked: 2 times
Been thanked: 1 time

Re: Black Desert Online File Formats (PAB, PAC, PAA)

Post by Docwastaken »

Skykila wrote: Thu Mar 03, 2016 8:51 am Hi folks, I'm trying to make Noesis script to import animation. I have achieved some success, but the animation still loaded not correctly. Maybe someone knows what's the problem?
(you need to put skeleton file [.pab] in animation folder)
Did you ever get anywhere with this? The animations work fine in Blender, but not in neosis. Can anyone who actually has some idea what they're looking at actually spot the difference here?

Blender py that works:

Code: Select all

def paaParser(filename,g):
	action=Action()
	action.BONESPACE=True
	action.BONESORT=True
	action.skeleton='armature'
	g.word(4)
	g.seek(16)
	boneCount=g.H(1)[0]
	g.H(4)
	for m in range(boneCount):
		g.logWrite('key'+str(m))
		bone=ActionBone()
		bone.name=str(g.i(1)[0])	
		c1=g.H(1)[0]
		for n in range(c1):#scale key
			g.H(4)
		c2=g.H(1)[0]
		for n in range(c2):#rotation key
			bone.rotFrameList.append(g.H(1)[0]/33)
			bone.rotKeyList.append(QuatMatrix(g.half(4)).resize4x4())	
			
		c3=g.H(1)[0]
		for n in range(c3):#transaltion key
			bone.posFrameList.append(g.H(1)[0]/33)
			bone.posKeyList.append(VectorMatrix(g.half(3)))	
		action.boneList.append(bone)	
	action.draw()
	action.setContext()
Neosis py that returns wrong results:

Code: Select all

	bs.readBytes(4)
	bs.seek(16, NOESEEK_ABS)
	boneCount = bs.readUShort()
	animationDuration = bs.readFloat()
	NumFrames = int(animationDuration * 30.0)
	bs.readBytes(4)
	
	boneList = []
	kfBones = []
	timeList=[]
	
	for m in range(0, boneCount1):
		boneHash1 = bs.readUInt()
		
		name = boneNames[m]
		Parent = boneParentList[m]

		RotKeys = []; TrnKeys = []
				
		scaleKeyframeCount = bs.readUShort()
		for n in range(0, scaleKeyframeCount):#scale key
			scalekeyframe = bs.readUShort()//33 
			bs.readHalfFloat(); bs.readHalfFloat(); bs.readHalfFloat()

		rotationKeyframeCount = bs.readUShort()
		for n in range(0, rotationKeyframeCount):#rotation key
			rotationkeyframe = bs.readUShort()//33
			BoneQuat = NoeQuat( (bs.readHalfFloat(), bs.readHalfFloat(), bs.readHalfFloat(), bs.readHalfFloat()) )
			if Parent is not -1:
				RotKeys.append(NoeKeyFramedValue(rotationkeyframe, BoneQuat * BoneLocalRotList[Parent]))
			else:
				RotKeys.append(NoeKeyFramedValue(rotationkeyframe, BoneQuat))
			
		positionKeyframeCount = bs.readUShort()
		for n in range(0, positionKeyframeCount):#transaltion key
			positionkeyframe = bs.readUShort()//33
			BonePosition = NoeVec3( (bs.readHalfFloat(), bs.readHalfFloat(), bs.readHalfFloat()) )
			if Parent is not -1:
				TrnKeys.append(NoeKeyFramedValue(positionkeyframe, BonePosition + BonePosList[Parent]))
			else:
				TrnKeys.append(NoeKeyFramedValue(positionkeyframe, BonePosition + BonePosList[m]))

		kfBone = NoeKeyFramedBone(m)
		kfBone.setRotation(RotKeys, noesis.NOEKF_ROTATION_QUATERNION_4, noesis.NOEKF_INTERPOLATE_LINEAR)
		kfBone.setTranslation(TrnKeys, noesis.NOEKF_TRANSLATION_VECTOR_3, noesis.NOEKF_INTERPOLATE_LINEAR)
		kfBones.append(kfBone)
	anims.append(NoeKeyFramedAnim("BlackDesert anim", animBones, kfBones, 1))	
Not a big deal as blender works fine, but Neosis is a good bit more convenient. If one of you programming super geniuses know the fix without too much effort it would be greatly appreciated!
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4291
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1151 times
Been thanked: 2244 times

Re: Black Desert Online File Formats (PAB, PAC, PAA)

Post by shakotay2 »

Docwastaken wrote: Sat Dec 14, 2019 11:40 pmThe animations work fine in Blender, but not in neosis. Can anyone who actually has some idea what they're looking at actually spot the difference here?
You might log the matrices in blender, then in Noesis and compare for differences. That's how I would do it if I had time.

btw: looks as if my earlier suggestion of using shorts instead of half floats was wrong:
.
goblin.png
well, from a comparison I guess it should be a problem with the rotation values in the Noesis script because the translation values (starting from 71/0) look very similar in both scripts' log output (apart from the frames up to 70/103 which show a strange grizzling/whatever in blender, too).

Code: Select all

m0001_07_01_01_move_walk_b_00.paa

Noesis, Skykila
...
70.90: 39.093750 -0.000008 0.000008
70.91: 39.406250 -0.000008 0.000000
70.92: 39.500000 -0.000008 0.000011
70.93: 39.312500 0.000000 0.000012
70.94: 39.906250 -0.000015 0.000011
70.95: 40.625000 0.000000 0.000015
70.96: 41.312500 0.000000 0.000011
70.97: 41.531250 -0.000015 -0.000008
70.98: 41.437500 0.000008 0.000008
70.99: 41.437500 -0.000008 -0.000008
70.100: 41.468750 0.000000 0.000008
70.101: 41.531250 -0.000002 0.000027
70.102: 41.468750 -0.000019 0.000013
rotation:
translation:
71.0: 5.140625 -8.820312 3.115234
71.1: 5.140625 -8.820312 3.115234
rotation:
translation:
72.0: 22.218750 -7.113281 -1.173828
72.1: 22.218750 -7.113281 -1.173828
rotation:
translation:
73.0: 22.187500 0.625000 -2.599609
73.1: 22.187500 0.625000 -2.599609
rotation:
translation:
74.0: 22.328125 1.821289 2.548828
74.1: 22.328125 1.821289 2.548828

-----------------------------------------------------------------
Mariusz, blender
...
70 90 : [41.312500, 0.000000, 0.000008](vector)
70 91 : [41.250000, 0.000000, 0.000000](vector)
70 92 : [41.062500, -0.000011, 0.000000](vector)
70 93 : [40.843750, 0.000004, 0.000000](vector)
70 94 : [40.656250, 0.000000, 0.000000](vector)
70 95 : [40.906250, -0.000008, 0.000000](vector)
70 96 : [41.093750, -0.000002, 0.000000](vector)
70 97 : [41.062500, -0.000015, 0.000031](vector)
70 98 : [40.781250, 0.000017, -0.000015](vector)
70 99 : [40.250000, 0.000000, 0.000015](vector)
70 100 : [39.718750, -0.000011, 0.000015](vector)
70 101 : [39.562500, 0.000004, -0.000015](vector)
70 102 : [40.000000, 0.000000, 0.000000](vector)
70 103 : [40.906250, 0.000008, 0.000008](vector)

71 0 : [5.140625, -8.820313, 3.115234](vector)
71 1 : [5.140625, -8.820313, 3.115234](vector)

72 0 : [22.218750, -7.113281, -1.173828](vector)
72 1 : [22.218750, -7.113281, -1.173828](vector)

73 0 : [22.187500, 0.625000, -2.599609](vector)
73 1 : [22.187500, 0.625000, -2.599609](vector)

74 0 : [22.328125, 1.821289, 2.548828](vector)
74 1 : [22.328125, 1.821289, 2.548828](vector)
You do not have the required permissions to view the files attached to this post.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
tnt
ultra-n00b
Posts: 4
Joined: Thu Feb 02, 2017 11:02 pm
Has thanked: 6 times
Been thanked: 1 time

Re: Black Desert Online File Formats (PAB, PAC, PAA)

Post by tnt »

I wrote a structure definition file for Hex Workshop 6.7.0.5247 in helping to interpret the file format (be it PAA, PAB, or PAC)

Also worked on a Noesis script to port over the animation data, but running into the same issue with the quaternions. I wasn't able to get it to work even with the original script that was written for Blender 2.49b, so I'm guessing the data format changed?
You do not have the required permissions to view the files attached to this post.
Mammon
ultra-n00b
Posts: 1
Joined: Fri Feb 07, 2020 12:30 pm

Re: Black Desert Online File Formats (PAB, PAC, PAA)

Post by Mammon »

Can anyone create detailed video-instruction of model extraction process (step-by-step)?
From: opening PAZ-file.
To: import model in Blender.
ItsPedrow
ultra-n00b
Posts: 1
Joined: Thu Apr 23, 2020 10:59 pm
Been thanked: 1 time

Re: Black Desert Online File Formats (PAB, PAC, PAA)

Post by ItsPedrow »

Hey there
The blender script isn't working anymore.
Any update to it?
Post Reply