|
118 | 118 | },
|
119 | 119 |
|
120 | 120 | {
|
121 |
| - "label": "Import a Mesh", |
| 121 | + "label": "Import a Mesh Async", |
122 | 122 | "key": "Import Mesh",
|
123 | 123 | "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});" |
125 | 125 | },
|
126 | 126 | {
|
127 | 127 | "label": "Export scene to GLB",
|
|
140 | 140 | "label": "Import animated character : Dude",
|
141 | 141 | "key": "Dude",
|
142 | 142 | "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});" |
144 | 144 | },
|
145 | 145 | {
|
146 | 146 | "label": "Import animated character : Dummy",
|
147 | 147 | "key": "Dummy",
|
148 | 148 | "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});" |
150 | 150 | },
|
151 | 151 | {
|
152 | 152 | "label": "Import animated character : Samba Girl",
|
153 | 153 | "key": "Samba Girl",
|
154 | 154 | "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});" |
156 | 156 | },
|
157 | 157 |
|
158 | 158 | {
|
|
0 commit comments