From a1ca122e2f2731a639668e5cf36f33cfb9af53e8 Mon Sep 17 00:00:00 2001 From: memelotsqui Date: Sun, 3 Mar 2024 16:29:46 -0600 Subject: [PATCH] fix restore face culling custom --- src/pages/BatchManifest.jsx | 62 +++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 26 deletions(-) diff --git a/src/pages/BatchManifest.jsx b/src/pages/BatchManifest.jsx index f198309d..b5062366 100644 --- a/src/pages/BatchManifest.jsx +++ b/src/pages/BatchManifest.jsx @@ -58,34 +58,44 @@ function BatchManifest() { twoSidedMaterial: (local["mergeOptions_two_sided_mat"] || false) } } - const downloadVRMWithIndex= async(index, onlyImage = false)=>{ - await characterManager.setManifest(manifestSelectionArray[index]); + + const downloadLoaded = (index, onlyImage = false) =>{ const downloadName = manifestSelectionArray[index].manifestName; - setIsLoading(true); - characterManager.loadInitialTraits().then(async()=>{ - const delay = ms => new Promise(res => setTimeout(res, ms)); - await delay(1); - characterManager.savePortraitScreenshot(downloadName, 512,1024,1.5,-0.1); - if (onlyImage){ - if (index < manifestSelectionArray.length-1 ){ - console.log("downloaded " + downloadName) - downloadVRMWithIndex(index + 1, onlyImage) - } - else{ - setIsLoading(false); - } - } - else{ - characterManager.downloadVRM(downloadName, getOptions()).then(()=>{ - if (index < manifestSelectionArray.length-1 ){ - console.log("downloaded " + downloadName) - downloadVRMWithIndex(index + 1) - } - else - setIsLoading(false); - }) + characterManager.savePortraitScreenshot(downloadName, 512,1024,1.5,-0.1); + if (onlyImage){ + if (index < manifestSelectionArray.length-1 ){ + console.log("downloaded " + downloadName) + downloadVRMWithIndex(index + 1, onlyImage) + } + else{ + setIsLoading(false); + } + } + else{ + characterManager.downloadVRM(downloadName, getOptions()).then(()=>{ + if (index < manifestSelectionArray.length-1 ){ + console.log("downloaded " + downloadName) + downloadVRMWithIndex(index + 1) } - }) + else + setIsLoading(false); + }) + } + } + + const downloadVRMWithIndex= async(index, onlyImage = false)=>{ + if (index == 0){ + downloadLoaded(index, onlyImage) + } + else{ + await characterManager.setManifest(manifestSelectionArray[index]); + setIsLoading(true); + characterManager.loadInitialTraits().then(async()=>{ + const delay = ms => new Promise(res => setTimeout(res, ms)); + await delay(1); + downloadLoaded(index + 1, onlyImage); + }) + } } const download = () => {