Skip to content

Commit

Permalink
Appearance set VRM when drag and drop
Browse files Browse the repository at this point in the history
  • Loading branch information
memelotsqui committed Oct 31, 2023
1 parent 53c7c9b commit c2049ca
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/pages/Appearance.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function Appearance({

const [jsonSelectionArray, setJsonSelectionArray] = React.useState(null)
const [uploadTextureURL, setUploadTextureURL] = React.useState(null)
const [uploadVRMURL, setUploadVRMURL] = React.useState(null)

const next = () => {
!isMute && playSound('backNextButton');
Expand Down Expand Up @@ -97,6 +98,10 @@ function Appearance({
const path = URL.createObjectURL(file);
setUploadTextureURL(path);
}
const handleVRMDrop = (file) =>{
const path = URL.createObjectURL(file);
setUploadVRMURL(path);
}

const handleFilesDrop = async(files) => {
const file = files[0];
Expand All @@ -107,6 +112,9 @@ function Appearance({
if (file && (file.name.toLowerCase().endsWith('.png') || file.name.toLowerCase().endsWith('.jpg'))) {
handleImageDrop(file);
}
if (file && file.name.toLowerCase().endsWith('.vrm')) {
handleVRMDrop(file);
}

const filesArray = Array.from(files);
const jsonDataArray = [];
Expand Down Expand Up @@ -188,6 +196,7 @@ function Appearance({
confirmDialog={confirmDialog}
jsonSelectionArray={jsonSelectionArray}
uploadTextureURL = {uploadTextureURL}
uploadVRMURL = {uploadVRMURL}
/>
<div className={styles.buttonContainer}>
<CustomButton
Expand Down

0 comments on commit c2049ca

Please sign in to comment.