Skip to content

Commit

Permalink
fix restore face culling custom
Browse files Browse the repository at this point in the history
  • Loading branch information
memelotsqui committed Mar 3, 2024
1 parent 9eb1944 commit a1ca122
Showing 1 changed file with 36 additions and 26 deletions.
62 changes: 36 additions & 26 deletions src/pages/BatchManifest.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down

0 comments on commit a1ca122

Please sign in to comment.