mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-12 05:48:47 -05:00
JsonSchemaからの再生成
* VRMC_materials_hdr_emissiveMultiplier が追加 * TextureTransformBind.Scaling => Scale rename
This commit is contained in:
@@ -41,10 +41,10 @@ namespace UniVRM10
|
||||
"vrm-specification/specification/VRMC_vrm-1.0_draft/schema/VRMC_vrm.schema.json",
|
||||
"Assets/VRM10/Runtime/Format/Vrm", // format
|
||||
"Assets/VRM10/Runtime/Format/Vrm", // serializer
|
||||
// VRMC_node_constraint
|
||||
"vrm-specification/specification/VRMC_node_constraint-1.0_draft/schema/VRMC_node_constraint.schema.json",
|
||||
"Assets/VRM10/Runtime/Format/Constraints", // format
|
||||
"Assets/VRM10/Runtime/Format/Constraints", // serializer
|
||||
// VRMC_hdr_emissiveMultiplier
|
||||
"vrm-specification/specification/VRMC_materials_hdr_emissiveMultiplier-1.0_draft/schema/VRMC_materials_hdr_emissiveMultiplier.json",
|
||||
"Assets/VRMShaders/VRM10/Format/Runtime/EmissiveMultiplier", // format
|
||||
"Assets/VRM10/Runtime/Format/EmissiveMultiplier", // serializer
|
||||
// VRMC_materials_mtoon
|
||||
"vrm-specification/specification/VRMC_materials_mtoon-1.0_draft/schema/VRMC_materials_mtoon.schema.json",
|
||||
"Assets/VRMShaders/VRM10/Format/Runtime/MaterialsMToon", // format
|
||||
@@ -53,6 +53,10 @@ namespace UniVRM10
|
||||
"vrm-specification/specification/VRMC_springBone-1.0_draft/schema/VRMC_springBone.schema.json",
|
||||
"Assets/VRM10/Runtime/Format/SpringBone", // format
|
||||
"Assets/VRM10/Runtime/Format/SpringBone", // serializer
|
||||
// VRMC_node_constraint
|
||||
"vrm-specification/specification/VRMC_node_constraint-1.0_draft/schema/VRMC_node_constraint.schema.json",
|
||||
"Assets/VRM10/Runtime/Format/Constraints", // format
|
||||
"Assets/VRM10/Runtime/Format/Constraints", // serializer
|
||||
};
|
||||
|
||||
for (int i = 0; i < args.Length; i += 3)
|
||||
|
||||
8
Assets/VRM10/Runtime/Format/EmissiveMultiplier.meta
Normal file
8
Assets/VRM10/Runtime/Format/EmissiveMultiplier.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 882d5cdaa29c5cf40bc5892189d0adba
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,60 @@
|
||||
// This file is generated from JsonSchema. Don't modify this source code.
|
||||
using UniJSON;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UniGLTF.Extensions.VRMC_materials_hdr_emissiveMultiplier {
|
||||
|
||||
public static class GltfDeserializer
|
||||
{
|
||||
public static readonly Utf8String ExtensionNameUtf8 = Utf8String.From(VRMC_materials_hdr_emissiveMultiplier.ExtensionName);
|
||||
|
||||
public static bool TryGet(UniGLTF.glTFExtension src, out VRMC_materials_hdr_emissiveMultiplier extension)
|
||||
{
|
||||
if(src is UniGLTF.glTFExtensionImport extensions)
|
||||
{
|
||||
foreach(var kv in extensions.ObjectItems())
|
||||
{
|
||||
if(kv.Key.GetUtf8String() == ExtensionNameUtf8)
|
||||
{
|
||||
extension = Deserialize(kv.Value);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public static VRMC_materials_hdr_emissiveMultiplier Deserialize(JsonNode parsed)
|
||||
{
|
||||
var value = new VRMC_materials_hdr_emissiveMultiplier();
|
||||
|
||||
foreach(var kv in parsed.ObjectItems())
|
||||
{
|
||||
var key = kv.Key.GetString();
|
||||
|
||||
if(key=="extensions"){
|
||||
value.Extensions = new glTFExtensionImport(kv.Value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(key=="extras"){
|
||||
value.Extras = new glTFExtensionImport(kv.Value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(key=="emissiveMultiplier"){
|
||||
value.EmissiveMultiplier = kv.Value.GetSingle();
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
} // GltfDeserializer
|
||||
} // UniGLTF
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 751f36caf65fbcd4a91ae0d5419fdbd8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,55 @@
|
||||
// This file is generated from JsonSchema. Don't modify this source code.
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UniJSON;
|
||||
|
||||
namespace UniGLTF.Extensions.VRMC_materials_hdr_emissiveMultiplier {
|
||||
|
||||
static public class GltfSerializer
|
||||
{
|
||||
|
||||
public static void SerializeTo(ref UniGLTF.glTFExtension dst, VRMC_materials_hdr_emissiveMultiplier extension)
|
||||
{
|
||||
if (dst is glTFExtensionImport)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
if (!(dst is glTFExtensionExport extensions))
|
||||
{
|
||||
extensions = new glTFExtensionExport();
|
||||
dst = extensions;
|
||||
}
|
||||
|
||||
var f = new JsonFormatter();
|
||||
Serialize(f, extension);
|
||||
extensions.Add(VRMC_materials_hdr_emissiveMultiplier.ExtensionName, f.GetStoreBytes());
|
||||
}
|
||||
|
||||
|
||||
public static void Serialize(JsonFormatter f, VRMC_materials_hdr_emissiveMultiplier value)
|
||||
{
|
||||
f.BeginMap();
|
||||
|
||||
|
||||
if(value.Extensions!=null){
|
||||
f.Key("extensions");
|
||||
(value.Extensions as glTFExtension).Serialize(f);
|
||||
}
|
||||
|
||||
if(value.Extras!=null){
|
||||
f.Key("extras");
|
||||
(value.Extras as glTFExtension).Serialize(f);
|
||||
}
|
||||
|
||||
if(value.EmissiveMultiplier.HasValue){
|
||||
f.Key("emissiveMultiplier");
|
||||
f.Value(value.EmissiveMultiplier.GetValueOrDefault());
|
||||
}
|
||||
|
||||
f.EndMap();
|
||||
}
|
||||
|
||||
} // class
|
||||
} // namespace
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2fc13fdbe30a3fa4381d8cb4aa8346c6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -2487,8 +2487,8 @@ public static TextureTransformBind __expressions_ITEM_Deserialize_TextureTransfo
|
||||
continue;
|
||||
}
|
||||
|
||||
if(key=="scaling"){
|
||||
value.Scaling = __expressions_ITEM__textureTransformBinds_ITEM_Deserialize_Scaling(kv.Value);
|
||||
if(key=="scale"){
|
||||
value.Scale = __expressions_ITEM__textureTransformBinds_ITEM_Deserialize_Scale(kv.Value);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -2501,7 +2501,7 @@ public static TextureTransformBind __expressions_ITEM_Deserialize_TextureTransfo
|
||||
return value;
|
||||
}
|
||||
|
||||
public static float[] __expressions_ITEM__textureTransformBinds_ITEM_Deserialize_Scaling(JsonNode parsed)
|
||||
public static float[] __expressions_ITEM__textureTransformBinds_ITEM_Deserialize_Scale(JsonNode parsed)
|
||||
{
|
||||
var value = new float[parsed.GetArrayCount()];
|
||||
int i=0;
|
||||
|
||||
@@ -457,7 +457,7 @@ namespace UniGLTF.Extensions.VRMC_vrm
|
||||
public int? Material;
|
||||
|
||||
// uv scaling for TEXCOORD_0
|
||||
public float[] Scaling;
|
||||
public float[] Scale;
|
||||
|
||||
// uv offset for TEXCOORD_0
|
||||
public float[] Offset;
|
||||
|
||||
@@ -2223,9 +2223,9 @@ public static void __expressions_ITEM_Serialize_TextureTransformBinds_ITEM(JsonF
|
||||
f.Value(value.Material.GetValueOrDefault());
|
||||
}
|
||||
|
||||
if(value.Scaling!=null&&value.Scaling.Count()>=2){
|
||||
f.Key("scaling");
|
||||
__expressions_ITEM__textureTransformBinds_ITEM_Serialize_Scaling(f, value.Scaling);
|
||||
if(value.Scale!=null&&value.Scale.Count()>=2){
|
||||
f.Key("scale");
|
||||
__expressions_ITEM__textureTransformBinds_ITEM_Serialize_Scale(f, value.Scale);
|
||||
}
|
||||
|
||||
if(value.Offset!=null&&value.Offset.Count()>=2){
|
||||
@@ -2236,7 +2236,7 @@ public static void __expressions_ITEM_Serialize_TextureTransformBinds_ITEM(JsonF
|
||||
f.EndMap();
|
||||
}
|
||||
|
||||
public static void __expressions_ITEM__textureTransformBinds_ITEM_Serialize_Scaling(JsonFormatter f, float[] value)
|
||||
public static void __expressions_ITEM__textureTransformBinds_ITEM_Serialize_Scale(JsonFormatter f, float[] value)
|
||||
{
|
||||
f.BeginList();
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace UniVRM10
|
||||
binding = new UniVRM10.MaterialUVBinding
|
||||
{
|
||||
MaterialName = material.name, // 名前で持つべき
|
||||
Scaling = new Vector2(bind.Scaling[0], bind.Scaling[1]),
|
||||
Scaling = new Vector2(bind.Scale[0], bind.Scale[1]),
|
||||
Offset = new Vector2(bind.Offset[0], bind.Offset[1]),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -547,7 +547,7 @@ namespace UniVRM10
|
||||
{
|
||||
Material = getIndex(binding.MaterialName),
|
||||
Offset = new float[] { binding.Offset.x, binding.Offset.y },
|
||||
Scaling = new float[] { binding.Scaling.x, binding.Scaling.y },
|
||||
Scale = new float[] { binding.Scaling.x, binding.Scaling.y },
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace UniVRM10
|
||||
expression.TextureTransformBinds.Add(new UniGLTF.Extensions.VRMC_vrm.TextureTransformBind
|
||||
{
|
||||
Material = materialIndex,
|
||||
Scaling = new float[] { targetValue[0], targetValue[1] },
|
||||
Scale = new float[] { targetValue[0], targetValue[1] },
|
||||
Offset = new float[] { targetValue[2], targetValue[3] }
|
||||
});
|
||||
}
|
||||
@@ -126,7 +126,7 @@ namespace UniVRM10
|
||||
expression.TextureTransformBinds.Add(new UniGLTF.Extensions.VRMC_vrm.TextureTransformBind
|
||||
{
|
||||
Material = materialIndex,
|
||||
Scaling = new float[] { targetValue[0], 1 },
|
||||
Scale = new float[] { targetValue[0], 1 },
|
||||
Offset = new float[] { targetValue[2], 0 }
|
||||
});
|
||||
}
|
||||
@@ -135,7 +135,7 @@ namespace UniVRM10
|
||||
expression.TextureTransformBinds.Add(new UniGLTF.Extensions.VRMC_vrm.TextureTransformBind
|
||||
{
|
||||
Material = materialIndex,
|
||||
Scaling = new float[] { 1, targetValue[1] },
|
||||
Scale = new float[] { 1, targetValue[1] },
|
||||
Offset = new float[] { 0, targetValue[3] }
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 518b8156a8ff0e946856b1517070e0f8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,22 @@
|
||||
// This file is generated from JsonSchema. Don't modify this source code.
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace UniGLTF.Extensions.VRMC_materials_hdr_emissiveMultiplier
|
||||
{
|
||||
|
||||
public class VRMC_materials_hdr_emissiveMultiplier
|
||||
{
|
||||
public const string ExtensionName = "VRMC_materials_hdr_emissiveMultiplier";
|
||||
|
||||
// Dictionary object with extension-specific objects.
|
||||
public object Extensions;
|
||||
|
||||
// Application-specific data.
|
||||
public object Extras;
|
||||
|
||||
// A multiplier for emissiveFactor
|
||||
public float? EmissiveMultiplier;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 222764601817e1f459cb9ce3119ab0be
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user