Exemplo n.º 1
0
    void LoadMotion()
    {
        string file_path = AssetDatabase.GetAssetPath(vmdFile);

        MMD.MotionAgent motion_agent = new MMD.MotionAgent(file_path);
        motion_agent.CreateAnimationClip(pmdPrefab, createAnimationFile, interpolationQuality);
    }
Exemplo n.º 2
0
	void LoadMotion() {
		string file_path = AssetDatabase.GetAssetPath(vmdFile);
		MMD.MotionAgent motion_agent = new MMD.MotionAgent(file_path);
		motion_agent.CreateAnimationClip(pmdPrefab
										, vmd_config.createAnimationFile
										, vmd_config.interpolationQuality
										);
	}
Exemplo n.º 3
0
        /// <summary>
        /// Inspector上のGUI描画処理を行います
        /// </summary>
        public override void OnInspectorGUI()
        {
            // GUIの有効化
            GUI.enabled = !EditorApplication.isPlaying;

            pmdPrefab = (GameObject)EditorGUILayout.ObjectField("PMD Prefab", pmdPrefab, typeof(Object), false);
            vmd_config.OnGUIFunction();

            // Convertボタン
            EditorGUILayout.Space();
            if (message.Length != 0)
            {
                GUILayout.Label(message);
            }
            else
            {
                bool gui_enabled_old = GUI.enabled;
                GUI.enabled = (null != pmdPrefab);
                if (GUILayout.Button("Convert"))
                {
                    if (null == motion_agent)
                    {
                        var obj = (VMDScriptableObject)target;
                        motion_agent = new MotionAgent(obj.assetPath);
                    }
                    motion_agent.CreateAnimationClip(pmdPrefab
                                                     , vmd_config.createAnimationFile
                                                     , vmd_config.interpolationQuality
                                                     );
                    message = "Loading done.";
                }
                GUI.enabled = gui_enabled_old;
            }
            GUILayout.Space(40);

            // モデル情報
            if (motion_agent == null)
            {
                return;
            }
            EditorGUILayout.LabelField("Model Name");
            EditorGUILayout.LabelField(motion_agent.model_name, EditorStyles.textField);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Inspector上のGUI描画処理を行います
        /// </summary>
        public override void OnInspectorGUI()
        {
            setup();

            // GUIの有効化
            GUI.enabled = true;

            pmdPrefab            = EditorGUILayout.ObjectField("PMD Prefab", pmdPrefab, typeof(Object), false) as GameObject;
            createAnimationFile  = EditorGUILayout.Toggle("Create Asset", createAnimationFile);
            interpolationQuality = EditorGUILayout.IntSlider("Interpolation Quality", interpolationQuality, 1, 10);

            // Convertボタン
            EditorGUILayout.Space();
            if (message.Length != 0)
            {
                GUILayout.Label(message);
            }
            else
            {
                if (GUILayout.Button("Convert"))
                {
                    if (null == motion_agent)
                    {
                        var obj = (VMDScriptableObject)target;
                        motion_agent = new MotionAgent(obj.assetPath);
                    }
                    motion_agent.CreateAnimationClip(pmdPrefab, createAnimationFile, interpolationQuality);
                    message = "Loading done.";
                }
            }
            GUILayout.Space(40);

            // モデル情報
            if (motion_agent == null)
            {
                return;
            }
            EditorGUILayout.LabelField("Model Name");
            GUI.enabled = false;
            EditorGUILayout.TextArea(motion_agent.model_name);
            GUI.enabled = true;
        }