Darcey
September 10, 2021, 12:54pm
1
Property ‘createDefaultEnvironment’ does not exist on type ‘Scene’.
Project type: TypeScript
import { Scene } from “@babylonjs /core/scene”;
this.scene.createDefaultEnvironment ({
environmentTexture: hdrTexture
})
The method doesn’t exist on the the scene from core/scene, is there another scene import I should be using?
According to API Docs, it’s listed:
1 Like
Darcey
September 10, 2021, 1:02pm
2
import “@babylonjs /core/Helpers/sceneHelpers”;
Used UltraEdit to search through gitrepo download for createDefaultEnvironment function, once found I then imported that file…
Why does babylon work this way?
2 Likes
sebavan
September 10, 2021, 2:37pm
3
This is the only way we had to support tree shaking quickly without breaking backward compat but still at a decent tree shaking ratio
@RaananW is evaluating a different approach for all this.
Darcey
September 10, 2021, 3:07pm
4
Don’t suppose you know which file to include for scene.activeCamera as my search is finding it in many many files but getting error activeCamera is not a property or does not exist…
sebavan
September 10, 2021, 3:33pm
5
activeCamera is part of scene without any needs for external modules.
This is really strange is would not be available.