Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
wikid24 committed Feb 2, 2023
2 parents 7c3cb4c + 615c74e commit 9412a65
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 23 deletions.
69 changes: 54 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,16 @@ Purpose of this tool is for EVERYONE in FFXIV to start exporting their favorite

# To do:
- ffxiv shape keys:
- make it easy to preview a shape key, edit it before applying (proper UI is needed)
- Populate the shape keys files (facial animation sliders) -- 55 shape keys for each of the 8 races... 440 in all! :S. Reference guide: https://www.deviantart.com/xoriu/art/MMD-Facial-Expressions-Chart-341504917
- Allow for a user to upload their OWN custom shape key csv file (instead of relying on the ones that come as part of this addon)
- Find a way to export shape key data to CSV file (in a similar format as the IMPORT shape keys CSV)
- Automate the rigify armature bones to match ffxiv armature bones (should be mostly easy, the majority of it is a 1:1 'transform rigify bone to match the ffxiv bone's position/rotation data)
- fix IK to match double jointed knees (move the bone constraints to j_asi_c_l instead of j_asi_b_l, set the chain=3 instead of 2)
- display_panel_groups.py - needs to be updated to match the ffxiv bone structure
- automate the bone order export for PMX export (should be easy since ffxiv bones are mostly standard across the board)
- auto-generate rigid bodies instead of using csv (https://github.com/12funkeys/rigid_bodys_gen - https://www.youtube.com/watch?v=0haYapQ7l_U )
- Add presets for skirts (set min max settings, will generate for the entire chain, heaviest on the bottom)
- Add presets for hair (set min max settings, will generate for the entire chain, heaviest on the top)
- auto-generate joints instead of using csv:
- Add presets for boobs
- Add presets for boobs (figure out the proper boobs parameters)
- Add presets for skirts (set min max settings, will generate for the entire chain, heaviest on the bottom)
- Add presets for hair (set min max settings, will generate for the entire chain, heaviest on the top)
- automate the MMD material sorter population:
Expand All @@ -46,16 +43,14 @@ Purpose of this tool is for EVERYONE in FFXIV to start exporting their favorite
- Blender (2.80+) or higher installed - https://www.blender.org/
- 'MMD Tools' addon for Blender - https://github.com/UuuNyaa/blender_mmd_tools
- uuunyaa's Helper addon to MMD Tools for Blender - https://github.com/UuuNyaa/blender_mmd_uuunyaa_tools
- MekTools addon for Blender - https://www.xivmodarchive.com/modid/22780



# Not really needed but recommended:
- MMD (duh) - https://learnmmd.com/downloads/
- Miku Miku Dance (duh) - https://learnmmd.com/downloads/
- PMXE (MMD 3d modeling editor for PMX files) - https://www.deviantart.com/inochi-pm/art/PmxEditor-vr-0254f-English-Version-v2-0-766313588
- PMX files (MMD model files) - https://www.deviantart.com/mmd-downloads-galore/gallery/39472353/models (or you can find the majority of them on asian websites that I can't understand without google translate), alternatively you can use uuunyaa's Helper addon to download some models from within Blender
- VMD files (MMD character/camera animation/dance files) - https://www.deviantart.com/mmd-dance-comunnity/gallery/36305808/motion-dl or check reddit or again, asian websites. Alternatively you can use uuunyaa's Helper addon to download some VMD files from within Blender
- A bunch of MMD effects (will list them later)
- MekTools addon for Blender - https://www.xivmodarchive.com/modid/22780


------------
Expand All @@ -65,10 +60,6 @@ Purpose of this tool is for EVERYONE in FFXIV to start exporting their favorite
- Quick tutorial how to use the FFXIV Shader plugin above: https://user-images.githubusercontent.com/19479648/215879548-67bd503e-70b4-4255-abe4-bc1bbcb06618.mp4
- XAT guide to animation retargeting (an alternative approach to animating MMD using FFXIV characters) https://docs.google.com/document/d/1siUjAAJjUk7-Nlq11wE-Sldr8UyCeu7SkFJzUsxZpTU/edit





------------

# How to Install
Expand All @@ -80,12 +71,60 @@ Purpose of this tool is for EVERYONE in FFXIV to start exporting their favorite
- In the search box, type in 'ffxiv' until the addon 'Object: FFXIV MMD Tools Helper' shows up and check the checkbox
![image](https://user-images.githubusercontent.com/19479648/215303990-62fca28b-79b3-4648-b620-d9c6b0f5aa3c.png)

- Once you see "ffxiv_mmd_tools_helper", you'll know it is installed correctly. All of the tools are located here.
![image](https://user-images.githubusercontent.com/19479648/215304046-309d996e-939e-458c-9d0f-1dc626972931.png)
- Once you see "FFXIV MMD", you'll know it is installed correctly. All of the tools are located here.
![image](https://user-images.githubusercontent.com/19479648/216140678-1b14644f-8639-472d-99dd-23136001bcc7.png)

--------------

# How to use (my new workflow:)

On the **FFXIV MMD** tab
1) On the **Import an FFXIV Model** panel, click on **Import your model FBX File**
2) On the **Language and Translation** panel, click on "**Mass Rename Bones**" (from FFXIV to MMD English)
3) On the **Misc/Testing/Diagnostics** panel, run all of these functions IN ORDER from top to bottom (Start w/ **Correct MMD Root & Center Bones**, end with **Correct Arm Wrist Twist**)

![image](https://user-images.githubusercontent.com/19479648/216136708-c97f8000-03e1-4c4b-86be-1e9c5d36da8f.png)

4) Go the **MMD** tab, click on **Convert Model**

![image](https://user-images.githubusercontent.com/19479648/216136857-5a0f9c28-d825-42dc-87c0-ca76d66d1a21.png)

5) Back on the **FFXIV MMD** tab on the **Bones and IK** panel, click on "**Add Leg and foot IK**"
6) On the "**Rigid Bodies and Joints**" panel, click on "**Add Rigid Bodies to converted MMD armature**"
7) 7) Click on **Add Joints to converted MMD armature**

![image](https://user-images.githubusercontent.com/19479648/216137068-a52465b3-09ad-4b74-8127-5b435cb5968a.png)

8) On the **Language and Translation** panel, change **To: ** to **MMD Japanese w/.L.R suffix**
9) Mass Rename Bones again

![image](https://user-images.githubusercontent.com/19479648/216137344-4d051b88-309a-488f-b83a-4323c38eb5fc.png)

10) Back on the **MMD** tab,click on the "**Physics**" button
11) Import an MMD Motion file.
![image](https://user-images.githubusercontent.com/19479648/216139143-d9f58160-0a74-4ad2-81d9-75f5ec1c6eb7.png)

12) Use MMD Tools to import a motion dance VMD file:
When using MMD Tools' 'Import Motion' functionality to import a VMD motion file:

- Scale should be set to '0.08' (if you imported the FBX file with a scale of 1.00 this is the correct setting to use)
- Bone Mapper: set to 'Renamed bones'
- 'Rename Bones - L/R Suffix' should be checked
- 'Treat Current Pose as Rest Pose' should be checked

![image](https://user-images.githubusercontent.com/19479648/214442288-e62fa637-f605-4ba8-b806-6b5ee935d8d5.png)

13) Use MMD Tools to import Facial Animations:
- Under 'Assembly' click on the Morph tab.
- It will create a mesh called .placeholder. Click on it.
- Then go to 'import motion', and select the same motion VMD dance file
![image](https://user-images.githubusercontent.com/19479648/216222723-f1f3bcc1-e17b-4b9d-9385-c447ffead7f3.png)

14) Press play. All done!! :D
--------------------------


# My current workflow:
# My old workflow:

1) Import FBX file with these parameters:

Expand Down
17 changes: 9 additions & 8 deletions research/physics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ Physically-based objects are never 'animated' like you would for a regular bone.
The relationship between rigid bodies, bones, meshes, and joints is important. Bones control a mesh and how it deforms. However, if you turn physics on, rigid bodies control a bone (and therefore, the mesh). The important thing about that rigid bodies is that they have "gravity" properties, therefore depending on the settings applied, they will move according to the gravity parameters set on them, and will affect other rigid bodies when they collide. Joints will pin rigid bodies together so that they move as if the rigid bodies are attached, and they control how much rigid bodies are allowed to move/rotate in relation to eachother.

- Let's say your FFXIV model has a tail.
- If you want physics to work you need to create a 'physics-based' rigid body (more on that later), ONE FOR EACH BONE on the tail. Once you do this, your tail will now adhere to the rigid body's physics and it will (mostly) ignore the parent/child relationship from bones. If you press the 'play' button in blender and physics are turned on at this point, the tail rigid bodies will fall due to gravity and the bones/mesh will go along with it.
- If you want physics to work you need to create a 'physics-based' rigid body (more on that later), you need one rigid body FOR EACH BONE on the tail. Once you do this, your tail will now adhere to the rigid body's physics and it will (mostly) ignore the parent/child relationship from bones. If you press the 'play' button in blender and physics are turned on at this point, the tail rigid bodies will fall due to gravity and the bones/mesh will go along with it.
- It is important to note that there is no parent/child relationship between rigid bodies like there are for bones. To make sure that rigid bodies will stay togehter, you need to create 'joints' between the rigid bodies.
- Joints are for connecting each 'physics-based' rigid body to EACH OTHER. You connect each rigid body to eachother via joints, and finally the tail stem is attached via a joint to a "non-moving" 'collision-based' rigid body, so that it will stick to the body.
- Joints are for connecting each 'physics-based' rigid body to OTHER rigid bodies. You connect each rigid bodies on the tail to eachother via joints, and finally the tail stem is attached via a joint to a "non-moving" 'collision-based' rigid body, so that it will stick to the body.
- Bear in mind, the rigid bodies connected by joints don't NEED to be physically attached, you can think of joints like 'pins', it will pin something to an object to make sure it doesn't go flying away, but it doesn't need to be necesessarily physically touching.
- You have to tune the parameters on the rigid bodies and joints individually to make sure that when physics are applied, that it will bend and move according to how it would in real life.

Once you add rigid bodies and joints to your model, the physics will work properly.
Expand All @@ -18,12 +19,12 @@ Once you add rigid bodies and joints to your model, the physics will work proper
- There are two types of rigid bodies: "collision-based" rigid bodies and "physics-based" rigid bodies
- "Collison-based" rigid bodies are used for making sure that physics-based based rigid bodies don't pass through them
- Pretty much the human skeleton will be all collision-based rigid bodies, where as hair, skirts, breasts, tails will be physics-based.
- For the human skeletion, there is usually a 1:1 bone to rigid body mapping. However, there are some places on the human body where one rigid body isn't enough.
- For example, the upper body bone usually has 2 or more rigid bodies attached to it. This is because the shape of one rigid body Isn't enough to cover the entire mesh
- For the human skeletion on your model, there is usually a 1:1 bone to rigid body mapping. The wrist/palm might be included fingers are usually excluded because they're a pain and usually not important to put in the time to attach rigid bodies and all the issues that come with it. However, there are some places on the human body where one rigid body isn't enough.
- For example, the upper body bone usually has 2 or more rigid bodies attached to it. This is because the shape of one rigid body Isn't enough to cover the entire mesh to the front of the chest to the back... At least not without repoisitioning the one rigid body a lot.
- "Physics-based" rigid bodies contain properties that are important for gravity:
- When it comes to gravity, you want some rigid bodies on a rigid body 'chain' to be heavier than others:
- You'd want the bottom of the skirt to be heavier than the top of the skirt (to make sure it retains it's form and doesn't go floating out to space)
- You'd want the top of hair to be heavier than the bottom of the hair (to make sure that hair 'whips' around realistically)
- When it comes to gravity, if you have a physics-based rigid bodies 'chain' (such as on a tail), you'll usually have somebe heavier than others:
- For example, You'd want the bottom of the skirt to be heavier than the top of the skirt (to make sure it retains it's form and doesn't go floating out into your character's face)
- You'd want the top of hair to be heavier than the bottom of the hair (sp?) (to make sure that hair 'whips' around realistically)
- Rigid Bodies can be sorted into groups (namely, groups 0 to 15). When assigned to a group, you can create apply group 'masks' to a rigid body, so that when a rigid body collides, it can ignore the collision and pass right through it. This is especially useful when you want SOME rigid bodies to collide, but some you do not. For example, let's say you have a character with two long ponytails on each side of the head. The skeleton is assigned to Group 0, the left ponytail chain is assigned to to Group 5 and the right ponytail chain is assigned to Group 6. Both ponytails need to collide with the skeleton, however it looks weird if they collide with eachother. Therefore on the rigid bodies in group 5, you tell them to ignore Group 6 (via using the masking option) and likewise for Group 6, you tell them to ignore group 5. This will make the pigtails to pass through eachother, however they will still both collide with the skeleton.

![image](https://user-images.githubusercontent.com/19479648/215564617-88770c4d-b195-45d5-8a18-4e0f0e3b947f.png)
Expand All @@ -35,7 +36,7 @@ Once you add rigid bodies and joints to your model, the physics will work proper
# Joints
- Joints need to be added to rigid bodies with physics such as hair, skirts and tails. They attach the rigid bodies to eachother so that they don't just 'fall off' and hit the floor.
- Joints are used to attach "physics-based" rigid bodies together, as well as to pin it to a "collision-based" rigid body so it doesn't fall off your model (such as hair, tails, skirts, breasts and earrings).
- Joints control physics "sway" such as how far the rigid body is allowed to bend.
- Joints control physics "sway" such as how far the rigid body is allowed to bend or elasticity (such as how far two rigid bodies are allowed to stretch away from eachother before getting pulled back like a spring.
- Tails (if you'd want to be very stiff) so you'd limit them to +/- 5 degrees or so in all directions (so x,y,z) would apply the same amount.
- Skirts (if you'd want to be very loose) so you'd allow them to bend +/- 100 degrees possibly. X,Y amd Z depends on which direction you'd want them to go in (they should all be different).
- Hair is somewhere in-between the two.
Expand Down

0 comments on commit 9412a65

Please sign in to comment.