gryff Posted June 19, 2016 Share Posted June 19, 2016 I have not been a big user of the Playground - I usually test my Blender scene exports with the Sandbox. However, as SceneLoader.Load is considered deprecated, I thought I would test out SceneLoader.Append using the PG. I disabled both the standard BJS light and Camera as the scene I used contains a light and a camera - and here is my result: gryff's PG And I see the figure and the animation is working, but I get this big box that says : "Compilation error. You must at least create a camera" Now since I can see the figure and animation - where is the camera coming from? It seems to be using the light from the appended file, but both the ways I tried to use the babylon scene file camera throw this Compilation Error. (The other way I tried is to activate line 26 and deactivate lines 31-35) So is this a.) my clumsy coding or b.) my lack of understanding of the PG or c.) something else?? And in addition, it seems that the material for the figure is ignored. This is a link to the same animated figure showing what the material should be: Animation Test Any thoughts greatly appreciated - and hopefully a fix - before this pile hair beside my desk gets any bigger cheers, gryff Edi: If you check your console, you will see the position of the camera from the file I used. Quote Link to comment Share on other sites More sharing options...
Samuel Girardin Posted June 19, 2016 Share Posted June 19, 2016 My two cents : BABYLON.SceneLoader.Append is asynchronous so the scene is returned with no camera. gryff 1 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted June 19, 2016 Share Posted June 19, 2016 Remember, SceneLoader.Load is just a one line function that calls SceneLoader.Append. Load is deprecated primarily due to novice user code issues, and issues when loading multiple .babylon files in a scene. Better to start out using Append. Playground only uses one .babylon & no code runs afterward, so no worries there. Probably should switch it to Append, so message does not end up in console though. Sam is right. Append is async. And executeWhenReady() only registers a function to run later. It does not actually block. The code continues on immediately. That check must run after createScene() ends. It is a minor issue here. The real lesson is not to put code after a executeWhenReady() in a function. FYI, you can get detailed logging of a .babylon by: BABYLON.SceneLoader.loggingLevel = BABYLON.SceneLoader.DETAILED_LOGGING; This can rule out many issues. I added it in 2.4. @Deltakosh did not want to change behavior, so he set it to minimal by default. I think that was a mistake, but it is his toy. Here is with it set gryff 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 20, 2016 Share Posted June 20, 2016 Here is it: http://www.babylonjs-playground.com/#QGMAV#8 gryff 1 Quote Link to comment Share on other sites More sharing options...
gryff Posted June 20, 2016 Author Share Posted June 20, 2016 @Samuel Girardin , @JCPalmer , @Deltakosh Merci et/and thanks for the feedback. I had forgotten all about the async aspect of loading of scene files And thanks Jeff for the loggingLevel code - something new to me so a simple lesson learned - gives a nice summary of the babylon file And thanks DK for the scene.createDefaultCameraOrLight(); code. Another lesson learned. I had actually tried last night what I considered a hack - creating a dummy camera but not attaching it to the canvas - and that worked. Nice to know there is an official way of doing it What I have started to realize is that features are being added to BJS a such a rate that I am falling behind with my knowledge of these features - and not sure I will ever manage to keep up cheers, gryff Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 21, 2016 Share Posted June 21, 2016 Happy that it helped you Quote Link to comment Share on other sites More sharing options...
Nabroski Posted June 23, 2016 Share Posted June 23, 2016 (edited) Hello Append is great, if you want just get rid of the No Camera found in scene error. you can also set the scene.activeCamera = false; Whichtells the editor not looking for a default camera (for my understanding)http://www.babylonjs-playground.com/#QGMAV#11@gryff OFFTOPIC: Nice Model btw, funny play with, you should continue work onhttp://www.babylonjs-playground.com/#QGMAV#18 Edited June 24, 2016 by Nabroski offtopic: added bane::change the callstack:clean up Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.