Assets/UniGLTF to Packages/com.vrmc.gltf

This commit is contained in:
ousttrue 2025-11-10 15:21:57 +09:00
parent 7066009559
commit a13d552c06
11 changed files with 15 additions and 64 deletions

View File

@ -13,7 +13,7 @@ namespace VRM.SimpleViewer
return FileDialogForWindows.FileDialog(title, extensions);
#elif UNITY_WEBGL
// Open WebGL_VRM0X_SimpleViewer_FileDialog
// see: Assets/UniGLTF/Runtime/Utils/Plugins/OpenFile.jslib
// see: Packages/com.vrmc.gltf/Runtime/Utils/Plugins/OpenFile.jslib
WebGLUtil.WebGL_VRM0X_SimpleViewer_FileDialog("Canvas", "FileSelected");
// Control flow does not return here. return empty string with dummy
return "";

View File

@ -8,7 +8,7 @@ namespace UniGLTF
public static class BoneInfoDrawer
{
#region Bone
const string BONE_GIZMO = "Assets/UniGLTF/Editor/UniGLTF/Gizmo/Models/BoneGizmo.prefab";
const string BONE_GIZMO = "Packages/com.vrmc.gltf/Editor/UniGLTF/Gizmo/Models/BoneGizmo.prefab";
static GameObject _bone;
static GameObject BonePrefab
{
@ -57,7 +57,7 @@ namespace UniGLTF
#endregion
#region Selected
const string SELECTED_BONE_GIZMO = "Assets/UniGLTF/Editor/UniGLTF/Gizmo/Models/SelectedBoneGizmo.prefab";
const string SELECTED_BONE_GIZMO = "Packages/com.vrmc.gltf/Editor/UniGLTF/Gizmo/Models/SelectedBoneGizmo.prefab";
static GameObject _selected;
static GameObject SelectedPrefab
{
@ -110,7 +110,7 @@ namespace UniGLTF
#endregion
#region Hover
const string HOVER_BONE_GIZMO = "Assets/UniGLTF/Editor/UniGLTF/Gizmo/Models/HoverBoneGizmo.prefab";
const string HOVER_BONE_GIZMO = "Packages/com.vrmc.gltf/Editor/UniGLTF/Gizmo/Models/HoverBoneGizmo.prefab";
static GameObject _hover;
static GameObject HoverPrefab
{

View File

@ -320,7 +320,7 @@ namespace UniGLTF
[Test]
public void Preprocess_DupMorphTargetName()
{
var asset = UnityEditor.AssetDatabase.LoadAssetAtPath<TextAsset>("Assets/UniGLTF/Tests/UniGLTF/gltfTutorial_017_SimpleMorphTarget.txt");
var asset = UnityEditor.AssetDatabase.LoadAssetAtPath<TextAsset>("Packages/com.vrmc.gltf/Tests/UniGLTF/gltfTutorial_017_SimpleMorphTarget.txt");
Assert.True(asset);
var gltf = GlbLowLevelParser.ParseGltf("tmp", asset.text, null, null, default);
Assert.AreEqual(1, gltf.GLTF.nodes.Count);

View File

@ -2,7 +2,7 @@
{
public static class TestAssets
{
public static readonly string AssetPath = "Assets/UniGLTF/Tests/Objects";
public static readonly string AssetPath = "Packages/com.vrmc.gltf/Tests/Objects";
public static T LoadAsset<T>(string filename) where T : UnityEngine.Object
{

View File

@ -22,7 +22,7 @@ namespace VRM
/// <summary>
/// UNIGLTF
/// </summary>
static string UniGltfVersionPath = "Assets/UniGLTF/Runtime/UniGLTF/UniGLTFVersion.cs";
static string UniGltfVersionPath = "Packages/UniGLTF/Runtime/UniGLTF/UniGLTFVersion.cs";
const string UniGltfVersionTemplate = @"
namespace UniGLTF
@ -40,7 +40,7 @@ namespace UniGLTF
/// <summary>
/// VRM
/// </summary>
const string VrmVersionPath = "Assets/UniGLTF/Runtime/UniGLTF/PackageVersion.cs";
const string VrmVersionPath = "Packages/UniGLTF/Runtime/UniGLTF/PackageVersion.cs";
const string VrmVersionTemplate = @"
namespace UniGLTF
{{
@ -68,7 +68,7 @@ namespace UniGLTF
UpmPackage[] Packages = new UpmPackage[]
{
new UpmPackage("Assets/VRM/package.json",
new UpmPackage("Packages/VRM/package.json",
@"{{
""name"": ""com.vrmc.univrm"",
""version"": ""{1}"",
@ -113,7 +113,7 @@ namespace UniGLTF
}}
"),
new UpmPackage("Assets/VRM10/package.json",
new UpmPackage("Packages/VRM10/package.json",
@"{{
""name"": ""com.vrmc.vrm"",
""version"": ""{1}"",
@ -155,7 +155,7 @@ namespace UniGLTF
};
UpmPackage UniGLTFPackage = new UpmPackage("Assets/UniGLTF/package.json",
UpmPackage UniGLTFPackage = new UpmPackage("Packages/UniGLTF/package.json",
@"{{
""name"": ""com.vrmc.gltf"",
""version"": ""{0}"",

View File

@ -1,21 +0,0 @@
# VRM
The core library for UniVRM-0.XX.
## Import VRM (Unity 2019.3.4f1~)
`Window` -> `Package Manager` -> `Add package from git URL` and add the followings in order:
* `https://github.com/vrm-c/UniVRM.git?path=/Assets/VRMShaders`
* `https://github.com/vrm-c/UniVRM.git?path=/Assets/VRM` => depends on VRMShaders
or add the package name and git URL in `Packages/manifest.json`:
```json
{
"dependencies": {
"com.vrmc.vrmshaders": "https://github.com/vrm-c/UniVRM.git?path=/Assets/VRMShaders",
"com.vrmc.univrm": "https://github.com/vrm-c/UniVRM.git?path=/Assets/VRM",
}
}
```

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 27376b07a49e57442a9c2d6a2a0805b9
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -8,11 +8,6 @@ namespace UniVRM10
/// </summary>
public static class PackageResource
{
/// <summary>
/// Local時のAssetPath
/// </summary>
public const string LocalBase = "Assets/VRM10";
/// <summary>
/// UPM参照時のAssetPath
/// </summary>
@ -26,14 +21,8 @@ namespace UniVRM10
/// <returns></returns>
public static T ResourceLocalOrUPM<T>(string relpath) where T : UnityEngine.Object
{
var path = $"{LocalBase}/{relpath}";
var asset = AssetDatabase.LoadAssetAtPath<T>(path);
if (asset is null)
{
path = $"{PackageResource.PackageBase}/{relpath}";
asset = AssetDatabase.LoadAssetAtPath<T>(path);
}
return asset;
var path = $"{PackageResource.PackageBase}/{relpath}";
return AssetDatabase.LoadAssetAtPath<T>(path);
}
}
}
}

View File

@ -28,11 +28,6 @@ namespace UniVRM10
// try package
_AssetIcon = UnityEditor.AssetDatabase.LoadAssetAtPath<Texture2D>("Packages/com.vrmc.vrm/Icons/vrm-48x48.png");
}
if (_AssetIcon == null)
{
// try assets
_AssetIcon = UnityEditor.AssetDatabase.LoadAssetAtPath<Texture2D>("Assets/VRM10/Icons/vrm-48x48.png");
}
return _AssetIcon;
}
}

View File

@ -22,11 +22,6 @@ namespace UniVRM10
// try package
_AssetIcon = UnityEditor.AssetDatabase.LoadAssetAtPath<Texture2D>("Packages/com.vrmc.vrm/Icons/vrm-48x48.png");
}
if (_AssetIcon == null)
{
// try assets
_AssetIcon = UnityEditor.AssetDatabase.LoadAssetAtPath<Texture2D>("Assets/VRM10/Icons/vrm-48x48.png");
}
return _AssetIcon;
}
}

View File

@ -35,7 +35,7 @@ namespace UniVRM10
}
private const string Vrm10SpecDir = "vrm-specification/specification";
private const string Vrm10FormatGeneratedDir = "Assets/VRM10/Runtime/Format";
private const string Vrm10FormatGeneratedDir = "Packages/VRM10/Runtime/Format";
public static void Run(bool debug)
{