[REFERENCE] papadump.exe & papatran.exe

Discussion in 'Mod Discussions' started by Raevn, June 20, 2013.

  1. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Papadump.exe and papatran.exe are two utilities included with the PA client. There are separate 32bit and 64 bit versions of these tools, located in the PA\bin_x86\Tools and PA\bin_x64\Tools folders, respectively.

    PAPADUMP
    This utility outputs technical information about a given .papa model.

    Code:
    c:\Program Files (x86)\Planetary Annihilation\PA\tools>papadump.exe
    usage: papadump.exe [options] papa-file
      options:
        -v/--verbose
    Sample Output (without -v, which is *very* verbose):

    Code:
    c:\Program Files (x86)\Planetary Annihilation\PA\tools>papadump.exe "c:\Program Files (x86)\Planetary Annihilation\PA\media\pa\units\land\aa_missile_vehicle\aa_missile_vehicle.papa"
    0 textures.
    1 vertex buffer:
        0:
            format: Position3Weights4bBones4bNormal3TexCoord2
            number vertices: 1223
    1 index buffer:
        0:
            format: IF_UInt16
            number indices: 2313
    2 materials:
        0:
            shader: "solid"
            1 vector parameter:
                0:
                    name: "DiffuseColor"
                    value: Vec4<float>(0.47451,0.47451,0.47451,0)
            0 texture parameters.
            0 matrix parameters.
        1:
            shader: "solid"
            1 vector parameter:
                0:
                    name: "DiffuseColor"
                    value: Vec4<float>(0.588,0.588,0.588,0)
            0 texture parameters.
            0 matrix parameters.
    1 mesh:
        0:
            vertex buffer index: 0
            index buffer index: 0
            2 material groups:
                0:
                    name: ""
                    material index: 0
                    first index: 0
                    num primitives: 771
                    primitive type: PRIM_Triangles
                1:
                    name: ""
                    material index: 1
                    first index: 2313
                    num primitives: 0
                    primitive type: PRIM_Triangles
    1 skeleton:
        0:
            4 bones:
                0:
                    name: "bone_root"
                    parent: -1
                    translation: 0,0,0
                    rotation: 0,0,0,1
                    shear_scale: 1.000000  0.000000  0.000000
                                 0.000000  1.000000  0.000000
                                 0.000000  0.000000  1.000000
                    bind2bone: 1.000000  0.000000  0.000000  0.000000
                               0.000000  1.000000  0.000000  0.000000
                               0.000000  0.000000  1.000000  0.000000
                               0.000000  0.000000  0.000000  1.000000
                1:
                    name: "bone_turret"
                    parent: 0
                    translation: -4.27995e-010,1.09395,1.41058
                    rotation: 0,0,0,1
                    shear_scale: 1.000000  0.000000  0.000000
                                 0.000000  1.000000  0.000000
                                 0.000000  0.000000  1.000000
                    bind2bone:  1.000000   0.000000   0.000000   0.000000
                                0.000000   1.000000   0.000000  -1.093951
                                0.000000   0.000000   1.000000  -1.410582
                                0.000000   0.000000   0.000000   1.000000
                2:
                    name: "bone_pivot"
                    parent: 1
                    translation: 0,-1.19209e-007,1.83813
                    rotation: 0,0,0,1
                    shear_scale: 1.000000  0.000000  0.000000
                                 0.000000  1.000000  0.000000
                                 0.000000  0.000000  1.000000
                    bind2bone:  1.000000   0.000000   0.000000   0.000000
                                0.000000   1.000000   0.000000  -1.093951
                                0.000000   0.000000   1.000000  -3.248714
                                0.000000   0.000000   0.000000   1.000000
                3:
                    name: "socket_muzzle"
                    parent: 2
                    translation: 0,-1.08823,0
                    rotation: 0,0,0,1
                    shear_scale: 1.000000  0.000000  0.000000
                                 0.000000  1.000000  0.000000
                                 0.000000  0.000000  1.000000
                    bind2bone:  1.000000   0.000000   0.000000   0.000000
                                0.000000   1.000000   0.000000  -0.005724
                                0.000000   0.000000   1.000000  -3.248714
                                0.000000   0.000000   0.000000   1.000000
    1 model:
        0:
            name: "aa_missile_vehicle_mesh"
            model2scene: 1.000000  0.000000  0.000000  0.000000
                         0.000000  1.000000  0.000000  0.000000
                         0.000000  0.000000  1.000000  0.000000
                         0.000000  0.000000  0.000000  1.000000
            skeleton_data: 0
            1 mesh binding:
                0:
                    name: "aa_missile_vehicle_mesh"
                    mesh index: 0
                    mesh2model: 1.000000  0.000000  0.000000  0.000000
                                0.000000  1.000000  0.000000  0.000000
                                0.000000  0.000000  1.000000  0.000000
                                0.000000  0.000000  0.000000  1.000000
                    4 bone mappings:
                        0: 0
                        1: 1
                        2: 2
                        3: 3
    0 animations.
    PAPATRAN
    This utility combines a number of source files to generate a .papa file.

    Last edited: June 17, 2014
    Quitch and killerkiwijuice like this.
  2. kvalheim

    kvalheim Post Master General

    Messages:
    1,726
    Likes Received:
    645

    Attached Files:

  3. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    :lol:

    Hmm, tried importing delta.papa into blender, exporting as .fbx, then using papatran and re-importing. Got this:


    Doesn't quite match the current delta commander. I can't import the .fbx to verify the export is correct in the first place, though.

    Attached Files:

  4. ozonexo3

    ozonexo3 Active Member

    Messages:
    418
    Likes Received:
    196
    Cool! I will test it today :)
  5. Col_Jessep

    Col_Jessep Moderator Alumni

    Messages:
    4,227
    Likes Received:
    257
    It does have a lot of deltas though...
    Raevn and stuart98 like this.
  6. theggman

    theggman Member

    Messages:
    58
    Likes Received:
    2
    FYI, these tools are not limited to Windows. The linux build contains them as well (I have verified this) and I assume Mac build does as well.
  7. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Tried using fbx converter from autodesk to try different versions of fbx, all came out the same. Comparing the binary files now, straight away I can see there is no bones converted, only the default 3 that all papa unit models have.
  8. neutrino

    neutrino low mass particle Uber Employee

    Messages:
    3,123
    Likes Received:
    2,687
    So we only use fbx files that come from 3DSMAX. The ones form blender might be whack.

    Probably be easiest to give you guys one of our FBX files so you can see how we have it setup.
    kalherine and tristanlorius like this.
  9. KNight

    KNight Post Master General

    Messages:
    7,681
    Likes Received:
    3,268
    Considering I use Crosswalk for FBX in XSI, I wonder hwo those would fair......but still, having a "template" FBX would be a great resource.

    Mike
  10. neutrino

    neutrino low mass particle Uber Employee

    Messages:
    3,123
    Likes Received:
    2,687
    I emailed knight an fbx to post. Continuing the theme with the aa_missile_vehicle.
  11. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Turns out it was the Blender importer messing it up, hadn't realised there were multiple Vertex formats, and exporting a .papa to .fbx then using papatran.exe actually modified which Vertex format it was using.

    Still not getting the extra bones, but the mesh is coming through properly (use v0.5 of the importer).
  12. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    Was trying to use it to import some pngs to papa, but got a "could not find resource-root setting" error.
  13. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,328
    Likes Received:
    2,125
    It needs the default.settings file. I find that the easiest way is to copy the png to where you want the papa to be and run papatran from the media directory. For example, suppose you want to make a nifty texture for the orbital factory. Copy the nifty.png to <PA Install dir>/media/pa/units/orbital/orbital_factory. Then from the command line, cd to <PA Install dir>/media and call papatran like this:
    Code:
    ../tools/papatran pa/units/orbital/orbital_factory/nifty.png -o pa/units/orbital/orbital_factory/nifty.papa
    (Change the '/' to '\' if you are using Windows)

    (edit: spelling)
    Last edited: May 16, 2014
  14. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
  15. grandmasterv

    grandmasterv New Member

    Messages:
    5
    Likes Received:
    0
    Opening either papadump or papatran will not work, trying to run the program from the folder or making a bat file with txt editor does not extract anything.

    D:\Program Files (x86)\Steam\SteamApps\common\Planetary Annihilation\bin_x64\tools\papadump.exe "D:\Program Files (x86)\Planetary Annihilation\PA\media\pa\units\land\aa_missile_vehicle\aa_missile_vehicle.papa"

    Work around is to use the Papa Texture Editor.
    Last edited: July 17, 2014
  16. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Papatran is for turning a png/fbx into a papa, and papadump only displays text-based info about the papa (it doesn't extract). Put a "Pause" statement in the bat file to see the output, but I don't think it will help for what you are after - the papa texture editor is the way to go if you want to extract textures, and the Blender importer can be used for models.

    Note that you'll need a default.settings file in the tools directory when you eventually create the papa file.
  17. grandmasterv

    grandmasterv New Member

    Messages:
    5
    Likes Received:
    0
    With all modding i duplicate the folders, 1 in my work space and one backup so i can undo any faults with the default files.
    But i do hope in time Uber releases a better tool, the process of extracting files, editing etc is cumbersome.
    And yes i know early access so do not see this as a negative comment.
    Would even be better if i can some how make a plugin for PS based on the current extractor tool.
  18. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,328
    Likes Received:
    2,125
    That should be possible. I don't know what language Photoshop uses for its plugins, but the relevant code you would need to port can be found in GitHub. The only functions you would need from those are the decodeXXXXXX functions and the load function.
  19. deltablu26

    deltablu26 New Member

    Messages:
    14
    Likes Received:
    3
    Hi.
    I have follow your instruction but every time I click on papatran.exe the window appear for only 0,5 seconds and i can't see anything.... I have also tried with blender but, the export of .papa files dosn't work.
    How can I fix this?
  20. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,328
    Likes Received:
    2,125
    It's a command-line tool. As in, you need to run it from the command line. :)
    Press <Win>+R and type "cmd". That will get you the command line in Windows, I think. If you've never used a command-line before, maybe this will help.

Share This Page