[request] black desert(pac,pab,paa,pam)import script for blender

Skeletons, animations, shaders, texturing, converting, fixing and anything else related to read game models
hassuny
Posts: 10
Joined: Fri Sep 23, 2016 9:39 am

[request] black desert(pac,pab,paa,pam)import script for blender

Post by hassuny »

hello guys

please i want import script for blender for black desert models and bones and animations
Karpati
Posts: 107
Joined: Wed Nov 12, 2014 1:46 pm

Re: [request] black desert(pac,pab,paa,pam)import script for blender

Post by Karpati »

Did you try out the 3D Object Converter?
http://3doc.i3dconverter.com

It supports the following formats:
.pac/pab
.pam
.mapdata

Install or use the portable version of the program. Just use the Help/Check for updates... function to get the latest version (v6.417).
hassuny
Posts: 10
Joined: Fri Sep 23, 2016 9:39 am

Re: [request] black desert(pac,pab,paa,pam)import script for blender

Post by hassuny »

Karpati wrote:Did you try out the 3D Object Converter?
http://3doc.i3dconverter.com

It supports the following formats:
.pac/pab
.pam
.mapdata

Install or use the portable version of the program. Just use the Help/Check for updates... function to get the latest version (v6.417).


yes bro i have tried 3D Object Converter

but i didn't support .paa files -( animation)

there is an import script for blender in xentax forum that support (pac,pab,paa,pam)
from the member Szkaradek123 in this thread : http://forum.xentax.com/viewtopic.php?f ... hilit=.paa

if you can give a link to this script because i don't have account in that forum please ?? :roll:
Karpati
Posts: 107
Joined: Wed Nov 12, 2014 1:46 pm

Re: [request] black desert(pac,pab,paa,pam)import script for blender

Post by Karpati »

hassuny,

Please read your PM.
Darko
Posts: 47
Joined: Fri Jun 03, 2016 5:24 pm

Re: [request] black desert(pac,pab,paa,pam)import script for blender

Post by Darko »

Here's the script.
godskin
Posts: 192
Joined: Sun Oct 04, 2015 2:27 am

Re: [request] black desert(pac,pab,paa,pam)import script for blender

Post by godskin »

Same Release http://prnt.sc/cmgl23

what you show ??
hassuny
Posts: 10
Joined: Fri Sep 23, 2016 9:39 am

Re: [request] black desert(pac,pab,paa,pam)import script for blender

Post by hassuny »

Karpati wrote:hassuny,

Please read your PM.



thank you very much
hassuny
Posts: 10
Joined: Fri Sep 23, 2016 9:39 am

Re: [request] black desert(pac,pab,paa,pam)import script for blender

Post by hassuny »

Darko wrote:Here's the script.


thank you very much
hassuny
Posts: 10
Joined: Fri Sep 23, 2016 9:39 am

Re: [request] black desert(pac,pab,paa,pam)import script for blender

Post by hassuny »

godskin wrote:Same Release http://prnt.sc/cmgl23

what you show ??



Image

thank you for responding

i didn't catch the idea but as you seee i can't download form xentax forum so that i wanted an external link .
Last edited by hassuny on Mon Sep 26, 2016 3:30 pm, edited 1 time in total.
hassuny
Posts: 10
Joined: Fri Sep 23, 2016 9:39 am

Re: [request] black desert(pac,pab,paa,pam)import script for blender

Post by hassuny »

guys thank you for your help

but how to add the script to the import menu

this script is different from other blender scripts that i have worked with ??

i put the script in "Blender\2.74\scripts\addons\"

but i can't in find in user prefrences -> addon-ons -> import-export
godskin
Posts: 192
Joined: Sun Oct 04, 2015 2:27 am

Re: [request] black desert(pac,pab,paa,pam)import script for blender

Post by godskin »

hassuny wrote:
godskin wrote:Same Release http://prnt.sc/cmgl23

what you show ??



Image

thank you for responding

i didn't catch the idea but as you seee i can't download form xentax forum so that i wanted an external link .


register -__-
easy for register
hassuny
Posts: 10
Joined: Fri Sep 23, 2016 9:39 am

Re: [request] black desert(pac,pab,paa,pam)import script for blender

Post by hassuny »

godskin wrote:
hassuny wrote:
godskin wrote:Same Release http://prnt.sc/cmgl23

what you show ??



Image

thank you for responding

i didn't catch the idea but as you seee i can't download form xentax forum so that i wanted an external link .


register -__-
easy for register


bro ,

in xentax forum if u want to register u have to pay 5$ that's all.
godskin
Posts: 192
Joined: Sun Oct 04, 2015 2:27 am

Re: [request] black desert(pac,pab,paa,pam)import script for blender

Post by godskin »

OLD Register Yes 5 Usd
now it free http://prntscr.com/cmu3wv
hassuny
Posts: 10
Joined: Fri Sep 23, 2016 9:39 am

Re: [request] black desert(pac,pab,paa,pam)import script for blender

Post by hassuny »

godskin wrote:OLD Register Yes 5 Usd
now it free http://prntscr.com/cmu3wv


thanks mate done
parttimegamer15
Posts: 28
Joined: Thu Jul 21, 2016 12:17 am

Re: [request] black desert(pac,pab,paa,pam)import script for blender

Post by parttimegamer15 »

Has anyone managed to export the animation (PAA) files? Using the script I can import mesh (PAC) as well as armature(PAB). However on importing animation (PAA) file the mesh and armature gets horribly deformed...Not sure if there is some scaling issues. I have posted on the XeNTaX forum, however response id usually slow over there. Anyone here who can help?
Cheers
Image

Image
hassuny
Posts: 10
Joined: Fri Sep 23, 2016 9:39 am

Re: [request] black desert(pac,pab,paa,pam)import script for blender

Post by hassuny »

parttimegamer15 wrote:Has anyone managed to export the animation (PAA) files? Using the script I can import mesh (PAC) as well as armature(PAB). However on importing animation (PAA) file the mesh and armature gets horribly deformed...Not sure if there is some scaling issues. I have posted on the XeNTaX forum, however response id usually slow over there. Anyone here who can help?
Cheers
Image

Image



Use This script :

Code: Select all

# Import Library
import newGameLib
reload(newGameLib)
from newGameLib import *
import Blender   

# Mesh Importer
def pacParser(filename,g):
   idMagic = g.i(1)[0]; parVer = g.H(1)[0]
   g.seek(0x10)
   if parVer == 259:
      boneCount     = g.B(1)[0]
      bonehashList=[]
      for m in range(boneCount):bonehashList.append(g.i(1)[0])
      usedBoneCount = g.B(1)[0]
      usedBones     = g.B(usedBoneCount)
      totalVert, totalFace,  = g.i(2)
      meshCount=g.H(1)[0]
      for a in range(0, meshCount):
         meshNameSize = g.B(1)[0]
         meshName = g.word(meshNameSize)
         print meshName
         flag = g.H(1)[0]
         material = Mat()
         material.TRIANGLE=True
         material.ZTRANS=True
         texture_path=g.dirname.split('model')[0]+os.sep+'texture'+os.sep
         material.diffuse=texture_path+meshName+'.dds'
         material.specular=texture_path+meshName+'_sp.dds'
         material.normal=texture_path+meshName+'_n.dds'
         mesh=Mesh()
         for b in range(0, 3):
            vertCount = g.H(1)[0]
            skin=Skin()
            for m in range(vertCount):
               t=g.tell()
               mesh.vertPosList.append(g.f(3))
               g.seek(t+16)
               mesh.vertUVList.append(g.half(2))
               g.seek(t+24)
               mesh.skinIndiceList.append(g.B(4))
               mesh.skinWeightList.append(g.B(4))
               g.seek(t+0x20)
            faceCount = g.i(1)[0]
            mesh.indiceList=g.H(faceCount)
            skin.boneMap=bonehashList
            if b < 1:
               mesh.TRIANGLE=True
               mesh.matList.append(material)
               mesh.skinList.append(skin)
               mesh.BINDSKELETON='armature'
               mesh.draw()   

# Skeleton Importer
def pabParser(filename,g):   
   g.word(4)
   parVer = g.H(1)[0]
   g.seek(0x10)   
   skeleton=Skeleton()
   skeleton.ARMATURESPACE=True
   skeleton.BINDMESH=True
   g.seek(16)
   boneCount = g.H(1)[0]
   for m in range(0, boneCount):
      bone=Bone()
      bone.name = str(g.i(1)[0])
      name=g.word(g.B(1)[0])
      bone.parentID = g.i(1)[0]
      bone.matrix=Matrix4x4(g.f(16))
      g.seek(64,1)
      g.seek(64,1)
      g.seek(64,1)
      boneScale = g.f(3)
      BoneQuat  = g.f(4)
      BonePos   = g.f(3)
      g.seek(0x2,1)
      skeleton.boneList.append(bone)
   skeleton.draw()   
   
# Animation Importer   
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()   

# Static Object Importer   
def pamParser(filename,g):
   if 'object'+os.sep in filename:
      texDir=filename.split('object')[0]+'object'+os.sep+'texture'
   else:
      texDir=g.dirname
   idMagic = g.word(4); parVer = g.H(1)[0]
   g.seek(0x10)
   if parVer == 1286:
      meshList=[]
      meshCount=g.i(1)[0]
      g.f(6)
      g.B(10)
      g.seek(1040)
      for m in range(meshCount):
         mesh=Mesh()
         mat=Mat()
         mat.TRIANGLE=True
         t=g.tell()
         mesh.info=g.i(5)
         mat.diffuse=texDir+os.sep+g.find('\x00')
         g.seek(t+276)
         mesh.matList.append(mat)
         meshList.append(mesh)
      for i,mesh in enumerate(meshList):
         for m in range(mesh.info[0]):
            t=g.tell()
            mesh.vertPosList.append(g.f(3))
            g.seek(t+16)
            mesh.vertUVList.append(g.half(2))
            g.seek(t+28)
      for i,mesh in enumerate(meshList):
         mesh.indiceList=g.H(mesh.info[1])
         mesh.draw()   
   elif parVer == 1030:
      meshList=[]
      meshCount=g.i(1)[0]
      g.f(6)
      g.B(10)
      g.seek(1040)
      for m in range(meshCount):
         mesh=Mesh()
         mat=Mat()
         mat.TRIANGLE=True
         t=g.tell()
         mesh.info=g.i(4)
         mat.diffuse=texDir+os.sep+g.find('\x00')
         g.seek(t+272)
         mesh.matList.append(mat)
         meshList.append(mesh)
      for i,mesh in enumerate(meshList):
         for m in range(mesh.info[0]):
            t=g.tell()
            mesh.vertPosList.append(g.f(3))
            g.seek(t+16)
            mesh.vertUVList.append(g.half(2))
            g.seek(t+28)
      for i,mesh in enumerate(meshList):
         mesh.indiceList=g.H(mesh.info[1])
         mesh.draw()   
   else:
      print 'WARNING:unknow version:',parVer   
   
# File Type Detection   
def Parser():
   filename=input.filename
   ext=filename.split('.')[-1].lower()   
   
   if ext=='pac':
      file=open(filename,'rb')
      g=BinaryReader(file)
      pacParser(filename,g)
      file.close()
   
   if ext=='pab':
      file=open(filename,'rb')
      g=BinaryReader(file)
      pabParser(filename,g)
      file.close()
   
   if ext=='paa':
      file=open(filename,'rb')
      g=BinaryReader(file)
      paaParser(filename,g)
      file.close()
      
   if ext=='pam':
      file=open(filename,'rb')
      g=BinaryReader(file)
      pamParser(filename,g)
      file.close()
   
# Open File function
def openFile(flagList):
   global input,output
   input=Input(flagList)
   output=Output(flagList)
   parser=Parser()
   
# Select file window   
Blender.Window.FileSelector(openFile,'import','Black Desert files: pac-mesh, pab-skeleton, paa-animation, pam-static object ') 






# ACTIVE THIS WINDOW
# PRESS (Alt + P) IN KEYBOARD
# SELECT File To Import :
# *.PAC (SKINED MESH)
# *.PAB (SKELETON)
# *.PAA (ANIMATION)
# *.PAM (STATIC OBJECT)


by the way what is the .paz unpacking tool u are using ?
Skykila
Posts: 7
Joined: Fri Aug 08, 2014 8:24 am

Re: [request] black desert(pac,pab,paa,pam)import script for blender

Post by Skykila »

hassuny wrote:
parttimegamer15 wrote:by the way what is the .paz unpacking tool u are using ?


Use this tool.
darsig
Posts: 5
Joined: Mon Aug 28, 2017 7:53 am

Re: [request] black desert(pac,pab,paa,pam)import script for blender

Post by darsig »

any chance to see skeleton and animation importer script for blender or noesis with normal bones names , not numbers?