IsBinary read/write

This commit is contained in:
ousttrue
2018-11-02 22:17:13 +09:00
parent 74ab2683e5
commit 5a31c777bb
2 changed files with 9 additions and 3 deletions

View File

@@ -152,6 +152,7 @@ namespace VRM
{
asset.BlendShapeName = groupName;
asset.Preset = EnumUtil.TryParseOrDefault<BlendShapePreset>(group.presetName);
asset.IsBinary = group.isBinary;
if (asset.Preset == BlendShapePreset.Unknown)
{
// fallback
@@ -250,7 +251,7 @@ namespace VRM
AvatarDescription = GLTF.extensions.VRM.humanoid.ToDescription(Nodes);
AvatarDescription.name = "AvatarDescription";
HumanoidAvatar = AvatarDescription.CreateAvatar(Root.transform);
if(!HumanoidAvatar.isValid || !HumanoidAvatar.isHuman)
if (!HumanoidAvatar.isValid || !HumanoidAvatar.isHuman)
{
throw new Exception("fail to create avatar");
}
@@ -289,7 +290,7 @@ namespace VRM
meta.Title = gltfMeta.title;
var thumbnail = GetTexture(gltfMeta.texture);
if (thumbnail!=null)
if (thumbnail != null)
{
// ロード済み
meta.Thumbnail = thumbnail.Texture;

View File

@@ -91,7 +91,7 @@ namespace VRM
[JsonSchema(Description = "Expression name")]
public string name;
[JsonSchema(Description = "Predefined Expression name", EnumValues =new object[] {
[JsonSchema(Description = "Predefined Expression name", EnumValues = new object[] {
"unknown",
"neutral",
"a",
@@ -119,10 +119,14 @@ namespace VRM
[JsonSchema(Description = "Material animation references.")]
public List<glTF_VRM_MaterialValueBind> materialValues = new List<glTF_VRM_MaterialValueBind>();
[JsonSchema(Description = "0 or 1. Do not allow an intermediate value. Value should rounded")]
public bool isBinary;
protected override void SerializeMembers(GLTFJsonFormatter f)
{
f.KeyValue(() => name);
f.KeyValue(() => presetName);
f.KeyValue(() => isBinary);
f.KeyValue(() => binds);
f.KeyValue(() => materialValues);
}
@@ -157,6 +161,7 @@ namespace VRM
{
name = clip.BlendShapeName,
presetName = clip.Preset.ToString().ToLower(),
isBinary = clip.IsBinary,
binds = list,
materialValues = materialList,
};