updated three version, fixed fixed line bug in media scene, cleanup inside extraction script should work now.

This commit is contained in:
ad044 2021-03-07 01:48:01 +04:00
parent 4273edd025
commit e47f1a3417
8 changed files with 9582 additions and 12256 deletions

21717
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -4,7 +4,6 @@
"private": true,
"dependencies": {
"@react-spring/three": "^9.0.0-rc.3",
"@react-three/drei": "^2.2.3",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
@ -18,8 +17,8 @@
"react-scripts": "^4.0.0",
"react-three-fiber": "^4.2.20",
"react-use-gesture": "^9.0.4",
"three": "^0.126.1",
"three-plain-animator": "^1.0.2",
"three": "^0.125.0",
"three-plain-animator": "^1.0.6",
"typescript": "^3.7.5",
"zustand": "^3.1.3"
},

View file

@ -1,9 +1,9 @@
import { execSync } from "child_process";
import { tmpdir } from "os";
import { mkdtempSync, rmSync } from "fs";
import { mkdtempSync, unlinkSync } from "fs";
import { join } from "path";
import { extract_media } from "./extract_media.mjs";
import {extract_voice} from "./extract_voice.mjs";
import { extract_voice } from "./extract_voice.mjs";
const tempdir = mkdtempSync(join(tmpdir(), "extractor-"));
console.log(tempdir);
@ -32,4 +32,4 @@ execSync(
extract_media(tempdir, jpsxdec_jar, disc1_index, disc2_index);
extract_voice(tempdir, jpsxdec_jar, disc1_index);
rmSync(tempdir, { recursive: true });
unlinkSync(tempdir, { recursive: true });

View file

@ -1,5 +1,5 @@
import { execSync, exec } from "child_process";
import { existsSync, mkdirSync, readdirSync, rmSync } from "fs";
import { existsSync, mkdirSync, readdirSync, unlinkSync } from "fs";
import { join } from "path";
export function extract_media(tempdir, jpsxdec_jar, disc1_index, disc2_index) {
@ -42,7 +42,6 @@ export function extract_media(tempdir, jpsxdec_jar, disc1_index, disc2_index) {
);
// create destination folders
if (!existsSync(output_movie_folder)) {
mkdirSync(output_movie_folder);
}
@ -56,7 +55,11 @@ export function extract_media(tempdir, jpsxdec_jar, disc1_index, disc2_index) {
for (let file of readdirSync(`${join(tempdir, movieDir)}`)) {
if (file.endsWith(".wav")) continue;
exec(
`ffmpeg -i "${join(tempdir, movieDir, file)}" -pix_fmt yuv420p -n ${join(
`ffmpeg -i "${join(
tempdir,
movieDir,
file
)}" -pix_fmt yuv420p -n ${join(
output_movie_folder,
file.replace("avi", "mp4")
)}`
@ -75,7 +78,7 @@ export function extract_media(tempdir, jpsxdec_jar, disc1_index, disc2_index) {
}
// cleanup source folders
rmSync(join(tempdir, "MOVIE"), { recursive: true });
rmSync(join(tempdir, "MOVIE2"), { recursive: true });
rmSync(join(tempdir, "XA"), { recursive: true });
unlinkSync(join(tempdir, "MOVIE"), { recursive: true });
unlinkSync(join(tempdir, "MOVIE2"), { recursive: true });
unlinkSync(join(tempdir, "XA"), { recursive: true });
}

View file

@ -5,6 +5,7 @@ import { a, useSpring } from "@react-spring/three";
import word_position_states from "../../../resources/word_position_states.json";
import * as THREE from "three";
import Lof from "../Lof";
import { useUpdate } from "react-three-fiber";
const RightSide = memo(() => {
const words = useStore((state) => state.activeNode.words);
@ -32,6 +33,7 @@ const RightSide = memo(() => {
() => [new THREE.Vector3(-10, 0, 0), new THREE.Vector3(10, 0, 0)],
[]
);
const verticalPoints = useMemo(
() => [new THREE.Vector3(0, 10, 0), new THREE.Vector3(0, -10, 0)],
[]
@ -39,6 +41,14 @@ const RightSide = memo(() => {
const activeMediaComponent = useStore((state) => state.activeMediaComponent);
const horizontalRef = useUpdate((geometry: THREE.BufferGeometry) => {
geometry.setFromPoints(horizontalPoints);
}, []);
const verticalRef = useUpdate((geometry: THREE.BufferGeometry) => {
geometry.setFromPoints(verticalPoints);
}, []);
return (
<group position={[0, 0, -3]}>
<Lof />
@ -47,7 +57,7 @@ const RightSide = memo(() => {
position-y={wordPositionStateSpring.crossPosY}
>
<line>
<geometry attach="geometry" vertices={horizontalPoints} />
<bufferGeometry attach="geometry" ref={horizontalRef} />
<lineBasicMaterial
attach="material"
color={0xc9d6d5}
@ -56,7 +66,7 @@ const RightSide = memo(() => {
/>
</line>
<line>
<geometry attach="geometry" vertices={verticalPoints} />
<bufferGeometry attach="geometry" ref={verticalRef} />
<lineBasicMaterial
attach="material"
color={0xc9d6d5}

View file

@ -18,41 +18,41 @@ export const getRandomIdleMedia = () => {
"0009",
],
video: [
"INS01.STR",
"INS02.STR",
"INS03.STR",
"INS04.STR",
"INS05.STR",
"INS06.STR",
"INS07.STR",
"INS08.STR",
"INS09.STR",
"INS10.STR",
"INS11.STR",
"INS12.STR",
"INS13.STR",
"INS14.STR",
"INS15.STR",
"INS16.STR",
"INS17.STR",
"INS18.STR",
"INS19.STR",
"INS20.STR",
"INS21.STR",
"INS22.STR",
"INS01.STR[0]",
"INS02.STR[0]",
"INS03.STR[0]",
"INS04.STR[0]",
"INS05.STR[0]",
"INS06.STR[0]",
"INS07.STR[0]",
"INS08.STR[0]",
"INS09.STR[0]",
"INS10.STR[0]",
"INS11.STR[0]",
"INS12.STR[0]",
"INS13.STR[0]",
"INS14.STR[0]",
"INS15.STR[0]",
"INS16.STR[0]",
"INS17.STR[0]",
"INS18.STR[0]",
"INS19.STR[0]",
"INS20.STR[0]",
"INS21.STR[0]",
"INS22.STR[0]",
],
};
const siteBIdleNodes = {
audio: ["1015", "1219", "0419", "0500", "0501", "0508", "0510", "0513"],
video: [
"INS16.STR",
"INS17.STR",
"INS18.STR",
"INS19.STR",
"INS20.STR",
"INS21.STR",
"INS22.STR",
"INS16.STR[0]",
"INS17.STR[0]",
"INS18.STR[0]",
"INS19.STR[0]",
"INS20.STR[0]",
"INS21.STR[0]",
"INS22.STR[0]",
],
};
@ -78,6 +78,13 @@ export const getRandomIdleMedia = () => {
nodeName: nodeName,
};
} else {
if (site === "b" && Math.random() < 0.3) {
const polytanMedia = ["PO1.STR[0]", "PO2.STR[0]"];
return {
type: "video",
media: polytanMedia[Math.floor(Math.random() * polytanMedia.length)],
};
}
return {
type: "video",
media:

View file

@ -439,3 +439,17 @@ export const createAudioAnalyser = () => {
return new THREE.AudioAnalyser(audio, 2048);
};
export const isPolytanFullyUnlocked = () => {
return (
useStore.getState().polytanUnlockedParts ===
{
body: true,
head: true,
leftArm: true,
rightArm: true,
leftLeg: true,
rightLeg: true,
}
);
};

View file

@ -160,7 +160,7 @@ export type SiteData = {
type Effect = () => void;
type Mutation = {
mutation: Object;
mutation: object;
delay?: number;
};
type EventAudio = {