mmd-for-unity-proj / mmd-for-unity Goto Github PK
View Code? Open in Web Editor NEWMikuMikuDance for Unity
License: BSD 3-Clause "New" or "Revised" License
MikuMikuDance for Unity
License: BSD 3-Clause "New" or "Revised" License
Please update the code for the Unity 5.
IK bones and even the origin needs position curves to function correctly. I was trying to add this into the script myself, but it already exists!? In the script VMDConverter.cs on line 531 this functionality is commented out, but it does exist, and it works in my testing at least.
1.pmd import,unreadable name nodes(maybe text format convet error?)
2.pmx import, some model ok but some other NOT.
3.vmd import, it seems like leg or foot error....
And I wanna say, it's nice work, I hope that it could be a bridge between MMD and GameDeveloper in unity.
I've tried to drag in the whole project as what the tutorial said, but nothing happened. Nowhere changed. What should I do next? I am using Unity 2020.3.16f1c1.
like this you would not have to update it for each version of unity, just a simple conversion to a usable format for unity instead of a plugin
it would be easier because me for example i can't use it on my unity version
hi,firstly i would like to say you are doing a great job, i really appreciate your works for this.
now i check the "use Mecanim" in the PMD loader plugin , then i loaded a model with avatar, then i use a animator controller with idle animation to animate this model, there the problem is , animation of this model is not animating correctly. The hands of model is raising up , but in fact the hands should be laid down.
hope you can check this problem,thanks a lot.
if use the MMDShader to convert the pmd files will get a wrong about materials
So it seems like converting:
Avatar Mech aim fails.
Avatar Legacy animation also fails.
Is there a reference file type maybe some of the decoding has failed.
@GRGSIBERIA where do I find the file format for mmd ?
here are some failing MMD models.
https://www.dropbox.com/s/pktajlpnrhco5e9/Ganyu%20model.zip?dl=0
This might have already been fixed, but I'm just going to post it here just in case.
So I have an error when I imported the files into my Assets on Unity 4.5.
Assets/mmd-for-unity-proj-mmd-for-unity-de6d097/Editor/MMDLoader/Private/VMDConverter.cs(556,42): error CS0117: UnityEditor.AnimationUtility' does not contain a definition forSetAnimationType'
need update on 5.6
Assetとして配布する場合、CustomEditor(typeof(Object)) の使用はできるだけ控えたほうが良いと思います。
他のAssetでもCustomEditor(typeof(Object)) を使用している場合、動作しなくなってしまうからです。
かと言って他に良い方法もないのですが...
以下は書き記していたものをそのまま貼り付けています
小さなプロジェクトでは問題ないかもしれませんが
「Unityがサポートしていない形式のアセットは全てUnityEngine.Objectとして扱われる」
という制約によって時には解決が難しい可能性があります
もうお気付きかもしれませんが他のスクリプトファイルでCustomEditor(typeof(Object))を使用している場合、どちらか一方のCustomEditorのみ使用されます
もしかすると(あってほしくないですが...)AssetStoreで購入したものに含まれていては回避しようがありません
苦肉の策として、ScriptableObjectを動的に作成し、CustomEditorを使用する方法があります
Zipファイルを例としてみます
今回は簡潔に済ますため、EditorApplication.updateでSelectionオブジェクトの拡張子をチェックして処理を行う方法をとっています
[DidReloadScripts]
static void OnDidReloadScripts()
{
EditorApplication.update += () =>
{
if (Selection.objects.Length != 0)
{
string assetPath = AssetDatabase.GetAssetPath(Selection.activeObject);
string extension = Path.GetExtension(assetPath);
if (extension == ".zip")
{
int count = Selection.objects.OfType<ZipScriptableObject>().Count();
if (count != 0) return;
ZipScriptableObject zipScriptableObject = ScriptableObject.CreateInstance<ZipScriptableObject>();
// CustomEditorでアセットを取得するためにアセットのパスを保持する
zipScriptableObject.assetPath = assetPath;
//選択しているオブジェクトをZipScriptableObjectに切り替える
Selection.activeObject = zipScriptableObject;
EditorUtility.UnloadUnusedAssets();
}
}
};
}
using UnityEngine;
public class ZipScriptableObject : ScriptableObject
{
public string assetPath;
}
using System.IO;
using Ionic.Zip;
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(ZipScriptableObject))]
public class ZipInspector : Editor
{
ZipFile zip;
string GetCurrentDirectory(string path)
{
return new DirectoryInfo(path).Name;
}
void OnEnable()
{
ReadHierarchy();
}
void ReadHierarchy()
{
ZipScriptableObject zipScriptableObject = (ZipScriptableObject)target;
zip = ZipFile.Read(zipScriptableObject.assetPath);
}
public override void OnInspectorGUI()
{
EditorGUIUtility.SetIconSize(Vector2.one * 16);
if (zip == null)
return;
Draw();
}
void Draw()
{
EditorGUILayout.LabelField(GetCurrentDirectory(zip.Name));
foreach (var entry in zip)
{
EditorGUI.indentLevel = entry.FileName.Split(Path.DirectorySeparatorChar).Length;
if (entry.IsDirectory)
{
EditorGUILayout.LabelField(GetCurrentDirectory(entry.FileName));
}
else
{
EditorGUI.indentLevel++;
EditorGUILayout.LabelField(Path.GetFileName(entry.FileName));
}
}
}
}
一番の欠点は、Selectionの対象を変更しているため、本来のアセットの選択状態が解除されてしまうことです
そこに目をつむることが出来るのであれば一番の解決策となります
PMD Loader等の設定を保存するためのConfigクラスがあります.
ConfigクラスはSerializable指定されているため,クラスインスタンスを直接ファイルに保存出来るだけでなく,読み込んだファイルを直接クラスに変換することができます.
このConfigクラスですが,一部の環境(確認できたのはUnity 4.1)で読み込もうとした時にNULLが返されることを確認しています.Configクラスは各所で利用されているため,PMD Loader等がダウンすることによって,MMD Loaderそのものが利用不可能となっています.
対症療法的ではありますが, #14 にてNULLが返っていれば強制的に新規にConfigクラスを作成することで対応しています.パスは正確で保存された場所も間違ってはいないと思うのですが,いかんせん原因が不明なので問題の処理をスルーしています.
Hi,
I tried the latest version of this plugin, and check the toggle "use mecanim", got the exception below:
AvatarBuilder 'Len Blue Moon': Hips bone parent 'Len Blue Moon' must be included in the HumanDescription Skeleton
UnityEngine.AvatarBuilder:BuildHumanAvatar(GameObject, HumanDescription)
AvatarSettingScript:SettingAvatar() (at Assets/Editor/MMDLoader/Private/AvatarSettingScript.cs:54)
'Len Blue Moon' is the pmd file name, I also have tried some other pmd models got the same problem.
I am using Unity 4.3 (by changing the marco "UNITY_4_2"in the scripts to "UNITY_4_2||UNITY_4_3" to make this plugin work in Unity4.3)
Needs an update for Unity 5.4. Thanks in advance!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.