Skip to content

Commit

Permalink
Merge pull request #14 from Menithal/refactor-mmd
Browse files Browse the repository at this point in the history
Version 1.0 Release
  • Loading branch information
Menithal authored Apr 26, 2018
2 parents fe89661 + 80a870b commit 8ff2183
Show file tree
Hide file tree
Showing 32 changed files with 3,527 additions and 780 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ __pycache__/

# C extensions
*.so

*.zip
# Distribution / packaging
.Python
build/
Expand Down
68 changes: 68 additions & 0 deletions MMD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
## MMD to High Fidelity Guide


## Requirements

To import MMD models as avatars need a couple of tools:

- You need bandizip to unpack file names with Japanese utf-8 characters. https://www.bandisoft.com/bandizip/ This is done because [Windows Zip & others using the same compression methodology do not like non-latin characters.](https://support.microsoft.com/en-us/help/2704299/japanese-characters-in-file-names-are-displayed-as-garbled-text-after) and Applocale not available in Windows 10 anylonger!
- You need to install the latest mmd_tool to import the .pmd file types to Blender
https://github.com/powroupi/blender_mmd_tools . Follow their readme to install it.


#### Opening the Zip file

Open up bandizip, press Open Archive and open the mmd model zip file you want to extract

Before pressing Extract, make sure your "Code Page" is set to Japanese

---

#### Make sure to read the MMD Model's Readme:
**Some artists explicitly state they do not want redistribution, nor modification, nor do they want to be put into another game other than MMD, or put into Adult situations.** Sure it is the internet, but respect should be given to these creators.

The Readmes usually have an English translation below the japanese one if not, more of it will be visible in the read me after import to blender.

---

#### Importing to Blender

After Extracting the zip file and reading the read me, open up a new scene in Blender

1. Clean the scene, you can press A, then X, then left mouse button
2. Goto File > import .pmd and navigate to the directory
3. Before Importing Make sure the import settings are as follows:
>
> Scale: 0.1 (Very, important)
> Clean Model
> Remove Doubles
>
> Fix IK Links, Rename Bones / Translate bones should all be disabled.
>
> MIP maps is voluntary.
You can then save these settings by pressing the plus sign above morphs and assigning it a name. It will then be available from the dropdown

4. After importing to scene, in the 3D View, navigate to the `High Fidelity` Tab.
5. Save Blend file to a directory you want to use for your avatar
6. Press `Convert MMD Avatar`.
7. After pressing the button, Blender will start doing stuff in the foreground. Wait until the console window has dissapeared. **It will do alot of work.**

The following things will happen:
- The bones will correct them selves and materials will combine them selves as much as possible.
- TGA textures will be converted to png automatically,
- and all textures used will be moved to textures folder relative to the model.

After it is done, play around with the bones in pose mode to see if everything binded correctly. Once you are happy with the result

1. Select the armature
2. Goto Edit mode
3. Select bones you want to make physical (hair, tails, clothing, etc)
4. In the Left hand panel, All the other options under `High Fidelity` will be hidden, except a few buttons
5. Press `Set Bone Physical`
6. Now you are ready to export: Goto `File > Export > Hifi Avatar FST`, Set `Embed` to True. Export to Folder

Once this is done, upload both the `fst file` and the `fbx` either to the marketplace, or to a http directory.



52 changes: 39 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,60 @@
# Blender Hifi AddOn

This add On project ("Hermes") is a community driven project started by Menithal to
create a plugin for blender to allow for easier content creation for the High Fidelity Metaverse.
Plugin ("Project Hermes") is a plugin for Blender to allow for easier content creation and importing for the High Fidelity Metaverse Platform.

## Existing installations should be removed prior to installing this new version of the Blender PLugin

----

# Installation Guide

Open the Github page, and press `Clone or download` and download as zip.
## Simple
Open the Github page, Go to releases and download the `hifi_tools.zip` zip file.

In Blender. Goto `User Preferences`, and `Add-ons`. From there `Install Add-on from File` and select the Zip file that we downloaded.

Enable the plugin under `Import-Export: Hifi Blender Add-On`

## If you downloaded the download repository:

Copy `hifi_tools` folder to your Blender Addons Directory.

# Use
On Windows this is under `%APPDATA%/Blender Foundation/Blender/<BlenderVersion>/addons`

For now, the add-on allows you to import primitive entities from High Fidelity. In High Fidelity, select the entities you want to export and press export.
# Utility Functions:

In Blender, You can then import these entities with `File > Import > HiFi Metaverse Scene JSON`
- A new Panel on the `3D View`'s left tool set is added, labled `High Fidelity`
- Armature Tools
- `Add Hifi Armature` - Adds an Armature which is compatible with High Fidelity, has all the naming conventions in place
- `Test Avatar Rest Pose` - Tests the T-Pose used in high fidelity in Blender, useful for debugging issues
- `Set Bone Physical` - (Armature Edit mode only) Adds a prefix to selected bones for Scripts in High fidelity for physical simulation
- `Remove Bone Physical` - (Armature Edit mode only) Removes prefix from selected bones for Scripts in High fidelity for physical simulation
- Avatar Converters
- `MMD Avatar` - Translates and fixes MMD models and their materials for them to work in High Fidelity. Full MMD Avatar import guide [here](MMD.md)
- `Mixamo Avatar` - Translates and fixes mixamo models and their materials for them to work in High Fidelity
- Material Tools
- `Make All Fullbright` - Sets ALL materials fullbright
- `Make All Shadeless` - Sets ALL materials shadeless - Will not work for avatars, however.
- `Textures To PNG` - Converts ALL images used in the blend file to png. You must save first
- `Textures To Mask` - Converts ALL Opaque images into Masks, avoiding z sort issues with avatars

You can then set materials to the objects via the material panel, modify the mesh, do uv mapping corrections, then export it, ready for marketplace.
# Export Tools:

You can then export the entities with `File > Export > HiFi Metaverse Scene JSON/FBX`
- `File > Export > Hifi Avatar FST`: Exports Avatar, applies necessary steps for avatar to work in High Fifelity.
- Supports Embedded textures: Exports Textures embedded to file
- Supports Selected Only: Exports Selected only
- Experimental Oven Feature: Experimental feature to Compress Avatar and its Textures: Only settable if you have set the path under `User Settings > Addon > HiFi Blender Add-on`
- `File > Export > HiFi Metaverse Scene JSON/FBX`: Exports Scene as a json and Fbx
- Marketplace / Base URL : This is the folder path for your marketplace or external server address. Simply paste the directory where you will upload the files here, and the json file will have the urls automatically appended to them. This is not optional and must be set prior to exporting: You will otherwise have an error message
- Clone Scene prior to export

Prior to pressing export, get the path to the server the files will be hosted on, or create an item in the marketplace, and copy the edit link path and paste it into the export url override.

## Importing from Hifi:
The add-on allows you to import **0primitive entities** from High Fidelity. In High Fidelity, select the entities you want to export and press export.

In Blender, You can then import these entities with `File > Import > HiFi Metaverse Scene JSON`

You can then set materials to the objects via the material panel, modify the mesh, do uv mapping corrections.

# Import Settings

Expand All @@ -40,7 +70,3 @@ Prior to pressing export, get the path to the server the files will be hosted on
If Entity is not Child of another entity, no Join is done. Only Children are merged with their Parents

Note that Boolean operations work differently, and some may not keep the UV Unwrapping correctly in some situations. Use at your own risk
# Export Settings

- Marketplace / Base URL : This is the folder path for your marketplace or external server address. Simply paste the directory where you will upload the files here, and the json file will have the urls automatically appended to them. This is not optional and must be set prior to exporting: You will otherwise have an error message
- Clone Scene prior to export
130 changes: 0 additions & 130 deletions hifi_armature_repose.py

This file was deleted.

Loading

0 comments on commit 8ff2183

Please sign in to comment.