GithubHelp home page GithubHelp logo

mmd-for-unity's People

Contributors

grgsiberia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mmd-for-unity's Issues

Position curves not imported for bones needing them (this breaks IK)

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.

SerializableなConfigが環境によって読み込めないことに関して

概要

PMD Loader等の設定を保存するためのConfigクラスがあります.
ConfigクラスはSerializable指定されているため,クラスインスタンスを直接ファイルに保存出来るだけでなく,読み込んだファイルを直接クラスに変換することができます.

バグ

このConfigクラスですが,一部の環境(確認できたのはUnity 4.1)で読み込もうとした時にNULLが返されることを確認しています.Configクラスは各所で利用されているため,PMD Loader等がダウンすることによって,MMD Loaderそのものが利用不可能となっています.

対策

対症療法的ではありますが, #14 にてNULLが返っていれば強制的に新規にConfigクラスを作成することで対応しています.パスは正確で保存された場所も間違ってはいないと思うのですが,いかんせん原因が不明なので問題の処理をスルーしています.

Unity 4.5: Error CS0117

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'

CustomEditor(typeof(Object)) を使用することの欠点

Assetとして配布する場合、CustomEditor(typeof(Object)) の使用はできるだけ控えたほうが良いと思います。
他のAssetでもCustomEditor(typeof(Object)) を使用している場合、動作しなくなってしまうからです。

かと言って他に良い方法もないのですが...

以下は書き記していたものをそのまま貼り付けています


CustomEditor(typeof(Object)) を使用することの欠点

小さなプロジェクトでは問題ないかもしれませんが
「Unityがサポートしていない形式のアセットは全てUnityEngine.Objectとして扱われる」
という制約によって時には解決が難しい可能性があります
もうお気付きかもしれませんが他のスクリプトファイルでCustomEditor(typeof(Object))を使用している場合、どちらか一方のCustomEditorのみ使用されます
もしかすると(あってほしくないですが...)AssetStoreで購入したものに含まれていては回避しようがありません

動的にObject(ScriptableObject)を作成する

苦肉の策として、ScriptableObjectを動的に作成し、CustomEditorを使用する方法があります
Zipファイルを例としてみます

  • 必要なスクリプトファイル
    • ZipScriptableObject
    • ZipInspector

今回は簡潔に済ますため、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();
                }
            }
        };
    }

ZipScriptableObject

using UnityEngine;

public class ZipScriptableObject : ScriptableObject
{
    public string assetPath;
}

ZipInspector

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));
            }
        }
    }
}

動的にObject(ScriptableObject)を作成することの欠点

一番の欠点は、Selectionの対象を変更しているため、本来のアセットの選択状態が解除されてしまうことです
そこに目をつむることが出来るのであれば一番の解決策となります

Drag in, so what?

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.

toggle "use mecanim" to create avatar cause execption

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)

some issues...

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.

mecanim not woking correctly

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.

the wrong material

if use the MMDShader to convert the pmd files will get a wrong about materials

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.