Skip to content

Commit

Permalink
add comment description to downloadVRM call
Browse files Browse the repository at this point in the history
  • Loading branch information
memelotsqui committed Nov 13, 2023
1 parent f3a15a4 commit 458730b
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions src/library/download-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,24 +94,28 @@ async function getGLBData(model, options){



//required: model, name, vrmData
//parameters {screenshot, scale, isVrm0, vrmMeta, createTextureAtlas}
/**
* Downloads a VRM model with specified options.
*
* @param {Object} model - The 3D model object.
* @param {Object} vrmData - The VRM data for the model.
* @param {string} fileName - The name of the file to be downloaded.
* @param {Object} options - Additional options for the download.
* @param {Object} options.screenshot - An optional screenshot for the model.
* @param {number} options.mToonAtlasSize - Atlas size for opaque parts when using MToon material.
* @param {number} options.mToonAtlasSizeTransp - Atlas size for transparent parts when using MToon material.
* @param {number} options.stdAtlasSize - Atlas size for opaque parts when using standard materials.
* @param {number} options.stdAtlasSizeTransp - Atlas size for transparent parts when using standard materials.
* @param {boolean} options.exportMtoonAtlas - Whether to export the MToon material atlas.
* @param {boolean} options.exportStdAtlas - Whether to export the standard material atlas.
* @param {number} options.scale - Scaling factor for the model.
* @param {boolean} options.isVrm0 - Whether the VRM version is 0 (true) or 1 (false).
* @param {Object} options.vrmMeta - Additional metadata for the VRM model.
* @param {boolean} options.createTextureAtlas - Whether to create a texture atlas.
* @param {boolean} options.optimized - Whether to optimize the VRM model.
*/
export async function downloadVRM(model,vrmData,fileName, options){
const {
screenshot = null,
//transparentColor = new THREE.Color(1,1,1) ,
mToonAtlasSize = 4096,
mToonAtlasSizeTransp = 4096,
stdAtlasSize = 4096,
stdAtlasSizeTransp = 4096,
exportMtoonAtlas = false,
exportStdAtlas = true,
scale = 1,
isVrm0 = false,
vrmMeta = null,
createTextureAtlas = true,
optimized=true
} = options;


const avatar = {_optimized:{vrm:vrmData}}
downloadVRMWithAvatar(model, avatar, fileName, options)
Expand Down

0 comments on commit 458730b

Please sign in to comment.