HOME | DD

bobbeebs — MMD Blender Tutorial Addendum

#blender #mmd
Published: 2014-10-12 22:11:40 +0000 UTC; Views: 26412; Favourites: 129; Downloads: 208
Redirect to original
Description UPDATE August 2015:  You might find it useful to use my blender setup I have here www.mediafire.com/download/3hj…
It has the two blender scripts already installed.   You might still have to have python installed.  Also you might have to right-click on the file and then choose properties.  Unblock then apply before extracting the file.
You will have to enable scripts in user preferences.





It has been about a year so I thought I'd address some issues that others have had when trying to use my tutorials.  These problems mostly deal with importing and exporting.

I've managed to successfully use up to blender version 2.69 with the scripts.  Blender 2.7 and above seem to give errors with importing and exporting.

If you are having problems with pymeshio, then there is another script you can use.  Head on over to onedrive.live.com/?cid=CE4C74E… and download mmd_script_263.  I use that script mostly now for importing and seems to work well.  Still use pymeshio to export, however.

Sometimes a script won't work because its original archive has been blocked by windows.  To fix this, right-click on the archive(rar or zip).  On the General tab you may see Security and Unblock towards the bottom.  Choose to unblock.   This tells windows that the archive is trusted and allows its scripting functionality to be extracted intact.

If the model is in pmx format, then try to import and export with pmx.  The reason is that some pmx models have vertices with weights attached to three or more bones.  Pmd can only do two.

Lastly is an issue I've encountered many times.  You import a model and spend hours on it.  When you go to export it then you get an error or the model no longer has any bones.  Terribly frustrating.  What I do now is first I import the model.  Delete loose vertices and remove doubles like I mentioned in a previous tutorial.  Then I export it to make sure that it works without issue.

Hope these tips help those who may be having trouble.  Good luck.
Related content
Comments: 67

FallenNights [2016-11-22 02:14:17 +0000 UTC]

Okay Exporting as PMX gives me an Error

And I don't fucking know what Python is and there's no download for it so 

like help please

👍: 0 ⏩: 1

wakabayashi12 In reply to FallenNights [2017-07-03 13:57:52 +0000 UTC]

Hello i have same prolem, any luck finding a solution? thx

👍: 0 ⏩: 0

Hogarth-MMD [2016-08-25 13:28:25 +0000 UTC]

MMD models in Blender

Here are some links to help people get started with importing, exporting, editing, converting or animating MMD models in Blender.

👍: 0 ⏩: 0

Dekpi [2016-05-13 21:31:04 +0000 UTC]

I have an issue with pymeshio exporting
I've rigged facials using shape keys, but blender wont export it into pmd with them. It gives a long error message and duplicates the object for some reason afterwards. 

👍: 0 ⏩: 1

JosephineWalter In reply to Dekpi [2016-07-11 22:58:50 +0000 UTC]

Me too..

👍: 0 ⏩: 1

Hogarth-MMD In reply to JosephineWalter [2016-07-16 15:15:28 +0000 UTC]

You need to upload the .blend file if you want help with this.

👍: 0 ⏩: 1

Hogarth-MMD In reply to Hogarth-MMD [2016-07-17 06:50:53 +0000 UTC]

It is possible to copy and paste an error message from the Blender system console. Uploading the .blend file is much better if you want technical support, though. To view the Blender system console, click Window, Toggle System Console.

👍: 0 ⏩: 0

UnAmericanOtaku [2016-02-19 20:54:46 +0000 UTC]

The Pymeshio program says it can read VPD files but I have been completely unable to find any import option that lets me view a VPD file to even select. Keep in mind I am using the plugin version instead of the command-line/python version...Am I missing something?

👍: 0 ⏩: 1

Hogarth-MMD In reply to UnAmericanOtaku [2016-03-09 03:27:56 +0000 UTC]

Pymeshio does not import .vpd files. MMD tools does import .vmd files. I assume that .vpd can be easily converted to .vmd in MMD before importing it.

MMD tools releases:
github.com/sugiany/blender_mmd…

MMD tools experimental version:
github.com/sugiany/blender_mmd…

👍: 0 ⏩: 0

Hogarth-MMD [2016-01-21 12:26:21 +0000 UTC]

I found another pymeshio bug. If a pmx model has more than a maximum of 20 bone groups (display panel groups numbered 0 to 19 in PMD editor), the model can't be imported into Blender and Blender gives you an error message..

👍: 0 ⏩: 1

bobbeebs In reply to Hogarth-MMD [2016-01-23 04:06:51 +0000 UTC]

Ah.  I never have run into that bug.  I always import only the part of the mesh I am working on and remove bones not weighted to that mesh.  Usually that results in less errors.  But not always.

👍: 0 ⏩: 1

Hogarth-MMD In reply to bobbeebs [2016-08-06 23:00:03 +0000 UTC]

And the same error happens with importing a pmd model.

👍: 0 ⏩: 1

Hogarth-MMD In reply to Hogarth-MMD [2016-08-09 12:19:55 +0000 UTC]

This is the error message which results from trying to import a model which has more than 20 display panel groups:

\bl.py", line 260, in createBoneGroup    g.color_set=color_set
TypeError: bpy_struct: item.attr = val: enum "THEME21" not found in ('DEFAULT','THEME01', 'THEME02', 'THEME03', 'THEME04', 'THEME05', 'THEME06', 'THEME07', 'THEME08', 'THEME09', 'THEME10', 'THEME11', 'THEME12', 'THEME13', 'THEME14', 'THEME15', 'THEME16', 'THEME17', 'T)

location: :-1

👍: 0 ⏩: 0

bobbeebs [2015-11-02 20:23:20 +0000 UTC]

Morphs should be imported.  In Blender they are called shape keys.

As for only bones showing up, thats an error that sometimes happens.  You can try to use the new pymeshio script.  You can try leaving all the bones from the model before importing.  Or, if you are already doing that, you can try to delete the bones you don't need.  In other words, the bones that are not weighted to the mesh you are working on.

👍: 0 ⏩: 0

AmineIzumi [2015-11-01 23:43:16 +0000 UTC]

So sad that the materials morph aren't imported :/

👍: 0 ⏩: 0

kobalt2016 [2015-10-31 05:56:03 +0000 UTC]

im having the opposite issue, when i imported the .pmx it only showed the bones and not the model. any help for that?

👍: 0 ⏩: 0

Hogarth-MMD [2015-07-02 12:24:16 +0000 UTC]

pypi.python.org/pypi/pymeshio/

Pymeshio 2.7.13 has 2 bug fixes: The 'unknown deform' error bug is now fixed for importing a pmx model into Blender. And now you can import a pmx model into Blender even if it has advanced morph types(UV morph, bone pose morph, material morph, group morph). All of the data of these morphs is dropped though. The morphs themselves. are not imported into Blender. The csv method of model editing can be used as a workaround to save and then re-open them in PMD editor. Tutorial here:
trackdancer.deviantart.com/art…

👍: 0 ⏩: 1

bobbeebs In reply to Hogarth-MMD [2015-07-02 20:59:00 +0000 UTC]

Cool.  I'll check it out.

👍: 0 ⏩: 0

Alpha-Raptor [2015-06-24 20:37:58 +0000 UTC]

This is very nice, helps alot

👍: 0 ⏩: 0

JaegertheDragon [2015-06-17 00:54:41 +0000 UTC]

Do the bones from a Blender model export to a pmd?

👍: 0 ⏩: 1

bobbeebs In reply to JaegertheDragon [2015-06-18 00:48:51 +0000 UTC]

They should.  You would have to rename them, however, to the proper japanese names.

👍: 0 ⏩: 1

Hogarth-MMD In reply to bobbeebs [2015-06-19 12:57:36 +0000 UTC]

It's possible. It depends partly on what you mean by "a Blender model". A model rigged with rigify has 662 bones and lots of constraints. Converting it to .pmd is a non-trivial task. If you want to be able to animate it with .vmd animations, renaming to Japanese bone names is essential. Armatures from other software usually have 3 torso bones, but MMD standard models have only 2 torso bones and there may be other differences also.

👍: 0 ⏩: 1

Hogarth-MMD In reply to Hogarth-MMD [2015-06-19 13:04:22 +0000 UTC]

Adding leg IK and physics are also non-trivial tasks. Texture image names may also be a problem. The .pmd file format allows the name of a texture image to be a maximum of 19 characters. And the .tif file format is not compatible with MMD models.

👍: 0 ⏩: 1

Hogarth-MMD In reply to Hogarth-MMD [2015-07-02 12:17:16 +0000 UTC]

All bones need to be part of a bone group before you try to export the model from Blender. In PMD editor, that is the equivalent of adding bones to a display panel group.

👍: 0 ⏩: 0

Hogarth-MMD [2015-06-05 04:44:39 +0000 UTC]

Download Pymeshio 2.7.11 with 2 bug fixes. I helped with both bug fixes. (Type '0' shape key export bug is now fixed. Mother bone export and some other bone export issues ousttrue made a bug fix for ):
pypi.python.org/pypi/pymeshio/

I have been bug reporting, bug fix submitting, and commenting up a storm in pymeshio issues on Github. Hopefully soon all of pymeshio's worst bugs will be fixed:
github.com/ousttrue/pymeshio/i…

👍: 0 ⏩: 1

bobbeebs In reply to Hogarth-MMD [2015-06-06 02:07:07 +0000 UTC]

Cool.  Keep up the good work.

👍: 0 ⏩: 0

Hogarth-MMD [2015-06-02 08:13:18 +0000 UTC]

I found this excellent tutorial about PMX model error checking:

PMX Validation: Every modeler should know and do

permayuyuko.deviantart.com/jou…

👍: 0 ⏩: 1

bobbeebs In reply to Hogarth-MMD [2015-06-04 21:25:19 +0000 UTC]

Good find.

👍: 0 ⏩: 0

Hogarth-MMD [2015-05-04 00:25:41 +0000 UTC]

If people want help with pymeshio, they should really give a link to the
model that they are trying to import, or upload the .blend file that
they are trying to export a model from. Otherwise it is usually very difficult to
help.

👍: 0 ⏩: 1

gwarp In reply to Hogarth-MMD [2015-05-15 22:43:34 +0000 UTC]

www.mediafire.com/download/ez5…

I prepared my model by the name Aoba-body-blender.Pmx, imported to blender as aoba.blend. After editing, exported as Aoba-body-blender2.Pmx, no error was given.

👍: 0 ⏩: 1

Hogarth-MMD In reply to gwarp [2015-05-16 09:26:53 +0000 UTC]

The problem is caused by a pymeshio bug ("unknown deform error"). The best workaround seems to be to convert the model to a .pmd file using Japanese pmd editor before you import it into Blender. Pymeshio usually works better with .pmd models.

👍: 0 ⏩: 2

gwarp In reply to Hogarth-MMD [2015-05-28 18:04:23 +0000 UTC]

Thanks!!!

👍: 0 ⏩: 0

Hogarth-MMD In reply to Hogarth-MMD [2015-05-17 13:22:39 +0000 UTC]

In PMD editor error checking for this model you find this error message:

SDEF vertex fraud bone reference number:! 355 | ... × Bad SDEF related fixes (or BDEF2 reduction) is required.

I think that this error message may mean that 355 vertices of this model are rigged and weighted in a way which is not compatible with the .pmx file format. And that is why pymeshio won't import it into Blender.

The .pmx file format allows you to rig and weight a vertex in only 1 of 4 possible ways:
BDEF1 - weighted to one bone
BDEF2 - weighted to two bones
BDEF4 - weighted to four bones
SDEF - weighted to two bones with a spherical constraint

👍: 0 ⏩: 1

Hogarth-MMD In reply to Hogarth-MMD [2015-06-01 18:28:09 +0000 UTC]

Here is my best theory of why this problem is happening:

The person who made this model is saving this model to .pmx from Metasequoia, using a script which has a major bug. The problem is in the .pmx model itself. The problem is not caused by a pymeshio bug or by a mistake that you are making. Unfortunately I don't know how to fix this problem. The best that you can do is run model error checking in PMD editor. If that error message appears, then you cannot import that model into Blemder with pymeshio and you need to work with a different model.

👍: 0 ⏩: 1

Hogarth-MMD In reply to Hogarth-MMD [2015-06-01 22:00:24 +0000 UTC]

You can do this in PMD editor:

Edit(E), Vertex(V), The BDEF2 of (D) a bad SDEF vertex

After doing that, if I run model error checking in PMD editor, the error message is gone. But then, when I try to import the model into Blender with pymeshio, I still get "unknown deform error". This problem seems to happen with SDEF vertices. A .pmx model which has no SDEF vertices does not have this problem importing into Blender.

👍: 0 ⏩: 1

Hogarth-MMD In reply to Hogarth-MMD [2015-06-02 20:41:17 +0000 UTC]

I have found a workaround for the pymeshio "unknown deform" error, based on this tutorial:

tsukichanp.deviantart.com/art/…

 Download the "SDEF select" PMD editor plug-in and copy it into the PMD editor plug-ins folder. Use it to select the SDEF vertices. But instead of resetting the SDEF vertices to SDEF, convert them all to BDEF, which is the option immediately below the option to reset SDEF: "Back to the selection BDEF vertex (B)". Save the model from PMD editor and now it should import into Blender without the "unknown deform" error. Please tell me if you find any flaws in this workaround.

👍: 0 ⏩: 1

Hogarth-MMD In reply to Hogarth-MMD [2015-07-02 12:26:05 +0000 UTC]

The unknown deform error is now fixed in Pymeshio 2.7.13, which makes my workaround obsolete.

👍: 0 ⏩: 0

Hogarth-MMD [2015-05-04 00:21:02 +0000 UTC]

Pymeshio 2.7.10 is available now, with a couple of bug fixes:
pypi.python.org/pypi/pymeshio/

Recently ousttrue has been answering a few pymeshio-related questions and making bug fixes on his GitHub account.
github.com/ousttrue/pymeshio

👍: 0 ⏩: 1

bobbeebs In reply to Hogarth-MMD [2015-05-04 18:41:18 +0000 UTC]

Awesome.  Thanks for the info.  I'll check it out.

👍: 0 ⏩: 0

gwarp [2015-04-22 04:58:04 +0000 UTC]

Hello,

I met a problem on bones, when exporting edited model from blender, the bone will detached from the mesh. What can I do about it?

👍: 0 ⏩: 3

Hogarth-MMD In reply to gwarp [2015-05-05 19:08:44 +0000 UTC]

 When you import or export a .pmd model with pymeshio, the bones are automatically renamed according to the English and Japanese bone names which are listed in englishmap.py. But when you import or export a .pmx model with pymeshio, there is no renaming of bones. So if you import a .pmd model into Blender with pymeshio, and then try to export it to .pmx from Blender with pymeshio, the model will have English bones names that can't be animated with .vmd files.

👍: 0 ⏩: 0

Hogarth-MMD In reply to gwarp [2015-05-05 16:28:25 +0000 UTC]

 In Blender and MMD a bone moves a vertex group which has exactly the same name as the bone. Maybe the names of the bones and vertex groups are mismatched. PMD editor has a utility that gives you a listing of all of a model's errors. My 2nd comment on this page gives more info about model error checking.

👍: 0 ⏩: 0

bobbeebs In reply to gwarp [2015-04-26 22:59:44 +0000 UTC]

You have to import the edited model back into the original using pmxeditor.  The bones will then regain their attachments.

👍: 0 ⏩: 1

gwarp In reply to bobbeebs [2015-04-27 11:25:51 +0000 UTC]

I did the same thing, but it didn't work.

After I done editing in Blender, I exported to a new .pmx, where bones were already detached. The weigh map is empty.  Like this: postimg.org/image/6of6lxpsn/

When I import the edited pmx (no bone attached) to the original one, the bones do not regain their properties. I tried deleting the mesh will be placed before importing; or not delete them, either way it just not working.

👍: 0 ⏩: 1

bobbeebs In reply to gwarp [2015-05-03 20:26:18 +0000 UTC]

Hmm.  Looks like an exporting error.

👍: 0 ⏩: 0

Hogarth-MMD [2015-02-10 07:21:56 +0000 UTC]

Helpful tutorial: PMD and PMX model editing with CSV files:
trackdancer.deviantart.com/art…
 
Editing a model with .csv files in PMD editor (in PMX mode) can be used as a workaround for these 2 Pymeshio defects:
1. At the present time (Pymeshio 2.7.8), export of physics bodies(rigid bodies and joints/constraints) has NOT yet been implemented.
2. Pymeshio 2.7.8 does not yet import any of the types of advanced morphs that you may find in a .pmx model (UV morphs, material morphs, bone pose morphs, group morphs). You may get an error message when you try to import a .pmx model which has an advanced morph type.

👍: 0 ⏩: 0

Hogarth-MMD [2015-02-10 07:19:15 +0000 UTC]

I found amother Pymeshio .pmx shape key export bug:
In Blender, the armature of your model needs to have a bone group named:
表情
Otherwise the Pymeshio-exported .pmx model won't have a display panel which lists its morphs, and MikuMikuDance will crash when you load the .pmx model into it.

👍: 0 ⏩: 0

Hogarth-MMD [2015-02-03 20:40:08 +0000 UTC]

Blender uses spherical gradient textures for mapping onto reflection (or normal) co-ordinates. You can convert the vertical gradient of a toon texture to a spherical gradient using the polar co-ordinates filter in GIMP or Photoshop. After importing the texture in Blender, change the X and Y sizes of the texture to 0.5. (Use the multiply blend mode.)

👍: 0 ⏩: 1

bobbeebs In reply to Hogarth-MMD [2015-02-05 04:18:13 +0000 UTC]

Cool.  Good info.

👍: 0 ⏩: 0

Hogarth-MMD [2015-02-03 20:34:23 +0000 UTC]

Here is a quick and easy bug fix for exporting to .pmd files with pymeshio:

In export_pmd.py find line 216

v=[m.name, m.name, 0]

Change the 0 to 4

v=[m.name, m.name, 4]

Now all shape keys whose names are not listed in englishmap.py will be
exported in the Other category (instead of being exported in the
non-existent 'type 0' category)

There is a similar easy bug fix for exporting to a .pmx file with pymeshio.

In export_pmx.py, find line 298

change panel=0 to panel=4

👍: 0 ⏩: 0


| Next =>