Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

Modifying Sword/Shield Models

A Tutorial for Pokemon Sword & Shield

No ads for members. Membership is 100% free. Sign up!

Updates

Version 3 1mo
  • Addition Let's Go models support
Version 2 1mo Improvement2

Turn your head into pokeball in 25 easy steps

So I was told that I am probably only person around able to modify Sword/Shield models. This post is to fix that issue.

Beware this is not clicky-dragy user-friendly tutorial. This is your company IT guy playing Pokemon. You will have to use command line and work with script I hacked together over one night. You are also expected to know Blender and being at least able to mod textures by yourself.

1. Prerequisites




As tutorial, i'd like to make my favorite black hoodie just a little shorter.

2. Extract the Archive

Make some working directory and extract attached zip to it. Start Blender and install io_scene_pkmn_obj.zip as new addon. This will add importer and exporter for OBJ format with support for vertex weigths, groups and bitangents, all features youd need for importing models back to game.

3. Copy your file

Find file you want to change and MAKE COPY of it. In fact, make two backups just in case.
You will ever work ONLY on that copy.
Script may detect you are working on original and break it by "mistake".

4. Open in Switch Toolbox

Copy that file (p2_out0001_00_7parker.gfpak in case of hoodie) to your working directory and open it in Switch Toolbox. As you already know, every gfpak contains textures, shaders and one file named like "4016001560820856538.gfbmdl".
That's the model you need to change.

5. Export Raw Data

Right click that model and select "Export raw data". Export it to your working directory.

img1

6. Start command prompt

Start command prompt and navigate to your working directory

7. Execute Python command

Type gfbmdl.py 4016001560820856538.gfbmdl and press enter. If you managed to install
python properly you should get output like this - it displays groups inside of model.

img2
Groups are part of model that are hiding depending on what other clothes are on your character. For example, hair has group that is not drawn when player wears hat. Materials (such as skin or cloth) are also hardcoded to group, so yuou can only use them on that part of model.

8. Export OBJ

Type gfbmdl.py 1234567890.gfbmdl extract nameOfSomeGroup to export it to OBJ.
Beware that script will overwrite files without asking

9. Import to Blender

Import created nameOfSomeGroup.obj to Blender.
Use "PKMN obj" importer installed in step 0 and make sure your import settings are set like this:

img3

It's default so they should be.

10. Edit your Model

There are some rules you want to hold, or import will be broken.
  • Don't change number of materials. You can assign vertices to material but number and order has to stay the same.
  • Don't add more than 4 groups to same vertex. This seems to be limitation of game engine.
  • Make sure every vertex belongs to some group, or they will fly away from your model in game.
  • Make smal changes and test them often. Sometimes model just breaks the game and youll get around it only using trial and error.

11. Export Edited Model

Use "PKMN obj" exporter to export edited model back to obj file. Export settings should look like this:

img4

12. Perform Model Replacement

Type gfbmdl.py 1234567890.gfbmdl replace nameOfSomeGroup edditedObjFile.obj to replace part of model.
Beware that every replacement makes gfbmdl file slightly bigger and once you reach certain treshold game will just crash trying to load it.
Its best to make 2nd copy of gfbmdl, copy it over your working file and then replace all modified parts.

13. Replace Raw Data

Go back to Switch Toolbox, right click 123456798.gfmdl file and select "Replace raw data".
Replace it with modified gfmdl, save it and copy it to your switch to test it out.

hoodie1

Good Luck!
Sign up to access this!
1-10 of 12
1
Pages
  • 1
  • 2
Go to page:
  • SketchR avatar
    SketchR Joined 2mo ago
    Offline
    104 points Ranked 68585th
    access_time 30d
    I keep getting this error at step 7.
    What am I doing wrong?
    Traceback (most recent call last):
    File "C:\Users\SketchR\gfbmdl.py", line 972, in <module>
    gfb = open(sys.argv[1], "rb+")
    IndexError: list index out of range

    Bananite
    URL to post:
  • access_time 1mo edit 1mo
    getting an error as soon as i get to step 7. i type in gfbmdl.py and all and i get the error

    "traceback (most recent call last):
       File "H:\work files\ gfbmdl.py" line 972, in <module>
          gfb = open(sys.argv[1]. "rb+")
    IndexError: list index out of range.

    i tried other versions. version 3 gives me at line 980. Version 1 gives me at line 946. and they all the exact same list out of range index error.
    Bananite
    URL to post:
  • tom avatar
    tom username pic Joined 18y ago
    End Boss Ripe Supporter TBS2 Manager Super Admin
    Present
    Home > Members > NiceneNerd
    12,162 points Ranked 463rd
    66 medals 13 legendary 10 rare
    • Achieved Super Admin clearance Medal icon
    • 10 years a member Medal icon
    • Thanked 500 submitters Medal icon
    • Submitted 200 Blogs Medal icon
    • Submitted 200 Threads Medal icon
    • Submitted 60 Polls Medal icon
    tom avatar
    tom
    End Boss
    access_time 1mo
    Added a table of contents for you.
    testing 1234 222
    URL to post:
  • eman_not_ava avatar
    eman_not_ava username pic Joined 2mo ago
    Offline
    114 points Ranked 66056th
    access_time 1mo
    Could you explain what this error means, cause I don't even know what it's trying to tell me exactly:

    SwSh Modder
    URL to post:
  • nekukun97 avatar
    nekukun97 Joined 3y ago
    Offline
    214 points Ranked 55438th
    access_time 1mo
    Thank you, there is no error when importing the model to .gfpak file, but is there no way to correct this? Or what do I have to do to export it completely from blender?

    Bananite
    URL to post:
  • nekukun97 avatar
    nekukun97 Joined 3y ago
    Offline
    214 points Ranked 55438th
    access_time 1mo
    I'm use a modified pokemon model but I'm getting an error when trying to inject the .obj file into the .gfbmdl file, even if it didn't change anything in the model I get the same error when it is export from blender

    Getting num of faces @ 0x1e61c; Reading 4110 faces
    New obj group 0
    >> At line >> 14031
    Traceback (most recent call last):
      File "C:\Users\Neku-kun\Desktop\Modelado 3d\gfbmdl.py", line 354, in read_obj
        vertex.boneWeights = fill4(wve[vtn[0]-1])
    IndexError: list index out of range

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last):
      File "C:\Users\Neku-kun\Desktop\Modelado 3d\gfbmdl.py", line 997, in <module>
        mesh.read_obj(f)
      File "C:\Users\Neku-kun\Desktop\Modelado 3d\gfbmdl.py", line 356, in read_obj
        raise Exception("Number of weights doesnt match number of vertices.\n"
    Exception: Number of weights doesnt match number of vertices.
    Do you have any loose geometry left in the model?
    Is every vertex assigned to some vertex group?
    Bananite
    URL to post:
  • Silver32 avatar
    Silver32 Joined 10mo ago
    Offline
    101 points Ranked 70460th
    access_time 2mo
    Does this work for the Let's Go games, too?
    I remember that, about a year ago, it was not possible to model-swap Let's Go characters.
    Bananite
    URL to post:
  • Arc_Ray avatar
    Arc_Ray Joined 4y ago
    Offline
    5,234 points Ranked 1224th
    14 medals 2 rare
    • Returned 1000 times Medal icon
    • Became a Game Pioneer Medal icon
    • One month a member Medal icon
    • Returned 100 times Medal icon
    • Submitted 10 Skins Medal icon
    • 6 months a member Medal icon
    access_time 2mo
    oh my god, i thought i figured out what was wrong. i ran in to so many problems and i found out what was needed to fix them and nothing works. somehow nothing still works. one person here somehow got this to work instantly and im just STRUGGLING to make this work. at this rate a super shortcut version of this would need to be made for me to get anywhere with this.
    Bananite
    URL to post:
  • access_time 2mo
    Now this is exciting stuff, thank you for posting!
    Bananite
    URL to post:
  • Alter Zero avatar
    Alter Zero Joined 2mo ago
    Offline
    access_time 2mo
    I'm trying to use a modified clothing model but I'm getting an error when trying to inject the .obj file into the .gfbmdl file.

    G:\Pokemon>gfbmdl.py p2_btm0006_02_frillskants.gfbmdl replace p2_btm0006_00_frillskantsSkin p2_btm0006_00_frillskantsSkin.obj

    [Visual group p2_btm0006_00_frillskantsSkin       (at 0x387a VisMeshPosition 0x38a0, MeshIndex 143)]

    > polygrp @ 0xcd64

    Getting num of faces @ 0xce04; Reading 2790 faces

    New obj group 0

    >> At line >> 2931

    Traceback (most recent call last):

      File "G:\Pokemon\gfbmdl.py", line 997, in <module>

        mesh.read_obj(f)

      File "G:\Pokemon\gfbmdl.py", line 352, in read_obj

        vertex.bitan = Vector4(*bitan[vtn[2]-1])

    IndexError: list index out of range

    G:\Pokemon>

    I hope someone can help with the problem and maybe even make a video tutorial of how to use the commands, I don't really understand the text guide when the files have such inconsistency in the names.
    Bananite
    URL to post:

Embed

Share banner
Image URL
HTML embed code
BB embed code
Markdown embed code

Credits

Key Authors
steiger

Submitter

steiger avatar
steiger Joined 2mo ago
Offline
2,634 points Ranked 20026th
9 medals 1 legendary 1 rare
  • 2019 Top Contributor Medal icon
  • 10 submissions featured Medal icon
  • Submission featured Medal icon
  • Received thanks 5 times Medal icon
  • Returned 100 times Medal icon
  • Reached 1,000 Points Medal icon
steiger
Creator
Sign up to access this!
Sign up to access this!
Sign up to access this!

Game

Sign up to access this!

Category

Details

Difficulty Level
Advanced

Attributes

Share

  • Share on Reddit
  • Share on Twitter
  • Share on Facebook
  • Best of Yesterday
    Featured on Dec 8 2019
  • Today's Pick
    Featured on Dec 7 2019
  • 12
  • 13.9k
  • 31
  • 2mo
  • 13d
  • 1mo

More Other/Misc Tutorials