Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
1862468
re write screenshot
tcm390 Feb 10, 2023
5241346
clean code
tcm390 Feb 10, 2023
994de2e
adjust mint page to match figma mockups
HexSleeves Feb 10, 2023
8f5cb5d
Merge branch 'stable' into yendor/add_back_mint
HexSleeves Feb 10, 2023
95b65f6
convert image to blob
tcm390 Feb 10, 2023
2d62017
disable mint button on save page
HexSleeves Feb 10, 2023
1fa59aa
open eyes when screenshot
tcm390 Feb 10, 2023
b71f248
screenshot encoding
memelotsqui Feb 11, 2023
360dde5
Merge pull request #302 from webaverse-studios/tcm-screenshot-encoding
tcm390 Feb 11, 2023
643b6f5
add pause to animation manager
memelotsqui Feb 11, 2023
9f69448
fix paused var
memelotsqui Feb 11, 2023
e5430aa
reset camera for screenshot
memelotsqui Feb 11, 2023
59aa7bb
Merge pull request #303 from webaverse-studios/tcm-screenshot-encoding
tcm390 Feb 11, 2023
d1a3866
revert blink manager and animation manager
tcm390 Feb 11, 2023
9e7e903
use head world position for screenshot instead of harded code
tcm390 Feb 13, 2023
f239587
clean code
tcm390 Feb 13, 2023
b82e12f
clean code
tcm390 Feb 13, 2023
8d04bc1
clean code
tcm390 Feb 13, 2023
47b0865
spacing
tcm390 Feb 13, 2023
ebf8a98
change screen shot ratio and camera fov
tcm390 Feb 14, 2023
18b4c36
add screenshot background
tcm390 Feb 14, 2023
64115bf
add antialias to screenshot renderer
tcm390 Feb 14, 2023
46423a9
prevent eyes closing when taking the screen shot
tcm390 Feb 14, 2023
698f426
Set screenshot size to 4096x4096
soulofmischief Feb 14, 2023
916d909
missing uri
tcm390 Feb 14, 2023
98a5bf2
Merge branch 'tcm-screenshot' of https://github.com/webaverse-studios…
tcm390 Feb 14, 2023
a86e9c7
let all screenshot have the same frame of the animation
tcm390 Feb 14, 2023
7b6fe35
rename
tcm390 Feb 14, 2023
94f2a81
Merge pull request #315 from webaverse-studios/yendor/add_back_mint
memelotsqui Feb 16, 2023
d695d39
Merge branch 'full-mint-support' into tcm-screenshot
memelotsqui Feb 16, 2023
044d89a
fix merge commit issues
memelotsqui Feb 17, 2023
f0e5593
create screenshot function
memelotsqui Feb 17, 2023
df45240
update functions in screnshot manager
memelotsqui Feb 17, 2023
158be65
get screenshot name and change function
memelotsqui Feb 17, 2023
323d931
remove next button in view page
memelotsqui Feb 17, 2023
3fffadf
save to vrm0
memelotsqui Feb 17, 2023
2a9b9ec
Merge branch 'mem/add-tcm-screenshot-to-thumbnail' into mem/merge
memelotsqui Mar 8, 2023
5384c3b
Merge pull request #366 from webaverse-studios/mem/merge
memelotsqui Mar 8, 2023
8a4f808
confix
memelotsqui Mar 9, 2023
9f4f08f
clean code
tcm390 Feb 10, 2023
1038cb7
convert image to blob
tcm390 Feb 10, 2023
20bf72b
open eyes when screenshot
tcm390 Feb 10, 2023
1217378
screenshot encoding
memelotsqui Feb 11, 2023
6512c10
add pause to animation manager
memelotsqui Feb 11, 2023
7f09330
fix paused var
memelotsqui Feb 11, 2023
d743f2c
confix
memelotsqui Mar 9, 2023
16eb5d1
confix
memelotsqui Mar 9, 2023
0ae9411
use head world position for screenshot instead of harded code
tcm390 Feb 13, 2023
f259543
clean code
tcm390 Feb 13, 2023
6f56cf6
confix
memelotsqui Mar 9, 2023
699ca66
clean code
tcm390 Feb 13, 2023
a4a321c
spacing
tcm390 Feb 13, 2023
e19cfa6
change screen shot ratio and camera fov
tcm390 Feb 14, 2023
03aa890
add screenshot background
tcm390 Feb 14, 2023
b589984
add antialias to screenshot renderer
tcm390 Feb 14, 2023
7568078
confix
memelotsqui Mar 9, 2023
1e72dc4
missing uri
tcm390 Feb 14, 2023
33c06f7
Set screenshot size to 4096x4096
soulofmischief Feb 14, 2023
d55286a
let all screenshot have the same frame of the animation
tcm390 Feb 14, 2023
83df959
rename
tcm390 Feb 14, 2023
fef103d
confix
memelotsqui Mar 9, 2023
25710cb
confix
memelotsqui Mar 9, 2023
c3bef4d
confix
memelotsqui Mar 9, 2023
45ae4ab
confix
memelotsqui Mar 9, 2023
bbb9032
create mint utils file
memelotsqui Feb 16, 2023
6aea51f
wip extract mint logic
memelotsqui Feb 16, 2023
4df5ec1
confix
memelotsqui Mar 9, 2023
bcc68f0
fix promise return
memelotsqui Feb 17, 2023
ad988a4
await adress and validate if added
memelotsqui Feb 17, 2023
73a2686
test debugs
memelotsqui Feb 17, 2023
a0ce2fb
remove old mint page
memelotsqui Feb 21, 2023
1279444
remove consoles
memelotsqui Feb 21, 2023
ffe2dad
adding polygon chain
Feb 22, 2023
97f61e7
fix call fn
memelotsqui Feb 23, 2023
952c381
save with name
memelotsqui Feb 23, 2023
ec96142
remove consoles
memelotsqui Feb 23, 2023
af2062d
save vrm instead of glb
memelotsqui Feb 23, 2023
23a3852
remove old glb fn call
memelotsqui Feb 23, 2023
d384d59
confix
memelotsqui Mar 9, 2023
02f2f42
fix css
memelotsqui Feb 24, 2023
d966492
call to action mint
memelotsqui Mar 9, 2023
01e2121
resolve merge conflicts
memelotsqui Mar 10, 2023
8e99ac9
fix blob and cleanup
memelotsqui Mar 10, 2023
6082ed9
Merge pull request #369 from webaverse-studios/mem/add-tcm-screenshot…
memelotsqui Mar 10, 2023
e45e6a6
space evenly
memelotsqui Mar 10, 2023
9273070
disable genesis edition
memelotsqui Mar 13, 2023
d27a03c
clear css active on disabled
memelotsqui Mar 13, 2023
78577ba
give user feedback and directions of minting
memelotsqui Mar 13, 2023
6c4f324
add sfx
memelotsqui Mar 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ web_modules/

# Optional eslint cache
.eslintcache
<<<<<<< HEAD
lerna-debug.log
.vscode
=======
<<<<<<< HEAD

# Microbundle cache
.rpt2_cache/
Expand Down Expand Up @@ -274,3 +279,8 @@ fabric.properties
# Documentation here: https://yarnpkg.com/features/zero-installs
#!/.yarn/cache
/.pnp.*
=======
lerna-debug.log
.vscode
>>>>>>> 994de2e (adjust mint page to match figma mockups)
>>>>>>> d966492f20f4b3cee4c2907137944cdd50c0f15e
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"eslint-plugin-no-inline-styles": "^1.0.5",
"eslint-plugin-react": "^7.31.11",
"prettier": "^2.3.2",
"sass": "^1.58.0",
"vite": "^4.0.0"
}
}
18 changes: 18 additions & 0 deletions public/assets/icons/polygon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 37 additions & 4 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,22 @@ import { BlinkManager } from "./library/blinkManager"
import { LookAtManager } from "./library/lookatManager"
import { EffectManager } from "./library/effectManager"
import { AnimationManager } from "./library/animationManager"
import { ScreenshotManager } from "./library/screenshotManager"

import Scene from "./components/Scene"
import Background from "./components/Background"

import View from "./pages/View"
import Save from "./pages/Save"
import Load from "./pages/Load"
import Mint from "./pages/Mint"
import BioPage from "./pages/Bio"
import Create from "./pages/Create"
import Landing from "./pages/Landing"
import Appearance from "./pages/Appearance"
import LanguageSwitch from "./components/LanguageSwitch"


// dynamically import the manifest
const assetImportPath = import.meta.env.VITE_ASSET_PATH + "/manifest.json"
const peresonalityImportPath =
Expand Down Expand Up @@ -109,6 +112,7 @@ async function fetchAll() {
const blinkManager = new BlinkManager(0.1, 0.1, 0.5, 5)
const lookatManager = new LookAtManager(80, "editor-scene")
const effectManager = new EffectManager()
const screenshotManager = new ScreenshotManager()

return {
initialManifest,
Expand All @@ -117,6 +121,7 @@ async function fetchAll() {
blinkManager,
lookatManager,
effectManager,
screenshotManager,
}
}

Expand Down Expand Up @@ -158,6 +163,7 @@ export default function App() {
blinkManager,
lookatManager,
effectManager,
screenshotManager,
} = resource.read()

const [hideUi, setHideUi] = useState(false)
Expand All @@ -174,16 +180,19 @@ export default function App() {
moveCamera,
setManifest,
manifest,
model,
} = useContext(SceneContext)
const { viewMode } = useContext(ViewContext)

effectManager.camera = camera
effectManager.scene = scene

screenshotManager.scene = scene

const updateCameraPosition = () => {
if (!effectManager.camera) return

if ([ViewMode.BIO, ViewMode.MINT, ViewMode.CHAT].includes(viewMode)) {
if ([ViewMode.BIO, ViewMode.CHAT].includes(viewMode)) {
// auto move camera
if (viewMode === ViewMode.CHAT) {
cameraDistance = cameraDistanceChat
Expand Down Expand Up @@ -239,7 +248,7 @@ export default function App() {

if (controls) {
if (
[ViewMode.APPEARANCE, ViewMode.SAVE, ViewMode.MINT].includes(viewMode)
[ViewMode.APPEARANCE, ViewMode.SAVE].includes(viewMode)
) {
controls.enabled = true
} else {
Expand All @@ -263,6 +272,30 @@ export default function App() {
})
}

const getFaceScreenshot = (width = 256, height = 256, getBlob = false) => {
blinkManager.enableScreenshot();
model.traverse(o => {
if (o.isSkinnedMesh) {
const headBone = o.skeleton.bones.filter(bone => bone.name === 'head')[0];
headBone.getWorldPosition(localVector3);
}
});
const headPosition = localVector3;
const female = templateInfo.name === "Drophunter";
const cameraFov = female ? 0.78 : 0.85;
screenshotManager.setCamera(headPosition, cameraFov);
//let imageName = "AvatarImage_" + Date.now() + ".png";

//const screenshot = screenshotManager.saveAsImage(imageName);
const screenshot = getBlob ?
screenshotManager.getScreenshotBlob(width, height):
screenshotManager.getScreenshotTexture(width, height);
blinkManager.disableScreenshot();
animationManager.disableScreenshot();

return screenshot;
}

// map current app mode to a page
const pages = {
[ViewMode.LANDING]: <Landing />,
Expand All @@ -280,8 +313,8 @@ export default function App() {
),
[ViewMode.CREATE]: <Create fetchNewModel={fetchNewModel} />,
[ViewMode.LOAD]: <Load />,
// [ViewMode.MINT]: <Mint />,
[ViewMode.SAVE]: <Save />,
[ViewMode.MINT]: <Mint getFaceScreenshot = {getFaceScreenshot}/>,
[ViewMode.SAVE]: <Save getFaceScreenshot = {getFaceScreenshot}/>,
[ViewMode.CHAT]: <View templateInfo={templateInfo} />,
}

Expand Down
5 changes: 3 additions & 2 deletions src/components/ExportMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { LanguageContext } from "../context/LanguageContext"

const defaultName = "Anon"

export const ExportMenu = () => {
export const ExportMenu = ({getFaceScreenshot}) => {
// Translate hook
const { t } = useContext(LanguageContext);
const [name] = React.useState(localStorage.getItem("name") || defaultName)
Expand Down Expand Up @@ -44,7 +44,8 @@ export const ExportMenu = () => {
size={14}
className={styles.button}
onClick={() => {
downloadVRM(model, avatar, name, 4096, true)
const screenshot = getFaceScreenshot();
downloadVRM(model, avatar, name, screenshot, 4096, true)
}}
/>
</React.Fragment>
Expand Down
Loading