mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-09 12:29:23 -05:00
update License
This commit is contained in:
@@ -167,21 +167,36 @@ namespace VRM
|
||||
// meta
|
||||
{
|
||||
var _meta = exporter.Copy.GetComponent<VRMMeta>();
|
||||
if (_meta != null && _meta.Meta!=null)
|
||||
if (_meta != null && _meta.Meta != null)
|
||||
{
|
||||
var meta = _meta.Meta;
|
||||
|
||||
// info
|
||||
gltf.extensions.VRM.meta.version = meta.Version;
|
||||
gltf.extensions.VRM.meta.author = meta.Author;
|
||||
gltf.extensions.VRM.meta.contactInformation = meta.ContactInformation;
|
||||
gltf.extensions.VRM.meta.reference = meta.Reference;
|
||||
gltf.extensions.VRM.meta.title = meta.Title;
|
||||
if (meta.Thumbnail != null)
|
||||
{
|
||||
gltf.extensions.VRM.meta.texture = gltfExporter.ExportTexture(gltf, gltf.buffers.Count - 1, meta.Thumbnail);
|
||||
}
|
||||
|
||||
// ussage pemission
|
||||
gltf.extensions.VRM.meta.allowedUser = meta.AllowedUser;
|
||||
gltf.extensions.VRM.meta.violentUssage = meta.ViolentUssage;
|
||||
gltf.extensions.VRM.meta.sexualUssage = meta.ViolentUssage;
|
||||
gltf.extensions.VRM.meta.commercialUssage = meta.ViolentUssage;
|
||||
gltf.extensions.VRM.meta.otherPermissionUrl = meta.OtherPermissionUrl;
|
||||
|
||||
// distribution license
|
||||
gltf.extensions.VRM.meta.licenseType = meta.LicenseType;
|
||||
gltf.extensions.VRM.meta.otherLicenseUrl = meta.OtherLicenseUrl;
|
||||
gltf.extensions.VRM.meta.reference = meta.Reference;
|
||||
if (meta.LicenseType == LicenseType.Other)
|
||||
{
|
||||
gltf.extensions.VRM.meta.otherLicenseUrl = meta.OtherLicenseUrl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// firstPerson
|
||||
var firstPerson = exporter.Copy.GetComponent<VRMFirstPerson>();
|
||||
|
||||
@@ -38,17 +38,27 @@ namespace VRM
|
||||
{
|
||||
var meta=ScriptableObject.CreateInstance<VRMMetaObject>();
|
||||
meta.name = "Meta";
|
||||
|
||||
var gltfMeta = VRM.extensions.VRM.meta;
|
||||
meta.Version = gltfMeta.version;
|
||||
meta.Author = gltfMeta.author;
|
||||
meta.ContactInformation = gltfMeta.contactInformation;
|
||||
meta.Reference = gltfMeta.reference;
|
||||
meta.Title = gltfMeta.title;
|
||||
if (gltfMeta.texture != -1)
|
||||
{
|
||||
meta.Thumbnail = Textures[gltfMeta.texture].Texture;
|
||||
}
|
||||
|
||||
meta.AllowedUser = gltfMeta.allowedUser;
|
||||
meta.ViolentUssage = gltfMeta.violentUssage;
|
||||
meta.SexualUssage = gltfMeta.sexualUssage;
|
||||
meta.CommercialUssage = gltfMeta.commercialUssage;
|
||||
meta.OtherPermissionUrl = gltfMeta.otherPermissionUrl;
|
||||
|
||||
meta.LicenseType = gltfMeta.licenseType;
|
||||
meta.OtherLicenseUrl = gltfMeta.otherLicenseUrl;
|
||||
meta.Reference = gltfMeta.reference;
|
||||
|
||||
return meta;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@ namespace VRM
|
||||
public static class VRMVersion
|
||||
{
|
||||
public const int MAJOR = 0;
|
||||
public const int MINOR = 16;
|
||||
public const int MINOR = 17;
|
||||
|
||||
public const string VERSION = "0.16";
|
||||
public const string VERSION = "0.17";
|
||||
|
||||
public const string DecrementMenuName = "VRM/Version(0.16) Decrement";
|
||||
public const string IncrementMenuName = "VRM/Version(0.16) Increment";
|
||||
public const string DecrementMenuName = "VRM/Version(0.17) Decrement";
|
||||
public const string IncrementMenuName = "VRM/Version(0.17) Increment";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,14 +7,13 @@ namespace VRM
|
||||
public enum AllowedUser
|
||||
{
|
||||
OnlyAuthor,
|
||||
ExplicitlyLicensedPerson,
|
||||
Everyone,
|
||||
}
|
||||
|
||||
|
||||
public enum LicenseType
|
||||
{
|
||||
RedistributionProhibited,
|
||||
|
||||
Redistribution_Prohibited,
|
||||
CC0,
|
||||
CC_BY,
|
||||
CC_BY_NC,
|
||||
@@ -22,24 +21,37 @@ namespace VRM
|
||||
CC_BY_NC_SA,
|
||||
CC_BY_ND,
|
||||
CC_BY_NC_ND,
|
||||
|
||||
Other
|
||||
}
|
||||
|
||||
public enum UssageLicense
|
||||
{
|
||||
Disallow,
|
||||
Allow,
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class glTF_VRM_Meta : JsonSerializableBase
|
||||
{
|
||||
static UssageLicense FromString(string src)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (UssageLicense)Enum.Parse(typeof(UssageLicense), src, true);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return UssageLicense.Disallow;
|
||||
}
|
||||
}
|
||||
public string version;
|
||||
|
||||
public string author;
|
||||
public string contactInformation;
|
||||
public string reference;
|
||||
|
||||
public string title;
|
||||
public int texture = -1;
|
||||
|
||||
#region PersonationCharacterizationPermission Permission;
|
||||
#region Ussage Permission
|
||||
public string allowedUserName;
|
||||
public AllowedUser allowedUser
|
||||
{
|
||||
@@ -59,11 +71,25 @@ namespace VRM
|
||||
allowedUserName = value.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public bool allowImmoralUssage;
|
||||
public bool allowCcertainBeliefsUssage;
|
||||
public bool allowPoliticalUssage;
|
||||
public bool allowCommercialUssage;
|
||||
public string violentUssageName;
|
||||
public UssageLicense violentUssage
|
||||
{
|
||||
get { return FromString(violentUssageName); }
|
||||
set { violentUssageName = value.ToString(); }
|
||||
}
|
||||
public string sexualUssageName;
|
||||
public UssageLicense sexualUssage
|
||||
{
|
||||
get { return FromString(sexualUssageName); }
|
||||
set { sexualUssageName = value.ToString(); }
|
||||
}
|
||||
public string commercialUssageName;
|
||||
public UssageLicense commercialUssage
|
||||
{
|
||||
get { return FromString(commercialUssageName); }
|
||||
set { commercialUssageName = value.ToString(); }
|
||||
}
|
||||
public string otherPermissionUrl;
|
||||
#endregion
|
||||
|
||||
#region Distribution License
|
||||
@@ -101,10 +127,10 @@ namespace VRM
|
||||
f.KeyValue(() => texture);
|
||||
|
||||
f.KeyValue(() => allowedUserName);
|
||||
f.KeyValue(() => allowImmoralUssage);
|
||||
f.KeyValue(() => allowCcertainBeliefsUssage);
|
||||
f.KeyValue(() => allowPoliticalUssage);
|
||||
f.KeyValue(() => allowCommercialUssage);
|
||||
f.KeyValue(() => violentUssageName);
|
||||
f.KeyValue(() => sexualUssageName);
|
||||
f.KeyValue(() => commercialUssageName);
|
||||
f.KeyValue(() => otherPermissionUrl);
|
||||
|
||||
f.KeyValue(() => licenseName);
|
||||
f.KeyValue(() => otherLicenseUrl);
|
||||
|
||||
Reference in New Issue
Block a user