diff --git a/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/MainView.uxml b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/MainView.uxml
index 92e41d3ab..7420704e1 100644
--- a/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/MainView.uxml
+++ b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/MainView.uxml
@@ -2,12 +2,13 @@
+
-
-
+
+
diff --git a/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/MetaView.uxml b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/MetaView.uxml
index c02bc207d..12ee20d7d 100644
--- a/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/MetaView.uxml
+++ b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/MetaView.uxml
@@ -1,15 +1,23 @@
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/TextureElement.cs b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/TextureElement.cs
new file mode 100644
index 000000000..0c075720a
--- /dev/null
+++ b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/TextureElement.cs
@@ -0,0 +1,28 @@
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UIElements;
+
+class TextureElement : VisualElement
+{
+ public TextureElement()
+ {
+ }
+
+ public new class UxmlFactory : UxmlFactory { }
+
+ public new class UxmlTraits : VisualElement.UxmlTraits
+ {
+ UxmlStringAttributeDescription m_texture = new UxmlStringAttributeDescription { name = "texture" };
+
+ public override IEnumerable uxmlChildElementsDescription
+ {
+ get { yield break; }
+ }
+
+ public override void Init(VisualElement ve, IUxmlAttributes bag, CreationContext cc)
+ {
+ base.Init(ve, bag, cc);
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/TextureElement.cs.meta b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/TextureElement.cs.meta
new file mode 100644
index 000000000..bf9a253be
--- /dev/null
+++ b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/TextureElement.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 86156a871ed177a429f86e309a5a549c
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/VRM10MainView.cs b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/VRM10MainView.cs
index ece9f7500..40f218c3a 100644
--- a/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/VRM10MainView.cs
+++ b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/VRM10MainView.cs
@@ -1,3 +1,4 @@
+using System;
using UniGLTF;
using UniGLTF.SpringBoneJobs.Blittables;
using UnityEngine;
@@ -35,6 +36,22 @@ namespace UniVRM10.VRM10Viewer
Toggle m_useSpringboneScaling;
Toggle m_showBoxMan;
+ // meta
+ TextField m_metaName;
+ TextField m_metaVersion;
+ TextField m_metaAuthor;
+ TextField m_metaCopyright;
+ TextField m_metaContact;
+ TextField m_metaReference;
+ TextureElement m_metaThumbnail;
+
+ TextField m_metaPermissionAllowed;
+ TextField m_metaPermissionViolent;
+ TextField m_metaPermissionSexual;
+ TextField m_metaPermissionCommercial;
+ TextField m_metaLicense;
+ TextField m_metaDistribution;
+
void QueryOrAssert(out T dst, VisualElement root, string name) where T : VisualElement
{
dst = root.Q(name);
@@ -72,6 +89,21 @@ namespace UniVRM10.VRM10Viewer
QueryOrAssert(out m_useSpringboneScaling, root, "UseSpringboneScaling");
QueryOrAssert(out m_showBoxMan, root, "ShowBoxMan");
+ // meta
+ QueryOrAssert(out m_metaName, root, "MetaName");
+ QueryOrAssert(out m_metaVersion, root, "MetaVersion");
+ QueryOrAssert(out m_metaAuthor, root, "MetaAuthor");
+ QueryOrAssert(out m_metaCopyright, root, "MetaCopyright");
+ QueryOrAssert(out m_metaContact, root, "MetaContact");
+ QueryOrAssert(out m_metaReference, root, "MetaReference");
+ QueryOrAssert(out m_metaThumbnail, root, "Thumbnail");
+ QueryOrAssert(out m_metaPermissionAllowed, root, "PermissionAllowed");
+ QueryOrAssert(out m_metaPermissionViolent, root, "PermissionViolent");
+ QueryOrAssert(out m_metaPermissionSexual, root, "PermissionSexual");
+ QueryOrAssert(out m_metaPermissionCommercial, root, "PermissionCommercial");
+ QueryOrAssert(out m_metaLicense, root, "MetaLicense");
+ QueryOrAssert(out m_metaDistribution, root, "MetaDistribution");
+
// m_autoEmotion = gameObject.AddComponent();
// m_autoBlink = gameObject.AddComponent();
// m_autoLipsync = gameObject.AddComponent();
@@ -257,43 +289,54 @@ namespace UniVRM10.VRM10Viewer
public void UpdateMeta(Texture2D thumbnail, UniGLTF.Extensions.VRMC_vrm.Meta meta, Migration.Vrm0Meta meta0)
{
- // m_thumbnail.texture = thumbnail;
-
- if (meta != null)
+ try
{
- m_textModelTitle.text = meta.Name;
- // m_textModelVersion.text = meta.Version;
- // m_textModelAuthor.text = meta.Authors[0];
- // m_textModelCopyright.text = meta.CopyrightInformation;
- // m_textModelContact.text = meta.ContactInformation;
- // if (meta.References != null && meta.References.Count > 0)
- // {
- // m_textModelReference.text = meta.References[0];
- // }
- // m_textPermissionAllowed.text = meta.AvatarPermission.ToString();
- // m_textPermissionViolent.text = meta.AllowExcessivelyViolentUsage.ToString();
- // m_textPermissionSexual.text = meta.AllowExcessivelySexualUsage.ToString();
- // m_textPermissionCommercial.text = meta.CommercialUsage.ToString();
- // // m_textPermissionOther.text = meta.OtherPermissionUrl;
+ m_metaThumbnail.style.backgroundImage = thumbnail;
+
+ if (meta != null)
+ {
+ m_metaName.value = meta.Name;
+ m_metaVersion.value = meta.Version;
+ m_metaAuthor.value = meta.Authors[0];
+ m_metaCopyright.value = meta.CopyrightInformation;
+ m_metaContact.value = meta.ContactInformation;
+ if (meta.References != null && meta.References.Count > 0)
+ {
+ m_metaReference.value = meta.References[0];
+ }
+ else
+ {
+ m_metaReference.value = "";
+ }
+
+ m_metaPermissionAllowed.value = meta.AvatarPermission.ToString();
+ m_metaPermissionViolent.value = meta.AllowExcessivelyViolentUsage.ToString();
+ m_metaPermissionSexual.value = meta.AllowExcessivelySexualUsage.ToString();
+ m_metaPermissionCommercial.value = meta.CommercialUsage.ToString();
+ m_metaLicense.value = meta.LicenseUrl;
+ m_metaDistribution.value = meta.Modification.ToString();
+ }
+
+ if (meta0 != null)
+ {
+ m_metaName.value = meta0.title;
+ m_metaVersion.value = meta0.version;
+ m_metaAuthor.value = meta0.author;
+ m_metaContact.value = meta0.contactInformation;
+ m_metaReference.value = meta0.reference;
+
+ m_metaPermissionAllowed.value = meta0.allowedUser.ToString();
+ m_metaPermissionViolent.value = meta0.violentUsage.ToString();
+ m_metaPermissionSexual.value = meta0.sexualUsage.ToString();
+ m_metaPermissionCommercial.value = meta0.commercialUsage.ToString();
+ m_metaLicense.value = meta0.licenseType.ToString();
+ m_metaDistribution.value = "";
+ }
- // // m_textDistributionLicense.text = meta.ModificationLicense.ToString();
- // m_textDistributionOther.text = meta.OtherLicenseUrl;
}
-
- if (meta0 != null)
+ catch (Exception ex)
{
- // m_textModelTitle.text = meta0.title;
- // m_textModelVersion.text = meta0.version;
- // m_textModelAuthor.text = meta0.author;
- // m_textModelContact.text = meta0.contactInformation;
- // m_textModelReference.text = meta0.reference;
- // m_textPermissionAllowed.text = meta0.allowedUser.ToString();
- // m_textPermissionViolent.text = meta0.violentUsage.ToString();
- // m_textPermissionSexual.text = meta0.sexualUsage.ToString();
- // m_textPermissionCommercial.text = meta0.commercialUsage.ToString();
- // m_textPermissionOther.text = meta0.otherPermissionUrl;
- // // m_textDistributionLicense.text = meta0.ModificationLicense.ToString();
- // m_textDistributionOther.text = meta0.otherLicenseUrl;
+ Debug.LogException(ex);
}
}
}
diff --git a/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/ui.uss b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/ui.uss
new file mode 100644
index 000000000..88a063991
--- /dev/null
+++ b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/ui.uss
@@ -0,0 +1,14 @@
+.unity-text-field {
+ font-size: 12px;
+ margin: 0;
+}
+.unity-text-field__input {
+ padding: 0;
+}
+.unity-button {
+ padding: 0;
+}
+.unity-label {
+ min-width: 60px;
+ padding: 0;
+}
\ No newline at end of file
diff --git a/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/ui.uss.meta b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/ui.uss.meta
new file mode 100644
index 000000000..43cd3873f
--- /dev/null
+++ b/Assets/VRM10_Samples/VRM10Viewer/UIToolkit/ui.uss.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ab1324f1eed77164986baf384bafef2f
+ScriptedImporter:
+ internalIDToNameTable: []
+ externalObjects: {}
+ serializedVersion: 2
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+ script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
+ disableValidation: 0