Skip to content

Commit

Permalink
Merge pull request #2475 from ousttrue/version/v0_127_2
Browse files Browse the repository at this point in the history
UniVRM-0.127.2
  • Loading branch information
ousttrue authored Oct 25, 2024
2 parents 7dc74ea + 8f0cbd8 commit 91636a6
Show file tree
Hide file tree
Showing 16 changed files with 32,109 additions and 4,376 deletions.
4 changes: 2 additions & 2 deletions Assets/UniGLTF/Runtime/UniGLTF/PackageVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public static partial class PackageVersion
{
public const int MAJOR = 0;
public const int MINOR = 127;
public const int PATCH = 1;
public const string VERSION = "0.127.1";
public const int PATCH = 2;
public const string VERSION = "0.127.2";
}
}
4 changes: 2 additions & 2 deletions Assets/UniGLTF/Runtime/UniGLTF/UniGLTFVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public static partial class UniGLTFVersion
{
public const int MAJOR = 2;
public const int MINOR = 63;
public const int PATCH = 1;
public const string VERSION = "2.63.1";
public const int PATCH = 2;
public const string VERSION = "2.63.2";
}
}
2 changes: 1 addition & 1 deletion Assets/UniGLTF/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.vrmc.gltf",
"version": "0.127.1",
"version": "0.127.2",
"displayName": "UniGLTF",
"description": "GLTF importer and exporter",
"unity": "2021.3",
Expand Down
13 changes: 8 additions & 5 deletions Assets/VRM/Samples~/RuntimeExporterSample/VRMRuntimeExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ public class VRMRuntimeExporter : MonoBehaviour
[SerializeField]
public bool UseNormalize = true;

[SerializeField]
public bool BakeBlendShapes = false;

GameObject m_model;

void OnGUI()
Expand All @@ -29,7 +32,7 @@ void OnGUI()

if (GUILayout.Button("Export"))
{
Export(m_model, UseNormalize);
Export(m_model, UseNormalize, BakeBlendShapes);
}
}

Expand Down Expand Up @@ -112,7 +115,7 @@ static void AddBlendShapeClip(GameObject go)
}


static void Export(GameObject model, bool useNormalize)
static void Export(GameObject model, bool useNormalize, bool bakeBlendShape)
{
//#if UNITY_STANDALONE_WIN
#if false
Expand All @@ -125,7 +128,7 @@ static void Export(GameObject model, bool useNormalize)
return;
}

var bytes = useNormalize ? ExportCustom(model) : ExportSimple(model);
var bytes = useNormalize ? ExportCustom(model, false, bakeBlendShape) : ExportSimple(model);

File.WriteAllBytes(path, bytes);
Debug.LogFormat("export to {0}", path);
Expand All @@ -138,10 +141,10 @@ static byte[] ExportSimple(GameObject model)
return bytes;
}

static byte[] ExportCustom(GameObject exportRoot, bool forceTPose = false)
static byte[] ExportCustom(GameObject exportRoot, bool forceTPose, bool bakeBlendShape)
{
// normalize
VRMBoneNormalizer.Execute(exportRoot, forceTPose);
VRMBoneNormalizer.Execute(exportRoot, forceTPose, bakeBlendShape);

return ExportSimple(exportRoot);
}
Expand Down
6 changes: 3 additions & 3 deletions Assets/VRM/Samples~/SimpleViewer/ViewerUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ namespace VRM.SimpleViewer
/// </summary>
public class ViewerUI : MonoBehaviour
{
[SerializeField]
TextFields m_texts = default;

#region UI
[SerializeField]
Text m_version = default;
Expand Down Expand Up @@ -146,9 +149,6 @@ public void UpdateMeta(VRMMetaObject meta)
}
}

[SerializeField]
TextFields m_texts = default;

[Serializable]
class UIFields
{
Expand Down
4 changes: 2 additions & 2 deletions Assets/VRM/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.vrmc.univrm",
"version": "0.127.1",
"version": "0.127.2",
"displayName": "VRM",
"description": "VRM importer",
"unity": "2021.3",
Expand All @@ -14,7 +14,7 @@
"name": "VRM Consortium"
},
"dependencies": {
"com.vrmc.gltf": "0.127.1",
"com.vrmc.gltf": "0.127.2",
"com.unity.ugui": "1.0.0"
},
"samples": [
Expand Down
54 changes: 54 additions & 0 deletions Assets/VRM10/Samples~/VRM10Viewer/FaceCameraTarget.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!86 &8600000
CustomRenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: FaceCameraTarget
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
m_IsAlphaChannelOptional: 0
serializedVersion: 5
m_Width: 300
m_Height: 300
m_AntiAliasing: 1
m_MipCount: -1
m_DepthStencilFormat: 94
m_ColorFormat: 8
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 0
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1
m_ShadowSamplingMode: 2
m_Material: {fileID: 0}
m_InitSource: 0
m_InitMaterial: {fileID: 0}
m_InitColor: {r: 1, g: 1, b: 1, a: 1}
m_InitTexture: {fileID: 0}
m_UpdateMode: 0
m_InitializationMode: 2
m_UpdateZoneSpace: 0
m_CurrentUpdateZoneSpace: 0
m_UpdateZones: []
m_UpdatePeriod: 0
m_ShaderPass: 0
m_CubemapFaceMask: 4294967295
m_DoubleBuffered: 0
m_WrapUpdateZones: 0
8 changes: 8 additions & 0 deletions Assets/VRM10/Samples~/VRM10Viewer/FaceCameraTarget.asset.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 19 additions & 14 deletions Assets/VRM10/Samples~/VRM10Viewer/VRM10AIUEO.cs
Original file line number Diff line number Diff line change
@@ -1,46 +1,51 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;


namespace UniVRM10.VRM10Viewer
{
public class VRM10AIUEO : MonoBehaviour
{
[SerializeField]
public Vrm10Instance Controller;
private void Reset()
{
Controller = GetComponent<Vrm10Instance>();
}

Coroutine m_coroutine;

[SerializeField]
float m_wait = 0.5f;

private void Awake()
public float Aa = 0.0f;
public float Ih = 0.0f;
public float Ou = 0.0f;
public float Ee = 0.0f;
public float Oh = 0.0f;

void SetWeight(ExpressionPreset preset, float value)
{
if (Controller == null)
switch (preset)
{
Controller = GetComponent<Vrm10Instance>();
case ExpressionPreset.aa: Aa = value; break;
case ExpressionPreset.ih: Ih = value; break;
case ExpressionPreset.ou: Ou = value; break;
case ExpressionPreset.ee: Ee = value; break;
case ExpressionPreset.oh: Oh = value; break;
default: break;
}
}

IEnumerator RoutineNest(ExpressionPreset preset, float velocity, float wait)
{
for (var value = 0.0f; value <= 1.0f; value += velocity)
{
Controller.Runtime.Expression.SetWeight(ExpressionKey.CreateFromPreset(preset), value);
SetWeight(preset, value);
yield return null;
}
Controller.Runtime.Expression.SetWeight(ExpressionKey.CreateFromPreset(preset), 1.0f);
SetWeight(preset, 1.0f);
yield return new WaitForSeconds(wait);
for (var value = 1.0f; value >= 0; value -= velocity)
{
Controller.Runtime.Expression.SetWeight(ExpressionKey.CreateFromPreset(preset), value);
SetWeight(preset, value);
yield return null;
}
Controller.Runtime.Expression.SetWeight(ExpressionKey.CreateFromPreset(preset), 0);
SetWeight(preset, 0);
yield return new WaitForSeconds(wait * 2);
}

Expand Down
32 changes: 18 additions & 14 deletions Assets/VRM10/Samples~/VRM10Viewer/VRM10AutoExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,45 @@ namespace UniVRM10.VRM10Viewer
/// </summary>
public class VRM10AutoExpression : MonoBehaviour
{
[SerializeField]
public Vrm10Instance Controller;
private void Reset()
{
Controller = GetComponent<Vrm10Instance>();
}

Coroutine m_coroutine;

[SerializeField]
float m_wait = 0.5f;

private void Awake()
public float Happy = 0.0f;
public float Angry = 0.0f;
public float Sad = 0.0f;
public float Relaxed = 0.0f;
public float Surprised = 0.0f;

void SetWeight(ExpressionPreset preset, float value)
{
if (Controller == null)
switch (preset)
{
Controller = GetComponent<Vrm10Instance>();
case ExpressionPreset.happy: Happy = value; break;
case ExpressionPreset.angry: Angry = value; break;
case ExpressionPreset.sad: Sad = value; break;
case ExpressionPreset.relaxed: Relaxed = value; break;
case ExpressionPreset.surprised: Surprised = value; break;
default: break;
}
}

IEnumerator RoutineNest(ExpressionPreset preset, float velocity, float wait)
{
for (var value = 0.0f; value <= 1.0f; value += velocity)
{
Controller.Runtime.Expression.SetWeight(ExpressionKey.CreateFromPreset(preset), value);
SetWeight(preset, value);
yield return null;
}
Controller.Runtime.Expression.SetWeight(ExpressionKey.CreateFromPreset(preset), 1.0f);
SetWeight(preset, 1.0f);
yield return new WaitForSeconds(wait);
for (var value = 1.0f; value >= 0; value -= velocity)
{
Controller.Runtime.Expression.SetWeight(ExpressionKey.CreateFromPreset(preset), value);
SetWeight(preset, value);
yield return null;
}
Controller.Runtime.Expression.SetWeight(ExpressionKey.CreateFromPreset(preset), 0);
SetWeight(preset, 0);
yield return new WaitForSeconds(wait * 2);
}

Expand Down
13 changes: 6 additions & 7 deletions Assets/VRM10/Samples~/VRM10Viewer/VRM10Blinker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ namespace UniVRM10.VRM10Viewer
/// </summary>
public class VRM10Blinker : MonoBehaviour
{
Vrm10Instance m_controller;

[FormerlySerializedAs("m_interVal")]
[SerializeField]
public float Interval = 5.0f;
Expand Down Expand Up @@ -46,6 +44,8 @@ public bool Request
}
}

public float BlinkValue = 0;

IEnumerator BlinkRoutine()
{
while (true)
Expand All @@ -72,10 +72,10 @@ IEnumerator BlinkRoutine()
break;
}

m_controller.Runtime.Expression.SetWeight(ExpressionKey.CreateFromPreset(ExpressionPreset.blink), value);
BlinkValue = value;
yield return null;
}
m_controller.Runtime.Expression.SetWeight(ExpressionKey.CreateFromPreset(ExpressionPreset.blink), 1.0f);
BlinkValue = 1.0f;

// wait...
yield return new WaitForSeconds(ClosingTime);
Expand All @@ -91,16 +91,15 @@ IEnumerator BlinkRoutine()
break;
}

m_controller.Runtime.Expression.SetWeight(ExpressionKey.CreateFromPreset(ExpressionPreset.blink), value);
BlinkValue = value;
yield return null;
}
m_controller.Runtime.Expression.SetWeight(ExpressionKey.CreateFromPreset(ExpressionPreset.blink), 0);
BlinkValue = 0;
}
}

private void OnEnable()
{
m_controller = GetComponent<Vrm10Instance>();
m_coroutine = StartCoroutine(BlinkRoutine());
}

Expand Down
Loading

0 comments on commit 91636a6

Please sign in to comment.