Skip to content

Commit

Permalink
fixed workspace and added scene emotes test scene
Browse files Browse the repository at this point in the history
  • Loading branch information
pravusjif committed Feb 25, 2025
1 parent fc6fa26 commit 656c91e
Show file tree
Hide file tree
Showing 13 changed files with 128 additions and 3 deletions.
3 changes: 3 additions & 0 deletions dcl-workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
{
"path": "scenes/80,-2-main-crdt"
},
{
"path": "scenes/80,-1-scene-emotes"
},
{
"path": "scenes/8,9-portable-experience-disabled"
},
Expand Down
4 changes: 2 additions & 2 deletions scenes/0,4-dynamic-lights/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "dcl-project",
"name": "dynamic-lights",
"version": "1.0.0",
"description": "SDK7 Template scene",
"description": "dynamic-lights",
"scripts": {
"start": "sdk-commands start",
"deploy": "sdk-commands deploy",
Expand Down
2 changes: 1 addition & 1 deletion scenes/0,4-dynamic-lights/scene.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"ecs7": true,
"runtimeVersion": "7",
"display": {
"title": "Cornell-box",
"title": "dynamic-lights",
"description": "Test scene for Dynamic Lights",
"favicon": "favicon_asset",
"navmapThumbnail": "assets\\images\\autogenerated-thumbnail.png"
Expand Down
20 changes: 20 additions & 0 deletions scenes/80,-1-scene-emotes/.dclignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.*
bin/*.map
package-lock.json
yarn-lock.json
build.json
export
tsconfig.json
tslint.json
node_modules
*.ts
*.tsx
.vscode
Dockerfile
dist
README.md
*.blend
*.fbx
*.zip
*.rar
src
10 changes: 10 additions & 0 deletions scenes/80,-1-scene-emotes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package-lock.json
*.js
node_modules
bin/
.DS_Store
**/.DS_Store
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.idea/
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added scenes/80,-1-scene-emotes/models/SnowTree_01.glb
Binary file not shown.
29 changes: 29 additions & 0 deletions scenes/80,-1-scene-emotes/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "scene-emotes",
"description": "Avatar custom animations from the scene",
"version": "1.0.0",
"dependencies": {
"@dcl-sdk/utils": "latest"
},
"devDependencies": {
"@dcl/sdk": "latest",
"@dcl/js-runtime": "7.7.5"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=6.0.0"
},
"prettier": {
"semi": false,
"singleQuote": true,
"printWidth": 120,
"trailingComma": "none"
},
"scripts": {
"build": "sdk-commands build",
"deploy": "sdk-commands deploy",
"start": "sdk-commands start",
"upgrade-sdk": "npm install --save-dev @dcl/sdk@latest",
"upgrade-sdk:next": "npm install --save-dev @dcl/sdk@next"
}
}
26 changes: 26 additions & 0 deletions scenes/80,-1-scene-emotes/scene.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"ecs7": true,
"runtimeVersion": "7",
"display": {
"title": "scene-emotes",
"description": "A simple scene to play avatar emote animations triggered by the scene",
"navmapThumbnail": "images/scene-thumbnail.png",
"favicon": "favicon_asset"
},
"owner": "",
"contact": {
"name": "SDK",
"email": ""
},
"main": "bin/index.js",
"tags": [],
"scene": {
"parcels": [
"80,-1"
],
"base": "80,-1"
},
"spawnPoints": [],
"featureToggles": {},
"name": "scene-emotes"
}
26 changes: 26 additions & 0 deletions scenes/80,-1-scene-emotes/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Vector3 } from '@dcl/sdk/math'
import { triggerEmote, triggerSceneEmote } from '~system/RestrictedActions'

import * as utils from '@dcl-sdk/utils'
import { engine, GltfContainer, Transform } from '@dcl/sdk/ecs'

utils.addTestCube({ position: Vector3.create(8, 1, 5) }, () => {
triggerEmote({ predefinedEmote: 'robot' })
}, "Trigger Avatar Emote")

utils.addTestCube({ position: Vector3.create(8, 1, 8) }, () => {
triggerSceneEmote({ src: 'animations/Crafting_Snowball.glb', loop: false })
}, "Trigger Scene Emote Craft Snowball")

utils.addTestCube({ position: Vector3.create(8, 1, 12) }, () => {
triggerSceneEmote({ src: 'animations/Snowball_Throw.glb', loop: false })
}, "Trigger Scene Emote Snowball Throw")


let snowTree = engine.addEntity()

GltfContainer.create(snowTree, { src: "models/SnowTree_01.glb" })
Transform.create(snowTree, {
position: Vector3.create(12, 0, 10),
scale: Vector3.create(1, 1, 1)
})
11 changes: 11 additions & 0 deletions scenes/80,-1-scene-emotes/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"compilerOptions": {
"allowJs": true,
"strict": true
},
"include": [
"src/**/*.ts",
"src/**/*.tsx"
],
"extends": "@dcl/sdk/types/tsconfig.ecs7.json"
}

0 comments on commit 656c91e

Please sign in to comment.