1. Welcome to VRCat! Please note that this message board is not related to VRChat in any official manner. It is run entirely by the community, and moderated by the community. Any content present has not been reviewed by VRChat moderators or staff. Your use of these forums implies understanding of this message. Thanks!
    Dismiss Notice

Avatars A short guide about porting your first MMD Model

Discussion in 'Tutorials and Tools' started by Sorekasho, Jan 3, 2018.

  1. Sorekasho

    Sorekasho New Member

    Joined:
    Jan 2, 2018
    Messages:
    1
    Likes Received:
    1
    VRChat:
    Sorekasho
    Hello! I am Sorekasho, and I'm here to add up to the count of tutorials there are for porting an MMD model. I apologize if what I had written up has already been covered but I still feel like that there's quite a lot of guides that needs a lot of reading, so here's something that should give you a gist of what to do, and how to port a model in a matter of time without prior-experience.
    (Be warned that this is reliant on Cat's Plugin and may not work on very complex models)

    So there's a few things you need to watch out as this is an MMD-focused model; generally you should look out for complex models if this is your first time porting something, as they can have very confusing bone hierarchy and rigging, high poly-counts, and sometimes might even need to fix their weight-paintings.

    - Anyways! Let's get started. You'll need to prepare the programs and tools.

    1. Blender (https://www.blender.org/download/)

    2. Unity (https://unity3d.com/unity/qa/patch-releases/5.6.3p1)
    So get those downloaded and time to set them up!

    [Blender 2.79]

    Blender's installation is straight forward, so I don't need to explain that.
    Now getting in the plugins are a second step. After the installation of Blender, open it up, and you're greeted by a popup, click anywhere but the popup and you'll be in the scene. Before we do anything, go to File > User Preference
    [​IMG]

    And then afterwards... Do this.

    [​IMG]

    Look for the winrar/zip file of both "cats-blender-plugin-master" and "blender_mmd_tools-dev_test"
    and individually import them one by one and enable them.
    (Some people have issues with adding MMD_Tools so, an easy fix for that is to open up the archive, and if there's another folder in it, pull it out and zip it with winrar and then try to re-add it to the addons menu and enable it.)
    [​IMG]

    After that you should now see these two tabs.

    [​IMG]

    So we're set if all's good! And the start of blender phase.

    We are going to be using "https://xkyarii.deviantart.com/art/450-Watcher-s-Gift-Relaxed-IA-415747408" for this, it is a very simple character with simple rigging that can be easily fixed and the likes. So let's do that yeah?

    So after you download it, extract the folder somewhere, in Blender, go import the PMX file through MMD_Tool's or CAT's Plugin's model menus. She'll appear big but don't worry about that for now.

    [​IMG]

    And now, since this is supposed to be a short-quick guide relying on Cat's plugin, go to CAT tab, and then see that fix model button? Click it. It'll handle most of the things needed, bone hierarchy, flipped hip-bone, removal of upperchest, re-finding/recognizing textures, removing rigid-bodies and joints, et-cetera, now afterwards it should be like this.

    [​IMG]


    (At certain times, after clicking the fix model, it may turn the model into purple/violet shading, but do not worry, as long as the bone hierarchy works then the textures is a minor visual issue in Blender, this is due to it not recognizing the file names sometimes, and can be fixed in the Unity Phase or if you have the appropriate Japanese Unicode to support the naming.)

    Now, after everything there and that, bones moving fine and all. It's time to- actually there's one more thing left.

    [​IMG]

    See this? Yes, the tris count painted in red, it is over the poly/tris count that VRChat can allow. You must lower the poly of a model you want to port into the game down to exact 19,999 polygons or lower for it to be accepted.

    So to decimate this model, in the not-painful way, we are going to use the Edit Modifier's Mesh: Decimate Geometry. To not accidentally Gamecube-fy our model, we need to separate the meshes, and you can do that by clicking Separate by Mesh in either CAT's or MMD_Tool's plugin in the same area as where you imported the model.

    First thing you need to do is go to EDIT Mode once you select a mesh you want to decimate, for example the hair. Afterwards, everytime you select a mesh and go to EDIT Mode, it will always automatically have all meshes highlighted at first. In which then you can press Space, type in Decimate and then click the first thing that pops up, afterwards there should be a modifier on your bottom left screen, the number adjusts how many poly it should reduce and the updates are real-time, decimating is up to your discretion so it's on you how you want to lower a model's poly count down to 20k.

    [​IMG]

    This will be the part where it takes the most time, so don't worry about it, but anyways I can't guide you through everything on this so decimate what you find the largest amount of poly and try to go for the lowest as possible without it looking too broken.


    Now, once you've lower the poly count down to at least 20k, it's ready!
    (Oh! And don't forget to join the meshes either manually or by clicking the Join Mesh button in either CAT's tool or MMD_Tool's menus. It'll save you some trouble later in Unity.)

    [​IMG]

    (Eye-tracking, visemes, texture-atlas, and the likes are for advanced so we are not going to cover that in here.)

    Now export the model as an .FBX somewhere easily find-able and we're ready to go to Unity!

    [​IMG]


    [Unity 5.6.3p1]

    So the installation of Unity requires either an internet if through the assistance, or patience if you download the component installer.
    You also will need an account to be able to use Unity. But anyways let's get to the setup.

    [​IMG]

    You will be greeted by this thing, and you usually have no projects at first, so make one and then choose it.

    Afterwards, the VRCSDK and Cubed's Shaders you downloaded? Time to import them to the project, you can either drag and drop the SDK/Folder in the asset file, or double click the Shader and VRCSDK's Unity Package File to import themselves to the project you have up.

    [​IMG]

    You should then have these two folders in, and a VRChat SDK tab on the top where the File tab and such are.

    Now, once those two are in, time to import our model! Make a folder, name it whatever, and then firstly import the textures of the model, then import the .FBX file you exported afterwards.
    It should appear like this and in the thumbnail, you can vaguely see IA is textured fine.

    [​IMG]

    (If the textures appear transparent, change the standard shader's setting to Opaque, or alternatively use Cubed's Toon Shader to fix possible rendering issue and transparency, use 0 outline on the face textures if possible to avoid weird outlines.)

    We're almost there! So first, click on the IA.FBX and click the tab, Rig, afterwards set Animation Type to Humanoid, and then Apply.

    [​IMG]

    Now to make sure, click Configure, and then check if Upper Chest is unbinded, and in the Heads Tab, remove Left Eye, Right Eye, and Jaw bones. After that apply, then save.

    Now back to the scene, drop IA in the scene and she will appear gigantic, but for now set her position numbers to 0, 0, 0 to center her.

    Now here comes the YMMV part, the height varies and is inconsistent with a lot of players so it's up to you what height you want. For me I use the Directional Light as a height guideline. Anything above it are too tall, and between it are the average height. As seen here.

    [​IMG]

    Anyways once you set that up, you're gonna need to add the last few things to make the model work in VRChat.

    [​IMG]

    You will need to set the Animator Controller to SimpleAvatarController
    And then add a component, and search for Descriptor and click the one with "Avatar" like in the image.

    Alright! So last step, you will need to adjust the viewpoint of your character and their default idle animations. Set the animation to Female and then the viewpoint...

    [​IMG]

    The only way to tell where your camera will be is by this small ball, that can only be seen when a model with the descriptor is selected, usually you'd want to place this inbetween the eyes and inside it, so find the number for it, once you think the ball is set right, put the Z value to 0 and it should be inside the head so it should be good now.

    Now, you can test if she works with the idle animation by pressing the play button, and going to the scene tab, after that you can click the play button again to stop it, and upload!
    So go to the VRChat SDK's setting, log in with your account and then go back, then go to Show Build Content Panel and you should see something like this.

    [​IMG]

    Click Build & Publish and then it'll take you to the naming phase and whatnot, and the image, then click that Upload button! After that it's a matter of waiting and it should be in the game.

    So after that, checking it and all, if it works. Then goodie! You've done your first model port ever~!

    [​IMG]



    This may be a bit, short, rushed, and not too detailed, but I hope that gives everyone a gist of what to do and how to quickly port an MMD model to the game.

    Thank you for reading until to the end! I wish you luck once you decide to tackle more and want to be more advanced!

    Recommended guides to read:

    https://vrcat.club/threads/tuppers-tutorials-megathread.4/ - by Tupper

    https://vrcat.club/threads/rough-tutorial-for-porting-source-engine-models-to-vrchat.122/ - How to Source Models (Gmod, SFM, etc.) by error.mdl

    https://vrcat.club/threads/mmd-model-starting-guide-wip.199/ - A very detailed guide by numerous people started by BlackWhite

    Thanks to the community, and the people who made guides, helped and gave out guides how to make and port models into this beautiful game! Have fun and Happy VR-ing!

    (Guide may have errors, I apologize in advanced and please point out if I wrote or did anything wrong.)
     
    #1 Sorekasho, Jan 3, 2018
    Last edited: Jan 4, 2018
    Ztreak_01 likes this.
  2. Ztreak_01

    Ztreak_01 New Member

    Joined:
    Jan 21, 2018
    Messages:
    3
    Likes Received:
    0
    Thanks alot. Suited me good this was short one. This helped getting me started. Decimate didnt go so good, but some try and fail will make me learn.

    Also seemed like decimate have changed in the latest version.