mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-06-02 22:14:30 -05:00
Vrm10Importer で Neutral を Custom から救出するコードを追加
This commit is contained in:
parent
cca4a54b0b
commit
bc7b6ffda1
|
|
@ -9,6 +9,8 @@ namespace UniVRM10
|
|||
[Serializable]
|
||||
public sealed class VRM10ObjectExpression
|
||||
{
|
||||
public const string NEUTRAL_KEY = "Neutral";
|
||||
|
||||
#region Preset
|
||||
[SerializeField, Header("Emotion")]
|
||||
public VRM10Expression Happy;
|
||||
|
|
|
|||
|
|
@ -427,6 +427,14 @@ namespace UniVRM10
|
|||
{
|
||||
var key = ExpressionKey.CreateCustom(name);
|
||||
var preset = ExpressionPreset.custom;
|
||||
if (preset == ExpressionPreset.custom && name == VRM10ObjectExpression.NEUTRAL_KEY)
|
||||
{
|
||||
// TODO:
|
||||
// 注意!JsonSchema の更新待ち?
|
||||
key = ExpressionKey.CreateFromPreset(ExpressionPreset.neutral);
|
||||
Debug.Log($"set neutral");
|
||||
preset = ExpressionPreset.neutral;
|
||||
}
|
||||
var clip = GetOrLoadExpression(key.SubAssetKey, preset, expression);
|
||||
if (clip != null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@ namespace UniVRM10
|
|||
/// </summary>
|
||||
public static class MigrationVrm
|
||||
{
|
||||
const string NEUTRAL_KEY = "Neutral";
|
||||
|
||||
public static byte[] Migrate(byte[] src)
|
||||
{
|
||||
var data = new GlbBinaryParser(src, "migration").Parse();
|
||||
|
|
@ -101,7 +99,7 @@ namespace UniVRM10
|
|||
case ExpressionPreset.neutral:
|
||||
// TODO: 仕様確定待ち
|
||||
// Presetに格上げするか、小文字にする
|
||||
vrm1.Expressions.Custom[NEUTRAL_KEY] = expression;
|
||||
vrm1.Expressions.Custom[VRM10ObjectExpression.NEUTRAL_KEY] = expression;
|
||||
break;
|
||||
case ExpressionPreset.custom:
|
||||
if (vrm1.Expressions.Custom.ContainsKey(customName))
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user