diff --git a/dcl-workspace.json b/dcl-workspace.json index 18ae052..8beab77 100644 --- a/dcl-workspace.json +++ b/dcl-workspace.json @@ -12,6 +12,9 @@ { "path": "scenes/80,-2-main-crdt" }, + { + "path": "scenes/80,-1-scene-emotes" + }, { "path": "scenes/8,9-portable-experience-disabled" }, diff --git a/scenes/0,4-dynamic-lights/package.json b/scenes/0,4-dynamic-lights/package.json index da660a4..882d4bb 100644 --- a/scenes/0,4-dynamic-lights/package.json +++ b/scenes/0,4-dynamic-lights/package.json @@ -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", diff --git a/scenes/0,4-dynamic-lights/scene.json b/scenes/0,4-dynamic-lights/scene.json index d6ed63c..aa30e7b 100644 --- a/scenes/0,4-dynamic-lights/scene.json +++ b/scenes/0,4-dynamic-lights/scene.json @@ -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" diff --git a/scenes/80,-1-scene-emotes/.dclignore b/scenes/80,-1-scene-emotes/.dclignore new file mode 100644 index 0000000..ef217fa --- /dev/null +++ b/scenes/80,-1-scene-emotes/.dclignore @@ -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 diff --git a/scenes/80,-1-scene-emotes/.gitignore b/scenes/80,-1-scene-emotes/.gitignore new file mode 100644 index 0000000..dcf7d53 --- /dev/null +++ b/scenes/80,-1-scene-emotes/.gitignore @@ -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/ \ No newline at end of file diff --git a/scenes/80,-1-scene-emotes/animations/Crafting_Snowball.glb b/scenes/80,-1-scene-emotes/animations/Crafting_Snowball.glb new file mode 100644 index 0000000..7376b23 Binary files /dev/null and b/scenes/80,-1-scene-emotes/animations/Crafting_Snowball.glb differ diff --git a/scenes/80,-1-scene-emotes/animations/Snowball_Throw.glb b/scenes/80,-1-scene-emotes/animations/Snowball_Throw.glb new file mode 100644 index 0000000..84c1bea Binary files /dev/null and b/scenes/80,-1-scene-emotes/animations/Snowball_Throw.glb differ diff --git a/scenes/80,-1-scene-emotes/images/scene-thumbnail.png b/scenes/80,-1-scene-emotes/images/scene-thumbnail.png new file mode 100644 index 0000000..b3dc580 Binary files /dev/null and b/scenes/80,-1-scene-emotes/images/scene-thumbnail.png differ diff --git a/scenes/80,-1-scene-emotes/models/SnowTree_01.glb b/scenes/80,-1-scene-emotes/models/SnowTree_01.glb new file mode 100644 index 0000000..f054779 Binary files /dev/null and b/scenes/80,-1-scene-emotes/models/SnowTree_01.glb differ diff --git a/scenes/80,-1-scene-emotes/package.json b/scenes/80,-1-scene-emotes/package.json new file mode 100644 index 0000000..c6d7fdf --- /dev/null +++ b/scenes/80,-1-scene-emotes/package.json @@ -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" + } +} \ No newline at end of file diff --git a/scenes/80,-1-scene-emotes/scene.json b/scenes/80,-1-scene-emotes/scene.json new file mode 100644 index 0000000..a9c3a99 --- /dev/null +++ b/scenes/80,-1-scene-emotes/scene.json @@ -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" +} \ No newline at end of file diff --git a/scenes/80,-1-scene-emotes/src/index.ts b/scenes/80,-1-scene-emotes/src/index.ts new file mode 100644 index 0000000..381cebc --- /dev/null +++ b/scenes/80,-1-scene-emotes/src/index.ts @@ -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) +}) \ No newline at end of file diff --git a/scenes/80,-1-scene-emotes/tsconfig.json b/scenes/80,-1-scene-emotes/tsconfig.json new file mode 100644 index 0000000..d0e8a08 --- /dev/null +++ b/scenes/80,-1-scene-emotes/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "allowJs": true, + "strict": true + }, + "include": [ + "src/**/*.ts", + "src/**/*.tsx" + ], + "extends": "@dcl/sdk/types/tsconfig.ecs7.json" +} \ No newline at end of file