diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index bf34da5a2..000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "dist/vrma"] - path = dist/vrma - url = git@git.syui.ai:ai/vrma diff --git a/README.md b/first/README.md similarity index 100% rename from README.md rename to first/README.md diff --git a/dist/CNAME b/first/dist/CNAME similarity index 100% rename from dist/CNAME rename to first/dist/CNAME diff --git a/dist/css/style.css b/first/dist/css/style.css similarity index 100% rename from dist/css/style.css rename to first/dist/css/style.css diff --git a/dist/favicon.ico b/first/dist/favicon.ico similarity index 100% rename from dist/favicon.ico rename to first/dist/favicon.ico diff --git a/dist/img/0.hdr b/first/dist/img/0.hdr similarity index 100% rename from dist/img/0.hdr rename to first/dist/img/0.hdr diff --git a/dist/img/1.hdr b/first/dist/img/1.hdr similarity index 100% rename from dist/img/1.hdr rename to first/dist/img/1.hdr diff --git a/dist/img/2.hdr b/first/dist/img/2.hdr similarity index 100% rename from dist/img/2.hdr rename to first/dist/img/2.hdr diff --git a/dist/img/og.png b/first/dist/img/og.png similarity index 100% rename from dist/img/og.png rename to first/dist/img/og.png diff --git a/dist/index.html b/first/dist/index.html similarity index 100% rename from dist/index.html rename to first/dist/index.html diff --git a/docs/wiki.md b/first/docs/wiki.md similarity index 100% rename from docs/wiki.md rename to first/docs/wiki.md diff --git a/package.json b/first/package.json similarity index 100% rename from package.json rename to first/package.json diff --git a/src/index.ts b/first/src/index.ts similarity index 100% rename from src/index.ts rename to first/src/index.ts diff --git a/tsconfig.json b/first/tsconfig.json similarity index 100% rename from tsconfig.json rename to first/tsconfig.json diff --git a/webpack.config.js b/first/webpack.config.js similarity index 100% rename from webpack.config.js rename to first/webpack.config.js diff --git a/min-react-2/package.json b/min-react-2/package.json deleted file mode 100644 index eb99a0158..000000000 --- a/min-react-2/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "min-react-vrm", - "version": "1.0.0", - "description": "Minimal VRM Animation Player", - "type": "module", - "scripts": { - "dev": "vite", - "build": "vite build", - "preview": "vite preview" - }, - "dependencies": { - "@pixiv/three-vrm": "^3.4.4", - "@pixiv/three-vrm-animation": "^3.4.4", - "@react-three/drei": "^10.7.7", - "@react-three/fiber": "^9.4.0", - "react": "^19.0.0", - "react-dom": "^19.0.0", - "three": "^0.181.2" - }, - "devDependencies": { - "@types/react": "^19.0.0", - "@types/react-dom": "^19.0.0", - "@vitejs/plugin-react": "^4.3.4", - "vite": "^6.0.1" - } -} diff --git a/min-react/.env b/min-react/.env deleted file mode 100644 index ba7cc18de..000000000 --- a/min-react/.env +++ /dev/null @@ -1 +0,0 @@ -GENERATE_SOURCEMAP=false diff --git a/min-react/.gitignore b/min-react/.gitignore deleted file mode 100644 index 4d29575de..000000000 --- a/min-react/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* diff --git a/min-react-2/index.html b/min-react/index.html similarity index 100% rename from min-react-2/index.html rename to min-react/index.html diff --git a/min-react/package.json b/min-react/package.json index c2e52682a..eb99a0158 100644 --- a/min-react/package.json +++ b/min-react/package.json @@ -1,51 +1,26 @@ { - "name": "vrm2", - "version": "0.1.0", - "private": true, - "dependencies": { - "@pixiv/three-vrm": "^3.1.1", - "@pixiv/three-vrm-animation": "^3.1.1", - "@react-three/drei": "^9.114.0", - "@react-three/fiber": "^8.17.9", - "@react-three/postprocessing": "^2.16.3", - "@testing-library/jest-dom": "^5.17.0", - "@testing-library/react": "^13.4.0", - "@testing-library/user-event": "^13.5.0", - "@types/jest": "^27.5.2", - "@types/node": "^16.18.112", - "@types/react": "^18.3.10", - "@types/react-dom": "^18.3.0", - "@types/three": "^0.167.2", - "react": "^18.3.1", - "react-dom": "^18.3.1", - "react-scripts": "5.0.1", - "three": "^0.167.1", - "three-stdlib": "^2.30.5", - "typescript": "^4.9.5", - "web-vitals": "^2.1.4" - }, + "name": "min-react-vrm", + "version": "1.0.0", + "description": "Minimal VRM Animation Player", + "type": "module", "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject" + "dev": "vite", + "build": "vite build", + "preview": "vite preview" }, - "eslintConfig": { - "extends": [ - "react-app", - "react-app/jest" - ] + "dependencies": { + "@pixiv/three-vrm": "^3.4.4", + "@pixiv/three-vrm-animation": "^3.4.4", + "@react-three/drei": "^10.7.7", + "@react-three/fiber": "^9.4.0", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "three": "^0.181.2" }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] + "devDependencies": { + "@types/react": "^19.0.0", + "@types/react-dom": "^19.0.0", + "@vitejs/plugin-react": "^4.3.4", + "vite": "^6.0.1" } } diff --git a/min-react-2/public/ai.vrm b/min-react/public/ai.vrm similarity index 100% rename from min-react-2/public/ai.vrm rename to min-react/public/ai.vrm diff --git a/min-react/public/favicon.ico b/min-react/public/favicon.ico deleted file mode 100644 index a11777cc4..000000000 Binary files a/min-react/public/favicon.ico and /dev/null differ diff --git a/min-react-2/public/idle.vrma b/min-react/public/idle.vrma similarity index 100% rename from min-react-2/public/idle.vrma rename to min-react/public/idle.vrma diff --git a/min-react/public/index.html b/min-react/public/index.html deleted file mode 100644 index 563325037..000000000 --- a/min-react/public/index.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - React App - - - -
- - - diff --git a/min-react/public/logo192.png b/min-react/public/logo192.png deleted file mode 100644 index fc44b0a37..000000000 Binary files a/min-react/public/logo192.png and /dev/null differ diff --git a/min-react/public/logo512.png b/min-react/public/logo512.png deleted file mode 100644 index a4e47a654..000000000 Binary files a/min-react/public/logo512.png and /dev/null differ diff --git a/min-react/public/manifest.json b/min-react/public/manifest.json deleted file mode 100644 index 080d6c77a..000000000 --- a/min-react/public/manifest.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "short_name": "React App", - "name": "Create React App Sample", - "icons": [ - { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - }, - { - "src": "logo192.png", - "type": "image/png", - "sizes": "192x192" - }, - { - "src": "logo512.png", - "type": "image/png", - "sizes": "512x512" - } - ], - "start_url": ".", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" -} diff --git a/min-react/public/robots.txt b/min-react/public/robots.txt deleted file mode 100644 index e9e57dc4d..000000000 --- a/min-react/public/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# https://www.robotstxt.org/robotstxt.html -User-agent: * -Disallow: diff --git a/min-react/readme.md b/min-react/readme.md deleted file mode 100644 index 2f3dc51cb..000000000 --- a/min-react/readme.md +++ /dev/null @@ -1,20 +0,0 @@ -react-three-fiber + three-vrm - -```sh -$ npm i -$ npm run start -``` - -## install - -```sh -# npx create-react-app vrm1 --template typescript -# npm install three three-stdlib @types/three @react-three/fiber @react-three/fiber @react-three/drei @react-three/postprocessing -``` - -## three-vrm - -`vrm 1.0` - -unity export - diff --git a/min-react/src/App.css b/min-react/src/App.css deleted file mode 100644 index 74b5e0534..000000000 --- a/min-react/src/App.css +++ /dev/null @@ -1,38 +0,0 @@ -.App { - text-align: center; -} - -.App-logo { - height: 40vmin; - pointer-events: none; -} - -@media (prefers-reduced-motion: no-preference) { - .App-logo { - animation: App-logo-spin infinite 20s linear; - } -} - -.App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; -} - -.App-link { - color: #61dafb; -} - -@keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} diff --git a/min-react-2/src/App.jsx b/min-react/src/App.jsx similarity index 100% rename from min-react-2/src/App.jsx rename to min-react/src/App.jsx diff --git a/min-react/src/App.test.tsx b/min-react/src/App.test.tsx deleted file mode 100644 index 2a68616d9..000000000 --- a/min-react/src/App.test.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react'; -import { render, screen } from '@testing-library/react'; -import App from './App'; - -test('renders learn react link', () => { - render(); - const linkElement = screen.getByText(/learn react/i); - expect(linkElement).toBeInTheDocument(); -}); diff --git a/min-react/src/App.tsx b/min-react/src/App.tsx deleted file mode 100644 index 8746ea772..000000000 --- a/min-react/src/App.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import React from 'react' -import VRMModelCanvas from './pages/vrm_model' - -const App = () => { - return ( - - ) -} - -export default App; diff --git a/min-react/src/index.css b/min-react/src/index.css deleted file mode 100644 index 40085692f..000000000 --- a/min-react/src/index.css +++ /dev/null @@ -1,18 +0,0 @@ -body { - height: 100%; - margin: 0; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', - sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -code { - font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', - monospace; -} - -html { - height: 100%; -} diff --git a/min-react/src/index.tsx b/min-react/src/index.tsx deleted file mode 100644 index 032464fb6..000000000 --- a/min-react/src/index.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom/client'; -import './index.css'; -import App from './App'; -import reportWebVitals from './reportWebVitals'; - -const root = ReactDOM.createRoot( - document.getElementById('root') as HTMLElement -); -root.render( - - - -); - -// If you want to start measuring performance in your app, pass a function -// to log results (for example: reportWebVitals(console.log)) -// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals -reportWebVitals(); diff --git a/min-react/src/logo.svg b/min-react/src/logo.svg deleted file mode 100644 index 9dfc1c058..000000000 --- a/min-react/src/logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/min-react-2/src/main.jsx b/min-react/src/main.jsx similarity index 100% rename from min-react-2/src/main.jsx rename to min-react/src/main.jsx diff --git a/min-react/src/pages/vrm_model.tsx b/min-react/src/pages/vrm_model.tsx deleted file mode 100644 index f10427d08..000000000 --- a/min-react/src/pages/vrm_model.tsx +++ /dev/null @@ -1,84 +0,0 @@ -import * as THREE from 'three' -import React, { useState, useEffect, useRef } from 'react'; -import { OrbitControls } from '@react-three/drei' -import { useFrame, Canvas } from '@react-three/fiber'; -import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader'; -import { VRM, VRMUtils, VRMLoaderPlugin } from '@pixiv/three-vrm'; -import { VRMAnimationLoaderPlugin, VRMAnimation, createVRMAnimationClip } from "@pixiv/three-vrm-animation"; - -interface ModelProps { - url: string - url_anim: string -} - -const VRMModel: React.FC = ({ url, url_anim }) => { - - const [vrm, setVrm] = useState(null); - const mixerRef = useRef(null); - - useEffect(() => { - const loader = new GLTFLoader(); - loader.register((parser) => new VRMLoaderPlugin(parser)); - loader.register((parser) => new VRMAnimationLoaderPlugin(parser)); - loader.load(url, (gltf) => { - const vrmModel = gltf.userData.vrm as VRM; - VRMUtils.removeUnnecessaryJoints(vrmModel.scene); - setVrm(vrmModel); - const mixer = new THREE.AnimationMixer(vrmModel.scene); - mixerRef.current = mixer; - loader.load(url_anim, (animGltf) => { - const vrmAnimations = animGltf.userData.vrmAnimations as VRMAnimation[]; - if (vrmAnimations && vrmAnimations.length > 0) { - const clip = createVRMAnimationClip(vrmAnimations[0], vrmModel); - mixer.clipAction(clip).play(); - } - }); - }); - }, [url, url_anim]); - - useFrame((state, delta) => { - if (mixerRef.current) mixerRef.current.update(delta); - if (vrm) vrm.update(delta); - }); - - return vrm ? : null; -}; - -export const VRMModelCanvas = () => { - return ( -
- - - - - - - - - - - - -
- ) -} -export default VRMModelCanvas; - diff --git a/min-react/src/react-app-env.d.ts b/min-react/src/react-app-env.d.ts deleted file mode 100644 index 6431bc5fc..000000000 --- a/min-react/src/react-app-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/min-react/src/reportWebVitals.ts b/min-react/src/reportWebVitals.ts deleted file mode 100644 index 49a2a16e0..000000000 --- a/min-react/src/reportWebVitals.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { ReportHandler } from 'web-vitals'; - -const reportWebVitals = (onPerfEntry?: ReportHandler) => { - if (onPerfEntry && onPerfEntry instanceof Function) { - import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { - getCLS(onPerfEntry); - getFID(onPerfEntry); - getFCP(onPerfEntry); - getLCP(onPerfEntry); - getTTFB(onPerfEntry); - }); - } -}; - -export default reportWebVitals; diff --git a/min-react/src/setupTests.ts b/min-react/src/setupTests.ts deleted file mode 100644 index 8f2609b7b..000000000 --- a/min-react/src/setupTests.ts +++ /dev/null @@ -1,5 +0,0 @@ -// jest-dom adds custom jest matchers for asserting on DOM nodes. -// allows you to do things like: -// expect(element).toHaveTextContent(/react/i) -// learn more: https://github.com/testing-library/jest-dom -import '@testing-library/jest-dom'; diff --git a/min-react/tsconfig.json b/min-react/tsconfig.json deleted file mode 100644 index a273b0cfc..000000000 --- a/min-react/tsconfig.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "compilerOptions": { - "target": "es5", - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], - "allowJs": true, - "skipLibCheck": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true, - "module": "esnext", - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true, - "jsx": "react-jsx" - }, - "include": [ - "src" - ] -} diff --git a/min-react-2/vite.config.ts b/min-react/vite.config.ts similarity index 100% rename from min-react-2/vite.config.ts rename to min-react/vite.config.ts