[Mini Tutorial] Exporting a model from 3ds Max ingame TODO: Animation/Texturing

Discussion in 'Mod Discussions' started by swizzlewizzle, October 22, 2014.

  1. swizzlewizzle

    swizzlewizzle Active Member

    Messages:
    216
    Likes Received:
    56
    Hello everyone, just wanted to make a quick mini tut about how to get a model straight from 3ds max into the game. I'll add info about textures and animations once I get that stuff working.

    1. ?? (Size your model in 3ds max)
    *I was told that the ingame model size is supposed to reflect it's size in 3ds max, but this does not seem to be the case. I did this process with a 14.0 unit length model and a 1.4 unit length (as measured by the tape measure in 3ds max) model but both models were exactly the same size ingame. If anyone knows how to change the ingame model size, please do add your info here.

    2. Merge objects into a single piece of geometry. (I personally converted to editable polys and used the "attach" tool to attach everything together)

    3. *SELECT YOUR ENTIRE UNIT* (i'm not sure why, but somehow not selecting everything causes crashing.... O_O) Go to the utilities tab and click "new script" - copy this script in:

    FbxExporterSetParam "Animation" false
    FbxExporterSetParam "BakeAnimation" false
    FbxExporterSetParam "SmoothingGroups" true
    FbxExporterSetParam "TangentSpaceExport" true
    FbxExporterSetParam "UpAxis" "Z"
    exportFile ("Output.fbx") #noPrompt selectedOnly:true using:FBXEXP

    At the end, after FBXEXP it shows a "?" mark, just delete that mark. I'm not sure why, at least in my tests, it added it.

    **This script is what uber uses to export correctly to FBX without breaking stuff.

    4. In your 3ds max export folder you should have an "Output.fbx" file now. Bring it over to wherever you have papatran.exe located

    5. Run papatran.exe using this format:

    papatran.exe --texture-mode strip -o {filename.papa} {Output.fbx}

    Substitute filename.papa with whatever you want to call the output papa file.

    6. This .papa file should now work. For now, if you just want to see the model ingame, go ahead and shadow a vanilla unit's papa file (however, please remember to remove any mentions of bones and animations in the unit's json file, they will make the game crash. Not sure how bones and such should be handled just yet, will be added here later after I get further). When building ingame, you should see the unit's model replaced with your own.

    Yay.

    Next steps:
    - Ensuring the bone structure is ready to add tool/weapon bones in the unit's Json file (I do not know how to do this just yet)
    - Correctly merging all of the unit's textures into one .png (not sure how this should be done yet) and then converting it correctly to the diffuse/etc.. that PA needs.
    - Converting your 3ds max animations into something PA can use (and merging them into an animTree???? not sure if this is neccessary)
    Last edited: October 22, 2014
    elodea and Gorbles like this.
  2. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    This same thing happens in blender if the resizing isn't "applied", so here's the instructions for blender, see if you can translate to 3ds max. Basically, resizing, translating & rotating simply set a value, rather than modifying the model itself - PA doesn't use this value, so you have to apply the value onto the model.

    Last edited: October 22, 2014
  3. swizzlewizzle

    swizzlewizzle Active Member

    Messages:
    216
    Likes Received:
    56
    Images seem to be broken..

    *Edit: Also.. this makes zero sense to me. I don't understand how PA can "know" the size of a model if it doesn't use the units that are measured in 3ds max. Doesn't make any sense to me. :(
    Last edited: October 22, 2014
  4. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Are they still broken? I did an edit.
  5. liquius

    liquius Well-Known Member

    Messages:
    731
    Likes Received:
    482
    You want to go to
    Customise -> Units setup -> System unit setup


    I been trying to figure this out as well. Currently I am still hitting the same wall as before (bones aligning to the right).
  6. swizzlewizzle

    swizzlewizzle Active Member

    Messages:
    216
    Likes Received:
    56
    Liquius how are you seeing bones ingame? Is your model deforming ingame somehow? As far as I can see, when I export to PA there seems to be no visual problems with my model...

    *Edit: Changing the system units is now causing the game to crash when trying to build the unit O_O
    Last edited: October 22, 2014
  7. swizzlewizzle

    swizzlewizzle Active Member

    Messages:
    216
    Likes Received:
    56
    @raevn in dev console your images are not showing up because of a "access forbidden" error
  8. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Should be fixed now.
  9. swizzlewizzle

    swizzlewizzle Active Member

    Messages:
    216
    Likes Received:
    56
    Yep they show now.
    Raevn likes this.
  10. liquius

    liquius Well-Known Member

    Messages:
    731
    Likes Received:
    482
    I run papadump or load the papa up in blender first to check if everything works.

    I can get the model to show up fine in game, however issues start appearing when the unit aims or an animation plays. No matter what I have tried, I have never been able to get around the issue of every bone aligning to the right.
  11. swizzlewizzle

    swizzlewizzle Active Member

    Messages:
    216
    Likes Received:
    56
    I have no idea what I did but now the model that was previously working is just crashing the game. Client log says "crash" and that's pretty much it lol. Man this is going to be such a headache to get working..
  12. swizzlewizzle

    swizzlewizzle Active Member

    Messages:
    216
    Likes Received:
    56
    @liquius did the export scripts from bgolus not help with the animations?
  13. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Can you zip & attach the .papa file?
  14. liquius

    liquius Well-Known Member

    Messages:
    731
    Likes Received:
    482
    I haven't tried with the animation script. Seeing as the model script didn't change anything, I suspect the core problem will stay the same.
  15. swizzlewizzle

    swizzlewizzle Active Member

    Messages:
    216
    Likes Received:
    56
    @raevn it crashes when I neglect to select the geometry when exporting. It's going through fine now.
  16. swizzlewizzle

    swizzlewizzle Active Member

    Messages:
    216
    Likes Received:
    56
    @liquius how exactly were you able to change the scale on models in 3ds max? Do you need to change the units/inch or such? I can't see anything in the system units dialog that hints about changing the actual size of a model in it's file.
  17. squishypon3

    squishypon3 Post Master General

    Messages:
    7,971
    Likes Received:
    4,357
    You need to change model size in 3ds Max, there is no code snippet for it (Not even internally!) But you must not change your bone sizes, only geometry.
  18. swizzlewizzle

    swizzlewizzle Active Member

    Messages:
    216
    Likes Received:
    56
    I'm unclear how to change geometry sizes while not affecting the animations I have used my bones to create...
  19. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
  20. swizzlewizzle

    swizzlewizzle Active Member

    Messages:
    216
    Likes Received:
    56
    That would be great.. if it didn't crash replays on the server :(

    This really seems like a bad idea considering i'm barely getting these custom models in the game without crashing everything as is. :D

Share This Page