mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-07 19:38:13 -05:00
editor, sample
This commit is contained in:
@@ -133,12 +133,12 @@ namespace UniGLTF
|
||||
var property = AnimationExporter.PropertyToTarget(binding.propertyName);
|
||||
if (property == glTFAnimationTarget.AnimationProperties.NotImplemented)
|
||||
{
|
||||
Debug.LogWarning("Not Implemented keyframe property : " + binding.propertyName);
|
||||
UniGLTFLogger.Warning("Not Implemented keyframe property : " + binding.propertyName);
|
||||
continue;
|
||||
}
|
||||
if (property == glTFAnimationTarget.AnimationProperties.EulerRotation)
|
||||
{
|
||||
Debug.LogWarning("Interpolation setting of AnimationClip should be Quaternion");
|
||||
UniGLTFLogger.Warning("Interpolation setting of AnimationClip should be Quaternion");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace UniGLTF
|
||||
//
|
||||
if (path.StartsWithUnityAssetPath())
|
||||
{
|
||||
Debug.LogWarningFormat("disallow import from folder under the Assets");
|
||||
UniGLTFLogger.Warning("disallow import from folder under the Assets");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ namespace UniGLTF.MeshUtility
|
||||
catch (Exception ex)
|
||||
{
|
||||
#if DEBUG
|
||||
Debug.LogException(ex, context.Instance);
|
||||
UniGLTFLogger.Exception(ex, context.Instance);
|
||||
context.Keep = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -54,14 +54,14 @@ namespace UniGLTF
|
||||
_tmpStackTraceLogType = Application.GetStackTraceLogType(LogType.Log);
|
||||
Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None);
|
||||
|
||||
Debug.Log($"{LogPrefix}Edit Mode Tests Started.");
|
||||
UniGLTFLogger.Log($"{LogPrefix}Edit Mode Tests Started.");
|
||||
}
|
||||
|
||||
public void RunFinished(ITestResultAdaptor result)
|
||||
{
|
||||
Debug.Log($"{LogPrefix}Edit Mode Tests Finished.");
|
||||
Debug.Log($"{LogPrefix}Passed: {result.PassCount}, Skipped: {result.SkipCount}, Failed: {result.FailCount}");
|
||||
Debug.Log($"{ResultLogPrefix}{result.FailCount}");
|
||||
UniGLTFLogger.Log($"{LogPrefix}Edit Mode Tests Finished.");
|
||||
UniGLTFLogger.Log($"{LogPrefix}Passed: {result.PassCount}, Skipped: {result.SkipCount}, Failed: {result.FailCount}");
|
||||
UniGLTFLogger.Log($"{ResultLogPrefix}{result.FailCount}");
|
||||
|
||||
Application.SetStackTraceLogType(LogType.Log, _tmpStackTraceLogType);
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace UniGLTF
|
||||
{
|
||||
if (!string.IsNullOrEmpty(_xmlFilePath))
|
||||
{
|
||||
Debug.Log($"{LogPrefix}Write NUnit XML to {_xmlFilePath}");
|
||||
UniGLTFLogger.Log($"{LogPrefix}Write NUnit XML to {_xmlFilePath}");
|
||||
var xmlNode = CreateNUnitXmlTree(result);
|
||||
|
||||
using var xmlWriter = new XmlTextWriter(_xmlFilePath, Encoding.UTF8);
|
||||
@@ -92,8 +92,8 @@ namespace UniGLTF
|
||||
|
||||
if (result.TestStatus != TestStatus.Passed)
|
||||
{
|
||||
Debug.Log($"{LogPrefix}{result.Message}");
|
||||
Debug.Log($"{LogPrefix}{result.StackTrace}");
|
||||
UniGLTFLogger.Log($"{LogPrefix}{result.Message}");
|
||||
UniGLTFLogger.Log($"{LogPrefix}{result.StackTrace}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,11 +50,11 @@ namespace UniGLTF
|
||||
{
|
||||
if (Selection.activeObject is GameObject go)
|
||||
{
|
||||
Debug.Log(go.GetPrefabType());
|
||||
UniGLTFLogger.Log($"{go.GetPrefabType()}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log(Selection.activeContext.GetType());
|
||||
UniGLTFLogger.Log($"{Selection.activeContext.GetType()}");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace UniGLTF
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
// Debug.LogWarning(ex);
|
||||
// UniGLTFLogger.LogWarning(ex);
|
||||
}
|
||||
}
|
||||
if (m_root.GameObject == value)
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace UniGLTF
|
||||
else
|
||||
{
|
||||
// throw new Exception($"{key} is not converted.");
|
||||
Debug.LogWarning($"{key} is not converted.");
|
||||
UniGLTFLogger.Warning($"{key} is not converted.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ public static class GltfDeserializer
|
||||
public static void GenerateSerializer()
|
||||
{
|
||||
var info = new ObjectSerialization(typeof(glTF), "gltf", "Deserialize_");
|
||||
Debug.Log(info);
|
||||
UniGLTFLogger.Log($"{info}");
|
||||
|
||||
using (var s = File.Open(OutPath, FileMode.Create))
|
||||
using (var w = new StreamWriter(s, new UTF8Encoding(false)))
|
||||
@@ -52,7 +52,7 @@ public static class GltfDeserializer
|
||||
w.Write(End);
|
||||
}
|
||||
|
||||
Debug.LogFormat("write: {0}", OutPath);
|
||||
UniGLTFLogger.Log($"write: {OutPath}");
|
||||
UnityPath.FromFullpath(OutPath).ImportAsset();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace UniGLTF {
|
||||
public static void GenerateSerializer()
|
||||
{
|
||||
var info = new ObjectSerialization(typeof(glTF), "gltf", "Serialize_");
|
||||
Debug.Log(info);
|
||||
UniGLTFLogger.Log($"{info}");
|
||||
|
||||
using (var s = File.Open(OutPath, FileMode.Create))
|
||||
using (var w = new StreamWriter(s, new UTF8Encoding(false)))
|
||||
@@ -52,7 +52,7 @@ namespace UniGLTF {
|
||||
w.Write(End);
|
||||
}
|
||||
|
||||
Debug.LogFormat("write: {0}", OutPath);
|
||||
UniGLTFLogger.Log($"write: {OutPath}");
|
||||
UnityPath.FromFullpath(OutPath).ImportAsset();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UniGLTF;
|
||||
|
||||
|
||||
namespace UniHumanoid
|
||||
@@ -122,7 +123,7 @@ animator.GetBoneTransform(x.Head), animator.GetBoneTransform(x.Tail)))
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("fail to CreateAvatar");
|
||||
UniGLTFLogger.Warning("fail to CreateAvatar");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +120,6 @@ namespace UniHumanoid
|
||||
var _target = (HumanPoseTransfer)target;
|
||||
if (_target.PoseClip != old)
|
||||
{
|
||||
//Debug.Log("clip != old");
|
||||
if (_target.PoseClip != null)
|
||||
{
|
||||
var pose = _target.PoseClip.GetPose();
|
||||
@@ -133,7 +132,7 @@ namespace UniHumanoid
|
||||
{
|
||||
if (GUILayout.Button("Apply PoseClip"))
|
||||
{
|
||||
Debug.Log("apply");
|
||||
UniGLTFLogger.Log("apply");
|
||||
var pose = default(HumanPose);
|
||||
_target.PoseClip.GetPose(out pose);
|
||||
_target.SetPose(pose);
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using UniGLTF;
|
||||
|
||||
namespace UniHumanoid
|
||||
{
|
||||
@@ -410,7 +411,7 @@ namespace UniHumanoid
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"cannot create {path}");
|
||||
UniGLTFLogger.Warning($"cannot create {path}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace UniHumanoid
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError(ex);
|
||||
UniGLTFLogger.Exception(ex);
|
||||
context.Destroy(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"name": "GltfViewer",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:da3e51d19d51a544fa14d43fee843098",
|
||||
"GUID:8d76e605759c3f64a957d63ef96ada7c"
|
||||
"GUID:8d76e605759c3f64a957d63ef96ada7c",
|
||||
"GUID:1cd941934d098654fa21a13f28346412"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace UniGLTF.GltfViewer
|
||||
{
|
||||
return;
|
||||
}
|
||||
Debug.Log($"open: {path}");
|
||||
UniGLTFLogger.Log($"open: {path}");
|
||||
|
||||
LoadPathAsync(path);
|
||||
}
|
||||
@@ -46,15 +46,15 @@ namespace UniGLTF.GltfViewer
|
||||
_instance = await GltfUtility.LoadAsync(path.FullPath);
|
||||
if (_instance == null)
|
||||
{
|
||||
Debug.LogWarning("LoadAsync: null");
|
||||
UniGLTFLogger.Warning("LoadAsync: null");
|
||||
return;
|
||||
}
|
||||
Debug.Log($"LoadAsync: {sw.Elapsed}");
|
||||
UniGLTFLogger.Log($"LoadAsync: {sw.Elapsed}");
|
||||
_instance.ShowMeshes();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogException(ex);
|
||||
UniGLTFLogger.Exception(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace UniGLTF.GltfViewer
|
||||
{
|
||||
public static class OpenFileDialog
|
||||
{
|
||||
public static PathObject Show(string title, params string[] extensions)
|
||||
{
|
||||
Debug.Log(typeof(UniGLTFLogger));
|
||||
#if UNITY_STANDALONE_WIN
|
||||
return PathObject.FromFullPath(FileDialogForWindows.FileDialog(title, extensions));
|
||||
#else
|
||||
UnityEngine.Debug.LogWarning("Non-Windows runtime file dialogs are not yet implemented.");
|
||||
UniGLTFLogger.Warning("Non-Windows runtime file dialogs are not yet implemented.");
|
||||
return default;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"name": "GltfViewer",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:da3e51d19d51a544fa14d43fee843098",
|
||||
"GUID:8d76e605759c3f64a957d63ef96ada7c"
|
||||
"GUID:8d76e605759c3f64a957d63ef96ada7c",
|
||||
"GUID:1cd941934d098654fa21a13f28346412"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace UniGLTF.GltfViewer
|
||||
{
|
||||
return;
|
||||
}
|
||||
Debug.Log($"open: {path}");
|
||||
UniGLTFLogger.Log($"open: {path}");
|
||||
|
||||
LoadPathAsync(path);
|
||||
}
|
||||
@@ -46,15 +46,15 @@ namespace UniGLTF.GltfViewer
|
||||
_instance = await GltfUtility.LoadAsync(path.FullPath);
|
||||
if (_instance == null)
|
||||
{
|
||||
Debug.LogWarning("LoadAsync: null");
|
||||
UniGLTFLogger.Warning("LoadAsync: null");
|
||||
return;
|
||||
}
|
||||
Debug.Log($"LoadAsync: {sw.Elapsed}");
|
||||
UniGLTFLogger.Log($"LoadAsync: {sw.Elapsed}");
|
||||
_instance.ShowMeshes();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogException(ex);
|
||||
UniGLTFLogger.Exception(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace UniGLTF.GltfViewer
|
||||
{
|
||||
public static class OpenFileDialog
|
||||
{
|
||||
public static PathObject Show(string title, params string[] extensions)
|
||||
{
|
||||
Debug.Log(typeof(UniGLTFLogger));
|
||||
#if UNITY_STANDALONE_WIN
|
||||
return PathObject.FromFullPath(FileDialogForWindows.FileDialog(title, extensions));
|
||||
#else
|
||||
UnityEngine.Debug.LogWarning("Non-Windows runtime file dialogs are not yet implemented.");
|
||||
UniGLTFLogger.Warning("Non-Windows runtime file dialogs are not yet implemented.");
|
||||
return default;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using UniGLTF;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -25,7 +26,7 @@ namespace VRM
|
||||
public static void GenerateCode()
|
||||
{
|
||||
var info = new UniGLTF.ObjectSerialization(typeof(glTF_VRM_extensions), "vrm", "_Deserialize");
|
||||
Debug.Log(info);
|
||||
UniGLTFLogger.Log($"{info}");
|
||||
|
||||
using (var s = File.Open(OutPath, FileMode.Create))
|
||||
using (var w = new StreamWriter(s, Encoding.UTF8))
|
||||
@@ -53,7 +54,7 @@ public static class VrmDeserializer
|
||||
} // VRM
|
||||
");
|
||||
|
||||
Debug.LogFormat("write: {0}", OutPath);
|
||||
UniGLTFLogger.Log($"write: {OutPath}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace VRM {
|
||||
public static void GenerateCode()
|
||||
{
|
||||
var info = new ObjectSerialization(typeof(glTF_VRM_extensions), "vrm", "Serialize_");
|
||||
Debug.Log(info);
|
||||
UniGLTFLogger.Log($"{info}");
|
||||
|
||||
using (var s = File.Open(OutPath, FileMode.Create))
|
||||
using (var w = new StreamWriter(s, new UTF8Encoding(false)))
|
||||
@@ -54,7 +54,7 @@ namespace VRM {
|
||||
w.Write(End);
|
||||
}
|
||||
|
||||
Debug.LogFormat("write: {0}", OutPath);
|
||||
UniGLTFLogger.Log($"write: {OutPath}");
|
||||
UnityPath.FromFullpath(OutPath).ImportAsset();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,6 @@ namespace VRM
|
||||
{
|
||||
if (m_scene != null)
|
||||
{
|
||||
//Debug.Log("Bake");
|
||||
m_scene.Bake(GetBakeValue());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace VRM
|
||||
foreach (var x in destroy)
|
||||
{
|
||||
// エラーを引き起こす場合がある
|
||||
// Debug.LogFormat("destroy: {0}", x.name);
|
||||
// UniGLTFLogger.LogFormat("destroy: {0}", x.name);
|
||||
GameObject.DestroyImmediate(x);
|
||||
}
|
||||
}
|
||||
@@ -133,7 +133,7 @@ namespace VRM
|
||||
var newName = sb.ToString();
|
||||
if (!nameCount.ContainsKey(newName))
|
||||
{
|
||||
Debug.LogWarningFormat("force rename {0} => {1}", transform.name, newName);
|
||||
UniGLTFLogger.Warning($"force rename {transform.name} => {newName}");
|
||||
transform.name = newName;
|
||||
nameCount.Add(newName, 1);
|
||||
return;
|
||||
@@ -245,7 +245,7 @@ namespace VRM
|
||||
exporter.Export();
|
||||
}
|
||||
var bytes = data.ToGlbBytes();
|
||||
Debug.LogFormat("Export elapsed {0}", sw.Elapsed);
|
||||
UniGLTFLogger.Log($"Export elapsed {sw.Elapsed}");
|
||||
return bytes;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace VRM
|
||||
if (Symbols.VRM_DEVELOP)
|
||||
{
|
||||
// 来ない?
|
||||
Debug.LogWarning($"{o} already exists. skip write");
|
||||
UniGLTFLogger.Warning($"{o} already exists. skip write");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ namespace VRM
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("not found");
|
||||
UniGLTFLogger.Warning("not found");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace VRM
|
||||
// import vrm to asset
|
||||
if (path.StartsWithUnityAssetPath())
|
||||
{
|
||||
Debug.LogWarningFormat("disallow import from folder under the Assets");
|
||||
UniGLTFLogger.Warning("disallow import from folder under the Assets");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using UniGLTF;
|
||||
using UnityEngine;
|
||||
|
||||
namespace VRM
|
||||
@@ -57,14 +58,13 @@ namespace VRM
|
||||
Directory.Delete(dstDir, recursive: true);
|
||||
}
|
||||
_Copy(srcDir, dstDir);
|
||||
Debug.Log($"copy {srcDir} \n => {dstDir}");
|
||||
UniGLTFLogger.Log($"copy {srcDir} \n => {dstDir}");
|
||||
}
|
||||
|
||||
static void _Copy(string src, string dst)
|
||||
{
|
||||
if (Directory.Exists(src))
|
||||
{
|
||||
// Debug.Log($"CreateDirectory({dst})");
|
||||
Directory.CreateDirectory(dst);
|
||||
foreach (var child in Directory.EnumerateFileSystemEntries(src))
|
||||
{
|
||||
@@ -73,7 +73,6 @@ namespace VRM
|
||||
}
|
||||
else if (File.Exists(src))
|
||||
{
|
||||
// Debug.Log($"Copy {src} => {dst}");
|
||||
File.Copy(src, dst);
|
||||
}
|
||||
else
|
||||
@@ -93,7 +92,7 @@ namespace VRM
|
||||
{
|
||||
if (!Directory.Exists(dst))
|
||||
{
|
||||
Debug.LogError($"{dst} not exists");
|
||||
UniGLTFLogger.Error($"{dst} not exists");
|
||||
return false;
|
||||
|
||||
}
|
||||
@@ -110,7 +109,7 @@ namespace VRM
|
||||
if (list.Count > 0)
|
||||
{
|
||||
var remain = string.Join(",", list);
|
||||
Debug.LogError($"only dst: {remain}");
|
||||
UniGLTFLogger.Error($"only dst: {remain}");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -120,12 +119,12 @@ namespace VRM
|
||||
// same file
|
||||
if (!File.Exists(dst))
|
||||
{
|
||||
Debug.LogError($"{dst} not exists");
|
||||
UniGLTFLogger.Error($"{dst} not exists");
|
||||
return false;
|
||||
}
|
||||
if (!File.ReadAllBytes(src).SequenceEqual(File.ReadAllBytes(dst)))
|
||||
{
|
||||
Debug.LogError($"{src} != {dst}");
|
||||
UniGLTFLogger.Error($"{src} != {dst}");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -133,7 +132,7 @@ namespace VRM
|
||||
else
|
||||
{
|
||||
// throw new FileNotFoundException(src);
|
||||
Debug.LogError($"dir nor file");
|
||||
UniGLTFLogger.Error($"dir nor file");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,11 +250,11 @@ namespace UniGLTF
|
||||
UpdateVrmVersion(vrmVersion);
|
||||
UpdateUniGLTFVersion(m_uniGltfVersion, vrmVersion);
|
||||
AssetDatabase.Refresh();
|
||||
Debug.Log($"{m_uniGltfVersion}, {vrmVersion}");
|
||||
UniGLTFLogger.Log($"{m_uniGltfVersion}, {vrmVersion}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"InvalidFormat: {m_vrmVersion}");
|
||||
UniGLTFLogger.Warning($"InvalidFormat: {m_vrmVersion}");
|
||||
}
|
||||
|
||||
// COPY
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace VRM
|
||||
|
||||
if (unityPath.IsStreamingAsset)
|
||||
{
|
||||
Debug.LogFormat("Skip StreamingAssets: {0}", path);
|
||||
UniGLTFLogger.Log($"Skip StreamingAssets: {path}");
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace VRM
|
||||
{
|
||||
if (!prefabPath.IsUnderWritableFolder)
|
||||
{
|
||||
Debug.LogWarningFormat("out of Asset or writable Packages folder: {0}", prefabPath);
|
||||
UniGLTFLogger.Warning($"out of Asset or writable Packages folder: {prefabPath}");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -327,7 +327,6 @@ namespace VRM
|
||||
{
|
||||
var r = GUILayoutUtility.GetRect(GUIContent.none, GUIStyle.none, GUILayout.Height(EditorGUIUtility.singleLineHeight));
|
||||
var (left, right) = FixedRight(r, 64);
|
||||
// Debug.Log($"{left}, {right}");
|
||||
EditorGUI.LabelField(left, label);
|
||||
EditorGUI.PropertyField(right, prop, new GUIContent(""), false);
|
||||
}
|
||||
|
||||
@@ -71,12 +71,12 @@ namespace VRM
|
||||
};
|
||||
if (used.Contains(binding))
|
||||
{
|
||||
Debug.LogWarning($"duplicated: {binding}");
|
||||
UniGLTFLogger.Warning($"duplicated: {binding}");
|
||||
}
|
||||
else
|
||||
{
|
||||
#if VRM_DEVELOP
|
||||
Debug.Log($"{val} >> {binding}");
|
||||
UniGLTFLogger.Log($"{val} >> {binding}");
|
||||
#endif
|
||||
used.Add(binding);
|
||||
yield return binding;
|
||||
@@ -86,7 +86,7 @@ namespace VRM
|
||||
else
|
||||
{
|
||||
// skip
|
||||
Debug.LogWarning($"SkinnedMeshRenderer not found: {val.RelativePath}");
|
||||
UniGLTFLogger.Warning($"SkinnedMeshRenderer not found: {val.RelativePath}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace VRM
|
||||
{
|
||||
if (index < 0 || index >= nodes.Count)
|
||||
{
|
||||
Debug.LogWarning($"nodes[{index}] is not found !");
|
||||
UniGLTFLogger.Warning($"nodes[{index}] is not found !");
|
||||
node = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UniGLTF;
|
||||
|
||||
#if UNITY_2018_1_OR_NEWER
|
||||
using UnityEditor.Build.Reporting;
|
||||
#endif
|
||||
@@ -145,20 +147,20 @@ namespace VRM.DevOnly.PackageExporter
|
||||
{
|
||||
try
|
||||
{
|
||||
Debug.Log($"[{nameof(VRMExportUnityPackage)}] Start CreateUnityPackageWithBuild...");
|
||||
UniGLTFLogger.Log($"[{nameof(VRMExportUnityPackage)}] Start CreateUnityPackageWithBuild...");
|
||||
var folder = GetProjectRoot();
|
||||
if (!Directory.Exists(folder))
|
||||
{
|
||||
Directory.CreateDirectory(folder);
|
||||
}
|
||||
|
||||
Debug.Log($"[{nameof(VRMExportUnityPackage)}] Try to build test scenes...");
|
||||
UniGLTFLogger.Log($"[{nameof(VRMExportUnityPackage)}] Try to build test scenes...");
|
||||
BuildTestScene();
|
||||
|
||||
Debug.Log($"[{nameof(VRMExportUnityPackage)}] Create UnityPackages...");
|
||||
UniGLTFLogger.Log($"[{nameof(VRMExportUnityPackage)}] Create UnityPackages...");
|
||||
CreateUnityPackages(folder);
|
||||
|
||||
Debug.Log($"[{nameof(VRMExportUnityPackage)}] Finish CreateUnityPackageWithBuild");
|
||||
UniGLTFLogger.Log($"[{nameof(VRMExportUnityPackage)}] Finish CreateUnityPackageWithBuild");
|
||||
if (Application.isBatchMode)
|
||||
{
|
||||
EditorApplication.Exit(0);
|
||||
@@ -166,7 +168,7 @@ namespace VRM.DevOnly.PackageExporter
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogException(e);
|
||||
UniGLTFLogger.Exception(e);
|
||||
if (Application.isBatchMode)
|
||||
{
|
||||
EditorApplication.Exit(1);
|
||||
@@ -262,8 +264,8 @@ namespace VRM.DevOnly.PackageExporter
|
||||
{
|
||||
var targetFileNames = package.List.SelectMany(x => x.Files).ToArray();
|
||||
|
||||
Debug.LogFormat("Package '{0}' will include {1} files...", package.Name, targetFileNames.Count());
|
||||
Debug.LogFormat("{0}", string.Join("", targetFileNames.Select((x, i) => string.Format("[{0:##0}] {1}\n", i, x)).ToArray()));
|
||||
UniGLTFLogger.Log($"Package '{package.Name}' will include {targetFileNames.Count()} files...");
|
||||
UniGLTFLogger.Log($"{string.Join("", targetFileNames.Select((x, i) => string.Format("[{0:##0}] {1}\n", i, x)).ToArray())}");
|
||||
|
||||
var path = MakePackagePathName(outputDir, package.Name);
|
||||
AssetDatabase.ExportPackage(targetFileNames, path, ExportPackageOptions.Default);
|
||||
@@ -283,7 +285,7 @@ namespace VRM.DevOnly.PackageExporter
|
||||
private static void Build(string[] levels)
|
||||
{
|
||||
var buildPath = Path.GetFullPath(Application.dataPath + "/../build/build.exe");
|
||||
Debug.LogFormat("BuildPath: {0}", buildPath);
|
||||
UniGLTFLogger.Log($"BuildPath: {buildPath}");
|
||||
var build = BuildPipeline.BuildPlayer(levels,
|
||||
buildPath,
|
||||
BuildTarget.StandaloneWindows,
|
||||
|
||||
18
Assets/VRM/Samples~/BlendShapeMenu/BlendShapeMenu.asmdef
Normal file
18
Assets/VRM/Samples~/BlendShapeMenu/BlendShapeMenu.asmdef
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "BlendShapeMenu",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:8d76e605759c3f64a957d63ef96ada7c",
|
||||
"GUID:1cd941934d098654fa21a13f28346412",
|
||||
"GUID:05dd262a0c0a2f841b8252c8c3815582"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 65a83bac7c049b341b41b20eac1c926d
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using UniGLTF;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -82,11 +83,10 @@ namespace VRM.Sample.BlendShapeMenu
|
||||
[MenuItem("CONTEXT/BlendShapeAvatar/Add ARKit FaceTracking BlendShapes")]
|
||||
public static void AddARKitFaceTrackingBlendShapes(MenuCommand command)
|
||||
{
|
||||
// Debug.Log(command.context);
|
||||
var avatar = command.context as BlendShapeAvatar;
|
||||
if (avatar == null)
|
||||
{
|
||||
Debug.LogError("no context");
|
||||
UniGLTFLogger.Error("no context");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -124,17 +124,16 @@ namespace VRM.Sample.BlendShapeMenu
|
||||
avatar.Clips.Add(clip);
|
||||
}
|
||||
|
||||
Debug.Log("Create\n" + sb.ToString());
|
||||
UniGLTFLogger.Log("Create\n" + sb.ToString());
|
||||
}
|
||||
|
||||
[MenuItem("CONTEXT/BlendShapeAvatar/Assign all BlendShapes in a folder")]
|
||||
static void AssginAllBlendShapesInAFolder(MenuCommand command)
|
||||
{
|
||||
// Debug.Log(command.context);
|
||||
var avatar = command.context as BlendShapeAvatar;
|
||||
if (avatar == null)
|
||||
{
|
||||
Debug.LogError("no context");
|
||||
UniGLTFLogger.Error("no context");
|
||||
return;
|
||||
}
|
||||
var assetPath = AssetDatabase.GetAssetPath(avatar);
|
||||
@@ -175,7 +174,7 @@ namespace VRM.Sample.BlendShapeMenu
|
||||
avatar.Clips.Add(clip);
|
||||
}
|
||||
|
||||
Debug.Log($"Assign\n" + sb.ToString());
|
||||
UniGLTFLogger.Log($"Assign\n" + sb.ToString());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
{
|
||||
"name": "VRM.Samples.FirstPersonSample",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:da3e51d19d51a544fa14d43fee843098",
|
||||
"GUID:b7aa47b240b57de44a4b2021c143c9bf",
|
||||
"GUID:8d76e605759c3f64a957d63ef96ada7c",
|
||||
"GUID:1cd941934d098654fa21a13f28346412",
|
||||
"GUID:b7aa47b240b57de44a4b2021c143c9bf",
|
||||
"GUID:05dd262a0c0a2f841b8252c8c3815582"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace VRM.FirstPersonSample
|
||||
{
|
||||
if (m_canvas == null)
|
||||
{
|
||||
Debug.LogWarning("no canvas");
|
||||
UniGLTFLogger.Warning("no canvas");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ namespace VRM.FirstPersonSample
|
||||
|
||||
void LoadBvh(string path)
|
||||
{
|
||||
Debug.LogFormat("ImportBvh: {0}", path);
|
||||
UniGLTFLogger.Log($"ImportBvh: {path}");
|
||||
var context = new UniHumanoid.BvhImporterContext();
|
||||
|
||||
context.Parse(path);
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
{
|
||||
"name": "VRM.Samples.RuntimeExporterSample",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:da3e51d19d51a544fa14d43fee843098",
|
||||
"GUID:8d76e605759c3f64a957d63ef96ada7c",
|
||||
"GUID:1cd941934d098654fa21a13f28346412",
|
||||
"GUID:05dd262a0c0a2f841b8252c8c3815582"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace VRM.RuntimeExporterSample
|
||||
// add blendshape clip to avatar.Clips
|
||||
var clip = ScriptableObject.CreateInstance<BlendShapeClip>();
|
||||
var name = $"custom#{avatar.Clips.Count}";
|
||||
Debug.Log($"Add {name}");
|
||||
UniGLTFLogger.Log($"Add {name}");
|
||||
// unity asset name
|
||||
clip.name = name;
|
||||
// vrm export name
|
||||
@@ -131,7 +131,7 @@ namespace VRM.RuntimeExporterSample
|
||||
var bytes = useNormalize ? ExportCustom(model, false, bakeBlendShape) : ExportSimple(model);
|
||||
|
||||
File.WriteAllBytes(path, bytes);
|
||||
Debug.LogFormat("export to {0}", path);
|
||||
UniGLTFLogger.Log($"export to {path}");
|
||||
}
|
||||
|
||||
static byte[] ExportSimple(GameObject model)
|
||||
@@ -151,7 +151,7 @@ namespace VRM.RuntimeExporterSample
|
||||
|
||||
void OnExported(UniGLTF.glTF vrm)
|
||||
{
|
||||
Debug.LogFormat("exported");
|
||||
UniGLTFLogger.Log("exported");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections;
|
||||
using UniGLTF;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
@@ -67,7 +68,7 @@ namespace VRM.SimpleViewer
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
Debug.Log("StopCoroutine");
|
||||
UniGLTFLogger.Log("StopCoroutine");
|
||||
StopCoroutine(m_coroutine);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace VRM.SimpleViewer
|
||||
return "";
|
||||
#else
|
||||
// fall back constant path
|
||||
UnityEngine.Debug.LogWarning("Non-Windows runtime file dialogs are not yet implemented.");
|
||||
UnityEngine.UniGLTFLogger.Warning("Non-Windows runtime file dialogs are not yet implemented.");
|
||||
return UnityEngine.Application.dataPath + "/default.vrm";
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
"name": "VRM.Samples.SimpleViewer",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:da3e51d19d51a544fa14d43fee843098",
|
||||
"GUID:b7aa47b240b57de44a4b2021c143c9bf",
|
||||
"GUID:8d76e605759c3f64a957d63ef96ada7c",
|
||||
"GUID:1cd941934d098654fa21a13f28346412",
|
||||
"GUID:b7aa47b240b57de44a4b2021c143c9bf",
|
||||
"GUID:05dd262a0c0a2f841b8252c8c3815582",
|
||||
"GUID:3e5d614bc16b50d41bd94c8d7444ca46"
|
||||
],
|
||||
|
||||
@@ -179,7 +179,7 @@ namespace VRM.SimpleViewer
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("motion: no toggle");
|
||||
UniGLTFLogger.Log("motion: no toggle");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -368,7 +368,7 @@ namespace VRM.SimpleViewer
|
||||
/// </summary>
|
||||
public void FileSelected(string url)
|
||||
{
|
||||
Debug.Log($"FileSelected: {url}");
|
||||
UniGLTFLogger.Log($"FileSelected: {url}");
|
||||
StartCoroutine(LoadCoroutine(url));
|
||||
}
|
||||
|
||||
@@ -386,7 +386,7 @@ namespace VRM.SimpleViewer
|
||||
{
|
||||
if (!File.Exists(path))
|
||||
{
|
||||
Debug.LogWarning($"{path} not exists");
|
||||
UniGLTFLogger.Warning($"{path} not exists");
|
||||
return;
|
||||
}
|
||||
var bytes = File.ReadAllBytes(path);
|
||||
@@ -396,7 +396,7 @@ namespace VRM.SimpleViewer
|
||||
public async Task LoadBytesAsync(string path, byte[] bytes)
|
||||
{
|
||||
var size = bytes != null ? bytes.Length : 0;
|
||||
Debug.Log($"LoadModelAsync: {path}: {size}bytes");
|
||||
UniGLTFLogger.Log($"LoadModelAsync: {path}: {size}bytes");
|
||||
|
||||
var ext = Path.GetExtension(path).ToLower();
|
||||
if (ext == ".bvh")
|
||||
|
||||
@@ -30,7 +30,6 @@ namespace UniVRM10
|
||||
if (isScroll)
|
||||
{
|
||||
var maxScroll = bottom.y - (height - EditorGUIUtility.singleLineHeight * 2);
|
||||
// Debug.Log($"{bottom.y}: {this.position.size.y}: {maxScroll}");
|
||||
if (m_scrollPosition.y > maxScroll)
|
||||
{
|
||||
m_scrollPosition = new Vector2(0, maxScroll);
|
||||
|
||||
@@ -30,10 +30,6 @@ namespace UniVRM10
|
||||
continue;
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
// Debug.Log($"{iterator.propertyPath}({iterator.propertyType})");
|
||||
#endif
|
||||
|
||||
if (m_callback is null || !m_callback(iterator))
|
||||
{
|
||||
EditorGUI.indentLevel = iterator.depth + m_depth;
|
||||
|
||||
@@ -124,7 +124,6 @@ namespace UniVRM10
|
||||
{
|
||||
var r = GUILayoutUtility.GetRect(GUIContent.none, GUIStyle.none, GUILayout.Height(EditorGUIUtility.singleLineHeight));
|
||||
var (left, right) = FixedRight(r, 64);
|
||||
// Debug.Log($"{left}, {right}");
|
||||
EditorGUI.LabelField(left, label);
|
||||
EditorGUI.PropertyField(right, prop, new GUIContent(""), false);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,6 @@ namespace UniVRM10
|
||||
if (match != null && iterator.type == "string")
|
||||
{
|
||||
// ArrayItem
|
||||
// Debug.Log($"{match.Groups[1].Value}");
|
||||
iterator.stringValue = EditorGUILayout.TextField($" {arrayName}[{match.Groups[1].Value}]", iterator.stringValue);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -88,7 +88,6 @@ namespace UniVRM10
|
||||
{
|
||||
EditorGUI.BeginChangeCheck();
|
||||
Quaternion rot = Handles.RotationHandle(selected.HeadObject.transform.rotation, selected.HeadObject.transform.position);
|
||||
// Debug.Log($"{selected}");
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
// UNDO
|
||||
|
||||
@@ -68,13 +68,13 @@ namespace UniVRM10
|
||||
};
|
||||
if (used.Contains(binding))
|
||||
{
|
||||
Debug.LogWarning($"duplicated: {binding}");
|
||||
UniGLTFLogger.Warning($"duplicated: {binding}");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Symbols.VRM_DEVELOP)
|
||||
{
|
||||
Debug.Log($"{val} >> {binding}");
|
||||
UniGLTFLogger.Log($"{val} >> {binding}");
|
||||
}
|
||||
used.Add(binding);
|
||||
yield return binding;
|
||||
@@ -84,7 +84,7 @@ namespace UniVRM10
|
||||
else
|
||||
{
|
||||
// skip
|
||||
Debug.LogWarning($"SkinnedMeshRenderer not found: {val.RelativePath}");
|
||||
UniGLTFLogger.Warning($"SkinnedMeshRenderer not found: {val.RelativePath}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace UniVRM10
|
||||
{
|
||||
if (Symbols.VRM_DEVELOP)
|
||||
{
|
||||
Debug.Log("OnImportAsset to " + scriptedImporter.assetPath);
|
||||
UniGLTFLogger.Log("OnImportAsset to " + scriptedImporter.assetPath);
|
||||
}
|
||||
|
||||
// 1st parse as vrm1
|
||||
@@ -117,7 +117,7 @@ namespace UniVRM10
|
||||
// fail to migrate...
|
||||
if (migration != null)
|
||||
{
|
||||
Debug.LogWarning(migration.Message);
|
||||
UniGLTFLogger.Warning(migration.Message);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace UniVRM10
|
||||
if (value != null && AssetDatabase.IsSubAsset(value))
|
||||
{
|
||||
// SubAsset is readonly. copy
|
||||
Debug.Log("copy VRM10ObjectMeta");
|
||||
UniGLTFLogger.Log("copy VRM10ObjectMeta");
|
||||
value.Meta.CopyTo(m_tmpObject.Meta);
|
||||
return;
|
||||
}
|
||||
@@ -197,7 +197,7 @@ namespace UniVRM10
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("not found");
|
||||
UniGLTFLogger.Warning("not found");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -288,7 +288,7 @@ namespace UniVRM10
|
||||
{
|
||||
if (m_settings.FreezeMesh)
|
||||
{
|
||||
Debug.Log("vrm-1.0 FreezeMesh");
|
||||
UniGLTFLogger.Log("vrm-1.0 FreezeMesh");
|
||||
var copy = GameObject.Instantiate(root);
|
||||
copy.GetComponent<Vrm10Instance>().UpdateType = Vrm10Instance.UpdateTypes.None;
|
||||
disposer.Push(copy);
|
||||
@@ -329,7 +329,7 @@ namespace UniVRM10
|
||||
|
||||
m_logLabel += $"write to {path}...\n";
|
||||
File.WriteAllBytes(path, exportedBytes);
|
||||
Debug.Log("exportedBytes: " + exportedBytes.Length);
|
||||
UniGLTFLogger.Log("exportedBytes: " + exportedBytes.Length);
|
||||
|
||||
var assetPath = UniGLTF.UnityPath.FromFullpath(path);
|
||||
if (assetPath.IsUnderWritableFolder)
|
||||
@@ -344,7 +344,7 @@ namespace UniVRM10
|
||||
m_logLabel += ex.ToString();
|
||||
// rethrow
|
||||
//throw;
|
||||
Debug.LogException(ex);
|
||||
UniGLTFLogger.Exception(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.IO;
|
||||
using UniGLTF;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -94,14 +95,14 @@ namespace UniVRM10
|
||||
var extensionSchema = parser.Load(extensionSchemaPath, "");
|
||||
|
||||
var formatDst = new DirectoryInfo(Path.Combine(projectRoot.FullName, arg.FormatDir));
|
||||
Debug.Log($"Format.g Dir: {formatDst}");
|
||||
UniGLTFLogger.Log($"Format.g Dir: {formatDst}");
|
||||
|
||||
var serializerDst = new DirectoryInfo(Path.Combine(projectRoot.FullName, arg.SerializerDir));
|
||||
Debug.Log($"Serializer/Deserializer.g Dir: {serializerDst}");
|
||||
UniGLTFLogger.Log($"Serializer/Deserializer.g Dir: {serializerDst}");
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Debug.Log(extensionSchema.Dump());
|
||||
UniGLTFLogger.Log(extensionSchema.Dump());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Linq;
|
||||
using UniGLTF;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -25,11 +26,11 @@ namespace VRM10.MToon10.Editor
|
||||
|
||||
if (obj is Material material && migrator.TryMigrate(material, validateShaderName: true))
|
||||
{
|
||||
Debug.Log($"Migrated {material.name} to MToon10");
|
||||
UniGLTFLogger.Log($"Migrated {material.name} to MToon10");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"Failed to migrate {obj.name} to MToon10");
|
||||
UniGLTFLogger.Warning($"Failed to migrate {obj.name} to MToon10");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"name": "VRM10.MToon10.Editor",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:1cd941934d098654fa21a13f28346412",
|
||||
"GUID:0aaf403bd13871a44b7127aef2695ff8"
|
||||
],
|
||||
"includePlatforms": [
|
||||
|
||||
@@ -2,6 +2,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UniVRM10.ClothWarp.Components;
|
||||
using UnityEngine;
|
||||
using UniGLTF;
|
||||
|
||||
|
||||
namespace UniVRM10.Cloth.Viewer
|
||||
@@ -116,7 +117,7 @@ namespace UniVRM10.Cloth.Viewer
|
||||
var bone = animator.GetBoneTransform(humanBone);
|
||||
if (bone == null)
|
||||
{
|
||||
Debug.LogWarning($"{humanBone} not found");
|
||||
UniGLTFLogger.Warning($"{humanBone} not found");
|
||||
group = default;
|
||||
return false;
|
||||
}
|
||||
@@ -148,7 +149,6 @@ namespace UniVRM10.Cloth.Viewer
|
||||
}
|
||||
if (transforms.Count == 0)
|
||||
{
|
||||
// Debug.LogWarning($"{string.Join(',', targets)} not found");
|
||||
group = default;
|
||||
return false;
|
||||
}
|
||||
@@ -163,7 +163,7 @@ namespace UniVRM10.Cloth.Viewer
|
||||
var bone = animator.GetBoneTransform(humanBone);
|
||||
if (bone == null)
|
||||
{
|
||||
Debug.LogWarning($"{humanBone} not found");
|
||||
UniGLTFLogger.Warning($"{humanBone} not found");
|
||||
group = default;
|
||||
return false;
|
||||
}
|
||||
@@ -189,7 +189,6 @@ namespace UniVRM10.Cloth.Viewer
|
||||
}
|
||||
if (transforms.Count == 0)
|
||||
{
|
||||
// Debug.LogWarning($"{string.Join(',', targets)} not found");
|
||||
group = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ namespace UniVRM10.Cloth.Viewer
|
||||
var ext = Path.GetExtension(path).ToLower();
|
||||
if (ext != ".vrm")
|
||||
{
|
||||
Debug.LogWarning($"{path} is not vrm");
|
||||
UniGLTFLogger.Warning($"{path} is not vrm");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -299,11 +299,11 @@ namespace UniVRM10.Cloth.Viewer
|
||||
}
|
||||
catch (UniJSON.ParserException)
|
||||
{
|
||||
Debug.LogWarning("UniJSON.ParserException");
|
||||
UniGLTFLogger.Warning("UniJSON.ParserException");
|
||||
}
|
||||
catch (UniJSON.DeserializationException)
|
||||
{
|
||||
Debug.LogWarning("UniJSON.DeserializationException");
|
||||
UniGLTFLogger.Warning("UniJSON.DeserializationException");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -411,7 +411,7 @@ namespace UniVRM10.Cloth.Viewer
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogException(ex);
|
||||
UniGLTFLogger.Exception(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -426,7 +426,7 @@ namespace UniVRM10.Cloth.Viewer
|
||||
|
||||
try
|
||||
{
|
||||
Debug.LogFormat("{0}", path);
|
||||
UniGLTFLogger.Log($"{path}");
|
||||
var vrm10Instance = await Vrm10.LoadPathAsync(path,
|
||||
canLoadVrm0X: true,
|
||||
showMeshes: false,
|
||||
@@ -446,7 +446,7 @@ namespace UniVRM10.Cloth.Viewer
|
||||
|
||||
if (vrm10Instance == null)
|
||||
{
|
||||
Debug.LogWarning("LoadPathAsync is null");
|
||||
UniGLTFLogger.Warning("LoadPathAsync is null");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -461,12 +461,12 @@ namespace UniVRM10.Cloth.Viewer
|
||||
{
|
||||
if (ex is OperationCanceledException)
|
||||
{
|
||||
Debug.LogWarning($"Canceled to Load: {path}");
|
||||
UniGLTFLogger.Warning($"Canceled to Load: {path}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError($"Failed to Load: {path}");
|
||||
Debug.LogException(ex);
|
||||
UniGLTFLogger.Error($"Failed to Load: {path}");
|
||||
UniGLTFLogger.Exception(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,6 @@ namespace UniVRM10.ClothWarp.Components
|
||||
sb.Append("].");
|
||||
sb.Append(subpath);
|
||||
var s = sb.ToString();
|
||||
// Debug.Log(s);
|
||||
prop.BindProperty(serializedObject.FindProperty(s));
|
||||
prop.SetEnabled(enableFunc(i));
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ namespace SphereTriangle
|
||||
var y = t.position.z - _o.z;
|
||||
var a = (int)(Mathf.Rad2Deg * Mathf.Atan2(x, y));
|
||||
a = Rot180(a);
|
||||
// Debug.Log($"{t.name} => {a}");
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
19
Assets/VRM10/Samples~/SimpleVrma/SimpleVrma.asmdef
Normal file
19
Assets/VRM10/Samples~/SimpleVrma/SimpleVrma.asmdef
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "SimpleVrma",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:8d76e605759c3f64a957d63ef96ada7c",
|
||||
"GUID:1cd941934d098654fa21a13f28346412",
|
||||
"GUID:e47c917724578cc43b5506c17a27e9a0",
|
||||
"GUID:f06555f75b070af458a003d92f9efb00"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
7
Assets/VRM10/Samples~/SimpleVrma/SimpleVrma.asmdef.meta
Normal file
7
Assets/VRM10/Samples~/SimpleVrma/SimpleVrma.asmdef.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0466374a47130e740bf6c1c1857dc6f6
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -20,14 +20,14 @@ public class SimpleVrma : MonoBehaviour
|
||||
if (GUILayout.Button("open vrm"))
|
||||
{
|
||||
var path = EditorUtility.OpenFilePanel("open vrm", "", "vrm");
|
||||
Debug.Log(path);
|
||||
UniGLTFLogger.Log(path);
|
||||
LoadVrm(path);
|
||||
}
|
||||
|
||||
if (GUILayout.Button("open vrma"))
|
||||
{
|
||||
var path = EditorUtility.OpenFilePanel("open vrma", "", "vrma");
|
||||
Debug.Log(path);
|
||||
UniGLTFLogger.Log(path);
|
||||
LoadVrma(path);
|
||||
}
|
||||
#endif
|
||||
@@ -59,7 +59,7 @@ public class SimpleVrma : MonoBehaviour
|
||||
|
||||
Vrma = instance.GetComponent<Vrm10AnimationInstance>();
|
||||
Vrm.Runtime.VrmAnimation = Vrma;
|
||||
Debug.Log(Vrma);
|
||||
UniGLTFLogger.Log($"{Vrma}");
|
||||
|
||||
var animation = Vrma.GetComponent<Animation>();
|
||||
animation.Play();
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
{
|
||||
"name": "VRM10.Samples.VRM10FirstPersonSample",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:da3e51d19d51a544fa14d43fee843098",
|
||||
"GUID:b7aa47b240b57de44a4b2021c143c9bf",
|
||||
"GUID:8d76e605759c3f64a957d63ef96ada7c",
|
||||
"GUID:1cd941934d098654fa21a13f28346412",
|
||||
"GUID:b7aa47b240b57de44a4b2021c143c9bf",
|
||||
"GUID:e47c917724578cc43b5506c17a27e9a0"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace UniVRM10.FirstPersonSample
|
||||
{
|
||||
if (m_canvas == null)
|
||||
{
|
||||
Debug.LogWarning("no canvas");
|
||||
UniGLTFLogger.Warning("no canvas");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace UniVRM10.FirstPersonSample
|
||||
|
||||
void LoadBvh(string path)
|
||||
{
|
||||
Debug.LogFormat("ImportBvh: {0}", path);
|
||||
UniGLTFLogger.Log($"ImportBvh: {path}");
|
||||
var context = new UniHumanoid.BvhImporterContext();
|
||||
|
||||
context.Parse(path);
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
"name": "VRM10.Samples.VRM10RuntimeExporter",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:da3e51d19d51a544fa14d43fee843098",
|
||||
"GUID:8d76e605759c3f64a957d63ef96ada7c",
|
||||
"GUID:1cd941934d098654fa21a13f28346412",
|
||||
"GUID:60c8346e00a8ddd4cafc5a02eceeec57",
|
||||
"GUID:0aaf403bd13871a44b7127aef2695ff8",
|
||||
"GUID:8d76e605759c3f64a957d63ef96ada7c",
|
||||
"GUID:e47c917724578cc43b5506c17a27e9a0",
|
||||
"GUID:2ef84b520212e174a94668c7a0862d3b"
|
||||
],
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace UniVRM10.RuntimeExporterSample
|
||||
// // add blendshape clip to avatar.Clips
|
||||
// var clip = ScriptableObject.CreateInstance<BlendShapeClip>();
|
||||
// var name = $"custom#{avatar.Clips.Count}";
|
||||
// Debug.Log($"Add {name}");
|
||||
// UniGLTFLogger.Log($"Add {name}");
|
||||
// // unity asset name
|
||||
// clip.name = name;
|
||||
// // vrm export name
|
||||
@@ -130,7 +130,7 @@ namespace UniVRM10.RuntimeExporterSample
|
||||
var bytes = ExportSimple(m_settings, model, m_meta);
|
||||
|
||||
File.WriteAllBytes(path, bytes);
|
||||
Debug.LogFormat("export to {0}", path);
|
||||
UniGLTFLogger.Log($"export to {path}");
|
||||
}
|
||||
|
||||
static byte[] ExportSimple(GltfExportSettings settings, GameObject root, VRM10ObjectMeta meta)
|
||||
@@ -141,7 +141,7 @@ namespace UniVRM10.RuntimeExporterSample
|
||||
var model = converter.Export(settings, arrayManager, root);
|
||||
|
||||
// 右手系に変換
|
||||
Debug.Log($"convert to right handed coordinate...");
|
||||
UniGLTFLogger.Log($"convert to right handed coordinate...");
|
||||
model.ConvertCoordinate(VrmLib.Coordinates.Vrm1, ignoreVrm: false);
|
||||
|
||||
// export vrm-1.0
|
||||
@@ -156,7 +156,7 @@ namespace UniVRM10.RuntimeExporterSample
|
||||
|
||||
void OnExported(UniGLTF.glTF vrm)
|
||||
{
|
||||
Debug.LogFormat("exported");
|
||||
UniGLTFLogger.Log("exported");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace UniVRM10.VRM10Viewer
|
||||
// NOTE: Fallback to default material
|
||||
if (Symbols.VRM_DEVELOP)
|
||||
{
|
||||
Debug.LogWarning($"material: {i} out of range. fallback");
|
||||
UniGLTFLogger.Warning($"material: {i} out of range. fallback");
|
||||
}
|
||||
return GetGltfDefault(GltfMaterialImportUtils.ImportMaterialName(i, null));
|
||||
}
|
||||
|
||||
@@ -683,7 +683,7 @@ namespace UniVRM10.VRM10Viewer
|
||||
var ext = Path.GetExtension(path).ToLower();
|
||||
if (ext != ".vrm")
|
||||
{
|
||||
Debug.LogWarning($"{path} is not vrm");
|
||||
UniGLTFLogger.Warning($"{path} is not vrm");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -696,7 +696,7 @@ namespace UniVRM10.VRM10Viewer
|
||||
/// </summary>
|
||||
public void FileSelected(string url)
|
||||
{
|
||||
Debug.Log($"FileSelected: {url}");
|
||||
UniGLTFLogger.Log($"FileSelected: {url}");
|
||||
StartCoroutine(LoadCoroutine(url));
|
||||
}
|
||||
|
||||
@@ -750,11 +750,11 @@ namespace UniVRM10.VRM10Viewer
|
||||
}
|
||||
catch (UniJSON.ParserException)
|
||||
{
|
||||
Debug.LogWarning("UniJSON.ParserException");
|
||||
UniGLTFLogger.Warning("UniJSON.ParserException");
|
||||
}
|
||||
catch (UniJSON.DeserializationException)
|
||||
{
|
||||
Debug.LogWarning("UniJSON.DeserializationException");
|
||||
UniGLTFLogger.Warning("UniJSON.DeserializationException");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -837,7 +837,7 @@ namespace UniVRM10.VRM10Viewer
|
||||
|
||||
try
|
||||
{
|
||||
Debug.LogFormat("{0}", path);
|
||||
UniGLTFLogger.Log($"{path}");
|
||||
var vrm10Instance = await Vrm10.LoadBytesAsync(bytes,
|
||||
canLoadVrm0X: true,
|
||||
showMeshes: false,
|
||||
@@ -854,7 +854,7 @@ namespace UniVRM10.VRM10Viewer
|
||||
|
||||
if (vrm10Instance == null)
|
||||
{
|
||||
Debug.LogWarning("LoadPathAsync is null");
|
||||
UniGLTFLogger.Warning("LoadPathAsync is null");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -880,12 +880,12 @@ namespace UniVRM10.VRM10Viewer
|
||||
{
|
||||
if (ex is OperationCanceledException)
|
||||
{
|
||||
Debug.LogWarning($"Canceled to Load: {path}");
|
||||
UniGLTFLogger.Warning($"Canceled to Load: {path}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError($"Failed to Load: {path}");
|
||||
Debug.LogException(ex);
|
||||
UniGLTFLogger.Error($"Failed to Load: {path}");
|
||||
UniGLTFLogger.Exception(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UniVRM10.ClothWarp.Components;
|
||||
using UnityEngine;
|
||||
using UniGLTF;
|
||||
|
||||
|
||||
namespace UniVRM10.Cloth.Viewer
|
||||
@@ -116,7 +117,7 @@ namespace UniVRM10.Cloth.Viewer
|
||||
var bone = animator.GetBoneTransform(humanBone);
|
||||
if (bone == null)
|
||||
{
|
||||
Debug.LogWarning($"{humanBone} not found");
|
||||
UniGLTFLogger.Warning($"{humanBone} not found");
|
||||
group = default;
|
||||
return false;
|
||||
}
|
||||
@@ -148,7 +149,6 @@ namespace UniVRM10.Cloth.Viewer
|
||||
}
|
||||
if (transforms.Count == 0)
|
||||
{
|
||||
// Debug.LogWarning($"{string.Join(',', targets)} not found");
|
||||
group = default;
|
||||
return false;
|
||||
}
|
||||
@@ -163,7 +163,7 @@ namespace UniVRM10.Cloth.Viewer
|
||||
var bone = animator.GetBoneTransform(humanBone);
|
||||
if (bone == null)
|
||||
{
|
||||
Debug.LogWarning($"{humanBone} not found");
|
||||
UniGLTFLogger.Warning($"{humanBone} not found");
|
||||
group = default;
|
||||
return false;
|
||||
}
|
||||
@@ -189,7 +189,6 @@ namespace UniVRM10.Cloth.Viewer
|
||||
}
|
||||
if (transforms.Count == 0)
|
||||
{
|
||||
// Debug.LogWarning($"{string.Join(',', targets)} not found");
|
||||
group = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ namespace UniVRM10.Cloth.Viewer
|
||||
var ext = Path.GetExtension(path).ToLower();
|
||||
if (ext != ".vrm")
|
||||
{
|
||||
Debug.LogWarning($"{path} is not vrm");
|
||||
UniGLTFLogger.Warning($"{path} is not vrm");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -299,11 +299,11 @@ namespace UniVRM10.Cloth.Viewer
|
||||
}
|
||||
catch (UniJSON.ParserException)
|
||||
{
|
||||
Debug.LogWarning("UniJSON.ParserException");
|
||||
UniGLTFLogger.Warning("UniJSON.ParserException");
|
||||
}
|
||||
catch (UniJSON.DeserializationException)
|
||||
{
|
||||
Debug.LogWarning("UniJSON.DeserializationException");
|
||||
UniGLTFLogger.Warning("UniJSON.DeserializationException");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -411,7 +411,7 @@ namespace UniVRM10.Cloth.Viewer
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogException(ex);
|
||||
UniGLTFLogger.Exception(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -426,7 +426,7 @@ namespace UniVRM10.Cloth.Viewer
|
||||
|
||||
try
|
||||
{
|
||||
Debug.LogFormat("{0}", path);
|
||||
UniGLTFLogger.Log($"{path}");
|
||||
var vrm10Instance = await Vrm10.LoadPathAsync(path,
|
||||
canLoadVrm0X: true,
|
||||
showMeshes: false,
|
||||
@@ -446,7 +446,7 @@ namespace UniVRM10.Cloth.Viewer
|
||||
|
||||
if (vrm10Instance == null)
|
||||
{
|
||||
Debug.LogWarning("LoadPathAsync is null");
|
||||
UniGLTFLogger.Warning("LoadPathAsync is null");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -461,12 +461,12 @@ namespace UniVRM10.Cloth.Viewer
|
||||
{
|
||||
if (ex is OperationCanceledException)
|
||||
{
|
||||
Debug.LogWarning($"Canceled to Load: {path}");
|
||||
UniGLTFLogger.Warning($"Canceled to Load: {path}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError($"Failed to Load: {path}");
|
||||
Debug.LogException(ex);
|
||||
UniGLTFLogger.Error($"Failed to Load: {path}");
|
||||
UniGLTFLogger.Exception(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,6 @@ namespace UniVRM10.ClothWarp.Components
|
||||
sb.Append("].");
|
||||
sb.Append(subpath);
|
||||
var s = sb.ToString();
|
||||
// Debug.Log(s);
|
||||
prop.BindProperty(serializedObject.FindProperty(s));
|
||||
prop.SetEnabled(enableFunc(i));
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ namespace SphereTriangle
|
||||
var y = t.position.z - _o.z;
|
||||
var a = (int)(Mathf.Rad2Deg * Mathf.Atan2(x, y));
|
||||
a = Rot180(a);
|
||||
// Debug.Log($"{t.name} => {a}");
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
19
Assets/VRM10_Samples/SimpleVrma/SimpleVrma.asmdef
Normal file
19
Assets/VRM10_Samples/SimpleVrma/SimpleVrma.asmdef
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "SimpleVrma",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:8d76e605759c3f64a957d63ef96ada7c",
|
||||
"GUID:1cd941934d098654fa21a13f28346412",
|
||||
"GUID:e47c917724578cc43b5506c17a27e9a0",
|
||||
"GUID:f06555f75b070af458a003d92f9efb00"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
7
Assets/VRM10_Samples/SimpleVrma/SimpleVrma.asmdef.meta
Normal file
7
Assets/VRM10_Samples/SimpleVrma/SimpleVrma.asmdef.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0466374a47130e740bf6c1c1857dc6f6
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -20,14 +20,14 @@ public class SimpleVrma : MonoBehaviour
|
||||
if (GUILayout.Button("open vrm"))
|
||||
{
|
||||
var path = EditorUtility.OpenFilePanel("open vrm", "", "vrm");
|
||||
Debug.Log(path);
|
||||
UniGLTFLogger.Log(path);
|
||||
LoadVrm(path);
|
||||
}
|
||||
|
||||
if (GUILayout.Button("open vrma"))
|
||||
{
|
||||
var path = EditorUtility.OpenFilePanel("open vrma", "", "vrma");
|
||||
Debug.Log(path);
|
||||
UniGLTFLogger.Log(path);
|
||||
LoadVrma(path);
|
||||
}
|
||||
#endif
|
||||
@@ -59,7 +59,7 @@ public class SimpleVrma : MonoBehaviour
|
||||
|
||||
Vrma = instance.GetComponent<Vrm10AnimationInstance>();
|
||||
Vrm.Runtime.VrmAnimation = Vrma;
|
||||
Debug.Log(Vrma);
|
||||
UniGLTFLogger.Log($"{Vrma}");
|
||||
|
||||
var animation = Vrma.GetComponent<Animation>();
|
||||
animation.Play();
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
{
|
||||
"name": "VRM10.Samples.VRM10FirstPersonSample",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:da3e51d19d51a544fa14d43fee843098",
|
||||
"GUID:b7aa47b240b57de44a4b2021c143c9bf",
|
||||
"GUID:8d76e605759c3f64a957d63ef96ada7c",
|
||||
"GUID:1cd941934d098654fa21a13f28346412",
|
||||
"GUID:b7aa47b240b57de44a4b2021c143c9bf",
|
||||
"GUID:e47c917724578cc43b5506c17a27e9a0"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace UniVRM10.FirstPersonSample
|
||||
{
|
||||
if (m_canvas == null)
|
||||
{
|
||||
Debug.LogWarning("no canvas");
|
||||
UniGLTFLogger.Warning("no canvas");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace UniVRM10.FirstPersonSample
|
||||
|
||||
void LoadBvh(string path)
|
||||
{
|
||||
Debug.LogFormat("ImportBvh: {0}", path);
|
||||
UniGLTFLogger.Log($"ImportBvh: {path}");
|
||||
var context = new UniHumanoid.BvhImporterContext();
|
||||
|
||||
context.Parse(path);
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
"name": "VRM10.Samples.VRM10RuntimeExporter",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:da3e51d19d51a544fa14d43fee843098",
|
||||
"GUID:8d76e605759c3f64a957d63ef96ada7c",
|
||||
"GUID:1cd941934d098654fa21a13f28346412",
|
||||
"GUID:60c8346e00a8ddd4cafc5a02eceeec57",
|
||||
"GUID:0aaf403bd13871a44b7127aef2695ff8",
|
||||
"GUID:8d76e605759c3f64a957d63ef96ada7c",
|
||||
"GUID:e47c917724578cc43b5506c17a27e9a0",
|
||||
"GUID:2ef84b520212e174a94668c7a0862d3b"
|
||||
],
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace UniVRM10.RuntimeExporterSample
|
||||
// // add blendshape clip to avatar.Clips
|
||||
// var clip = ScriptableObject.CreateInstance<BlendShapeClip>();
|
||||
// var name = $"custom#{avatar.Clips.Count}";
|
||||
// Debug.Log($"Add {name}");
|
||||
// UniGLTFLogger.Log($"Add {name}");
|
||||
// // unity asset name
|
||||
// clip.name = name;
|
||||
// // vrm export name
|
||||
@@ -130,7 +130,7 @@ namespace UniVRM10.RuntimeExporterSample
|
||||
var bytes = ExportSimple(m_settings, model, m_meta);
|
||||
|
||||
File.WriteAllBytes(path, bytes);
|
||||
Debug.LogFormat("export to {0}", path);
|
||||
UniGLTFLogger.Log($"export to {path}");
|
||||
}
|
||||
|
||||
static byte[] ExportSimple(GltfExportSettings settings, GameObject root, VRM10ObjectMeta meta)
|
||||
@@ -141,7 +141,7 @@ namespace UniVRM10.RuntimeExporterSample
|
||||
var model = converter.Export(settings, arrayManager, root);
|
||||
|
||||
// 右手系に変換
|
||||
Debug.Log($"convert to right handed coordinate...");
|
||||
UniGLTFLogger.Log($"convert to right handed coordinate...");
|
||||
model.ConvertCoordinate(VrmLib.Coordinates.Vrm1, ignoreVrm: false);
|
||||
|
||||
// export vrm-1.0
|
||||
@@ -156,7 +156,7 @@ namespace UniVRM10.RuntimeExporterSample
|
||||
|
||||
void OnExported(UniGLTF.glTF vrm)
|
||||
{
|
||||
Debug.LogFormat("exported");
|
||||
UniGLTFLogger.Log("exported");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace UniVRM10.VRM10Viewer
|
||||
// NOTE: Fallback to default material
|
||||
if (Symbols.VRM_DEVELOP)
|
||||
{
|
||||
Debug.LogWarning($"material: {i} out of range. fallback");
|
||||
UniGLTFLogger.Warning($"material: {i} out of range. fallback");
|
||||
}
|
||||
return GetGltfDefault(GltfMaterialImportUtils.ImportMaterialName(i, null));
|
||||
}
|
||||
|
||||
@@ -683,7 +683,7 @@ namespace UniVRM10.VRM10Viewer
|
||||
var ext = Path.GetExtension(path).ToLower();
|
||||
if (ext != ".vrm")
|
||||
{
|
||||
Debug.LogWarning($"{path} is not vrm");
|
||||
UniGLTFLogger.Warning($"{path} is not vrm");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -696,7 +696,7 @@ namespace UniVRM10.VRM10Viewer
|
||||
/// </summary>
|
||||
public void FileSelected(string url)
|
||||
{
|
||||
Debug.Log($"FileSelected: {url}");
|
||||
UniGLTFLogger.Log($"FileSelected: {url}");
|
||||
StartCoroutine(LoadCoroutine(url));
|
||||
}
|
||||
|
||||
@@ -750,11 +750,11 @@ namespace UniVRM10.VRM10Viewer
|
||||
}
|
||||
catch (UniJSON.ParserException)
|
||||
{
|
||||
Debug.LogWarning("UniJSON.ParserException");
|
||||
UniGLTFLogger.Warning("UniJSON.ParserException");
|
||||
}
|
||||
catch (UniJSON.DeserializationException)
|
||||
{
|
||||
Debug.LogWarning("UniJSON.DeserializationException");
|
||||
UniGLTFLogger.Warning("UniJSON.DeserializationException");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -837,7 +837,7 @@ namespace UniVRM10.VRM10Viewer
|
||||
|
||||
try
|
||||
{
|
||||
Debug.LogFormat("{0}", path);
|
||||
UniGLTFLogger.Log($"{path}");
|
||||
var vrm10Instance = await Vrm10.LoadBytesAsync(bytes,
|
||||
canLoadVrm0X: true,
|
||||
showMeshes: false,
|
||||
@@ -854,7 +854,7 @@ namespace UniVRM10.VRM10Viewer
|
||||
|
||||
if (vrm10Instance == null)
|
||||
{
|
||||
Debug.LogWarning("LoadPathAsync is null");
|
||||
UniGLTFLogger.Warning("LoadPathAsync is null");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -880,12 +880,12 @@ namespace UniVRM10.VRM10Viewer
|
||||
{
|
||||
if (ex is OperationCanceledException)
|
||||
{
|
||||
Debug.LogWarning($"Canceled to Load: {path}");
|
||||
UniGLTFLogger.Warning($"Canceled to Load: {path}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError($"Failed to Load: {path}");
|
||||
Debug.LogException(ex);
|
||||
UniGLTFLogger.Error($"Failed to Load: {path}");
|
||||
UniGLTFLogger.Exception(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
18
Assets/VRM_Samples/BlendShapeMenu/BlendShapeMenu.asmdef
Normal file
18
Assets/VRM_Samples/BlendShapeMenu/BlendShapeMenu.asmdef
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "BlendShapeMenu",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:8d76e605759c3f64a957d63ef96ada7c",
|
||||
"GUID:1cd941934d098654fa21a13f28346412",
|
||||
"GUID:05dd262a0c0a2f841b8252c8c3815582"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 65a83bac7c049b341b41b20eac1c926d
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using UniGLTF;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -82,11 +83,10 @@ namespace VRM.Sample.BlendShapeMenu
|
||||
[MenuItem("CONTEXT/BlendShapeAvatar/Add ARKit FaceTracking BlendShapes")]
|
||||
public static void AddARKitFaceTrackingBlendShapes(MenuCommand command)
|
||||
{
|
||||
// Debug.Log(command.context);
|
||||
var avatar = command.context as BlendShapeAvatar;
|
||||
if (avatar == null)
|
||||
{
|
||||
Debug.LogError("no context");
|
||||
UniGLTFLogger.Error("no context");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -124,17 +124,16 @@ namespace VRM.Sample.BlendShapeMenu
|
||||
avatar.Clips.Add(clip);
|
||||
}
|
||||
|
||||
Debug.Log("Create\n" + sb.ToString());
|
||||
UniGLTFLogger.Log("Create\n" + sb.ToString());
|
||||
}
|
||||
|
||||
[MenuItem("CONTEXT/BlendShapeAvatar/Assign all BlendShapes in a folder")]
|
||||
static void AssginAllBlendShapesInAFolder(MenuCommand command)
|
||||
{
|
||||
// Debug.Log(command.context);
|
||||
var avatar = command.context as BlendShapeAvatar;
|
||||
if (avatar == null)
|
||||
{
|
||||
Debug.LogError("no context");
|
||||
UniGLTFLogger.Error("no context");
|
||||
return;
|
||||
}
|
||||
var assetPath = AssetDatabase.GetAssetPath(avatar);
|
||||
@@ -175,7 +174,7 @@ namespace VRM.Sample.BlendShapeMenu
|
||||
avatar.Clips.Add(clip);
|
||||
}
|
||||
|
||||
Debug.Log($"Assign\n" + sb.ToString());
|
||||
UniGLTFLogger.Log($"Assign\n" + sb.ToString());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
{
|
||||
"name": "VRM.Samples.FirstPersonSample",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:da3e51d19d51a544fa14d43fee843098",
|
||||
"GUID:b7aa47b240b57de44a4b2021c143c9bf",
|
||||
"GUID:8d76e605759c3f64a957d63ef96ada7c",
|
||||
"GUID:1cd941934d098654fa21a13f28346412",
|
||||
"GUID:b7aa47b240b57de44a4b2021c143c9bf",
|
||||
"GUID:05dd262a0c0a2f841b8252c8c3815582"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace VRM.FirstPersonSample
|
||||
{
|
||||
if (m_canvas == null)
|
||||
{
|
||||
Debug.LogWarning("no canvas");
|
||||
UniGLTFLogger.Warning("no canvas");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ namespace VRM.FirstPersonSample
|
||||
|
||||
void LoadBvh(string path)
|
||||
{
|
||||
Debug.LogFormat("ImportBvh: {0}", path);
|
||||
UniGLTFLogger.Log($"ImportBvh: {path}");
|
||||
var context = new UniHumanoid.BvhImporterContext();
|
||||
|
||||
context.Parse(path);
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
{
|
||||
"name": "VRM.Samples.RuntimeExporterSample",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:da3e51d19d51a544fa14d43fee843098",
|
||||
"GUID:8d76e605759c3f64a957d63ef96ada7c",
|
||||
"GUID:1cd941934d098654fa21a13f28346412",
|
||||
"GUID:05dd262a0c0a2f841b8252c8c3815582"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace VRM.RuntimeExporterSample
|
||||
// add blendshape clip to avatar.Clips
|
||||
var clip = ScriptableObject.CreateInstance<BlendShapeClip>();
|
||||
var name = $"custom#{avatar.Clips.Count}";
|
||||
Debug.Log($"Add {name}");
|
||||
UniGLTFLogger.Log($"Add {name}");
|
||||
// unity asset name
|
||||
clip.name = name;
|
||||
// vrm export name
|
||||
@@ -131,7 +131,7 @@ namespace VRM.RuntimeExporterSample
|
||||
var bytes = useNormalize ? ExportCustom(model, false, bakeBlendShape) : ExportSimple(model);
|
||||
|
||||
File.WriteAllBytes(path, bytes);
|
||||
Debug.LogFormat("export to {0}", path);
|
||||
UniGLTFLogger.Log($"export to {path}");
|
||||
}
|
||||
|
||||
static byte[] ExportSimple(GameObject model)
|
||||
@@ -151,7 +151,7 @@ namespace VRM.RuntimeExporterSample
|
||||
|
||||
void OnExported(UniGLTF.glTF vrm)
|
||||
{
|
||||
Debug.LogFormat("exported");
|
||||
UniGLTFLogger.Log("exported");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections;
|
||||
using UniGLTF;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
@@ -67,7 +68,7 @@ namespace VRM.SimpleViewer
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
Debug.Log("StopCoroutine");
|
||||
UniGLTFLogger.Log("StopCoroutine");
|
||||
StopCoroutine(m_coroutine);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace VRM.SimpleViewer
|
||||
return "";
|
||||
#else
|
||||
// fall back constant path
|
||||
UnityEngine.Debug.LogWarning("Non-Windows runtime file dialogs are not yet implemented.");
|
||||
UnityEngine.UniGLTFLogger.Warning("Non-Windows runtime file dialogs are not yet implemented.");
|
||||
return UnityEngine.Application.dataPath + "/default.vrm";
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
"name": "VRM.Samples.SimpleViewer",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:da3e51d19d51a544fa14d43fee843098",
|
||||
"GUID:b7aa47b240b57de44a4b2021c143c9bf",
|
||||
"GUID:8d76e605759c3f64a957d63ef96ada7c",
|
||||
"GUID:1cd941934d098654fa21a13f28346412",
|
||||
"GUID:b7aa47b240b57de44a4b2021c143c9bf",
|
||||
"GUID:05dd262a0c0a2f841b8252c8c3815582",
|
||||
"GUID:3e5d614bc16b50d41bd94c8d7444ca46"
|
||||
],
|
||||
|
||||
@@ -179,7 +179,7 @@ namespace VRM.SimpleViewer
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("motion: no toggle");
|
||||
UniGLTFLogger.Log("motion: no toggle");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -368,7 +368,7 @@ namespace VRM.SimpleViewer
|
||||
/// </summary>
|
||||
public void FileSelected(string url)
|
||||
{
|
||||
Debug.Log($"FileSelected: {url}");
|
||||
UniGLTFLogger.Log($"FileSelected: {url}");
|
||||
StartCoroutine(LoadCoroutine(url));
|
||||
}
|
||||
|
||||
@@ -386,7 +386,7 @@ namespace VRM.SimpleViewer
|
||||
{
|
||||
if (!File.Exists(path))
|
||||
{
|
||||
Debug.LogWarning($"{path} not exists");
|
||||
UniGLTFLogger.Warning($"{path} not exists");
|
||||
return;
|
||||
}
|
||||
var bytes = File.ReadAllBytes(path);
|
||||
@@ -396,7 +396,7 @@ namespace VRM.SimpleViewer
|
||||
public async Task LoadBytesAsync(string path, byte[] bytes)
|
||||
{
|
||||
var size = bytes != null ? bytes.Length : 0;
|
||||
Debug.Log($"LoadModelAsync: {path}: {size}bytes");
|
||||
UniGLTFLogger.Log($"LoadModelAsync: {path}: {size}bytes");
|
||||
|
||||
var ext = Path.GetExtension(path).ToLower();
|
||||
if (ext == ".bvh")
|
||||
|
||||
Reference in New Issue
Block a user