Skip to content

Commit

Permalink
Merge pull request #88 from M3-org/add-missing-vrm-meta
Browse files Browse the repository at this point in the history
Add missing vrm meta
  • Loading branch information
madjin authored Dec 13, 2023
2 parents c361097 + 768ab3c commit 5a150e8
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/library/VRMExporterv0.js
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ export default class VRMExporterv0 {

const outputScenes = toOutputScenes(avatar, outputNodes);


fillVRMMissingMetaData(outputVrmMeta);

const outputData = {
accessors: outputAccessors,
Expand Down Expand Up @@ -782,6 +782,21 @@ export default class VRMExporterv0 {
onDone(concatBinary([header, fileData]));
}
}
function fillVRMMissingMetaData(vrmMeta){
vrmMeta.title = vrmMeta.title || "Character";
vrmMeta.version = vrmMeta.version || "1";
vrmMeta.author = vrmMeta.author || "Anon";
vrmMeta.contactInformation = vrmMeta.contactInformation || "";
vrmMeta.reference = vrmMeta.reference || "";
vrmMeta.allowedUserName = vrmMeta.allowedUserName || "Everyone";
vrmMeta.violentUssageName = vrmMeta.violentUssageName || "Disallow";
vrmMeta.sexualUssageName = vrmMeta.sexualUssageName || "Disallow";
vrmMeta.commercialUssageName = vrmMeta.commercialUssageName || "Disallow";
vrmMeta.otherPermissionUrl = vrmMeta.otherPermissionUrl || "";
vrmMeta.licenseName = vrmMeta.licenseName || "Redistribution_Prohibited";
vrmMeta.otherLicenseUrl = vrmMeta.otherLicenseUrl || "";
}

function radian2Degree(radian) {
return radian * (180 / Math.PI);
}
Expand Down

0 comments on commit 5a150e8

Please sign in to comment.