Skip to content

Commit 26e58e2

Browse files
authored
Remove deprecated from templates in playground (#16544)
SceneLoader.ImportMesh was removed in favor of ImportMeshAsync
1 parent 94b142e commit 26e58e2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/tools/playground/public/templates.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@
118118
},
119119

120120
{
121-
"label": "Import a Mesh",
121+
"label": "Import a Mesh Async",
122122
"key": "Import Mesh",
123123
"documentation": "https://doc.babylonjs.com/toolsAndResources/thePlayground/externalPGAssets",
124-
"insertText": "BABYLON.SceneLoader.ImportMesh(\"${1:meshName}\", \"${2:url/to/parent/directory}\", \"${3:fileName.fileExtension}\", scene, function(newMeshes){\n\n});"
124+
"insertText": "BABYLON.ImportMeshAsync(\"${1:url/to/parent/directory}/${2:fileName.fileExtension}\", scene, { meshNames: \"${3:}\" }).then((result)=> {\n\n});"
125125
},
126126
{
127127
"label": "Export scene to GLB",
@@ -140,19 +140,19 @@
140140
"label": "Import animated character : Dude",
141141
"key": "Dude",
142142
"documentation": "https://doc.babylonjs.com/features/featuresDeepDive/animation/animatedCharacter",
143-
"insertText": "BABYLON.SceneLoader.ImportMesh(\"\", \"scenes/Dude/\", \"dude.babylon\", scene, function (newMeshes, particleSystems, skeletons) {\n var hero = newMeshes[0];\n hero.scaling.scaleInPlace(0.03);\n scene.beginAnimation(skeletons[0], 0, 100, true, 1.0);\n hero.position.x = 2;\n});"
143+
"insertText": "BABYLON.ImportMeshAsync(\"scenes/Dude/dude.babylon\", scene).then(({meshes, particleSystems, skeletons}) => {\n var hero = meshes[0];\n hero.scaling.scaleInPlace(0.03);\n scene.beginAnimation(skeletons[0], 0, 100, true, 1.0);\n hero.position.x = 2;\n});"
144144
},
145145
{
146146
"label": "Import animated character : Dummy",
147147
"key": "Dummy",
148148
"documentation": "https://doc.babylonjs.com/features/featuresDeepDive/animation/animatedCharacter",
149-
"insertText": "BABYLON.SceneLoader.ImportMesh(\"\", \"./scenes/\", \"dummy3.babylon\", scene, function (newMeshes, particleSystems, skeletons) {\n var hero = newMeshes[0];\n var skeleton = skeletons[0];\n var walkRange = skeleton.getAnimationRange(\"YBot_Walk\");\n scene.beginAnimation(skeleton, walkRange.from, walkRange.to, true);\n hero.position.x = 2;\n});"
149+
"insertText": "BABYLON.ImportMeshAsync(\"./scenes/dummy3.babylon\", scene).then(({meshes, particleSystems, skeletons}) => {\n var hero = meshes[0];\n var skeleton = skeletons[0];\n var walkRange = skeleton.getAnimationRange(\"YBot_Walk\");\n scene.beginAnimation(skeleton, walkRange.from, walkRange.to, true);\n hero.position.x = 2;\n});"
150150
},
151151
{
152152
"label": "Import animated character : Samba Girl",
153153
"key": "Samba Girl",
154154
"documentation": "https://doc.babylonjs.com/features/featuresDeepDive/animation/animatedCharacter",
155-
"insertText": "BABYLON.SceneLoader.ImportMesh(\"\", \"https://assets.babylonjs.com/meshes/\", \"HVGirl.glb\", scene, function (newMeshes, particleSystems, skeletons) {\n var hero = newMeshes[0];\n hero.scaling.scaleInPlace(0.08);\n const sambaAnim = scene.getAnimationGroupByName(\"Samba\");\n sambaAnim.start(true, 1.0, sambaAnim.from, sambaAnim.to, false);\n hero.position.x = 2;\n});"
155+
"insertText": "BABYLON.ImportMeshAsync(\"https://assets.babylonjs.com/meshes/HVGirl.glb\", scene).then( ({meshes, particleSystems, skeletons}) => {\n var hero = meshes[0];\n hero.scaling.scaleInPlace(0.08);\n const sambaAnim = scene.getAnimationGroupByName(\"Samba\");\n sambaAnim.start(true, 1.0, sambaAnim.from, sambaAnim.to, false);\n hero.position.x = 2;\n});"
156156
},
157157

158158
{

0 commit comments

Comments
 (0)