Soulangel Posted December 2, 2014 Share Posted December 2, 2014 Hi everyone, In my project, I use one Preloader (Thanks to Temechon ) to load geometry I need. So I use the importMesh method to import my different meshes.But, unless I am mistaken in the importMesh method the parsedLights and parsedCameras is never called. However ,in one of my models, I model 2 spot lights, and with the importMesh is never imported. Is it possible to manage the import lights with importMesh method? If not why? Regards, Soul Quote Link to comment Share on other sites More sharing options...
davrous Posted December 2, 2014 Share Posted December 2, 2014 Today, we have 2 ways to import: only a mesh (the geometry with no light and no camera but the materials associated to it) and the loadScene to load everything: cameras, lights, meshes, animations and so on. The importMesh has been designed to inject a mesh with its materials into an existing scene with its own camera & lightning.In conclusion, you need to rather create your camera and lights by code or use the loadScene instead of importMesh.David Quote Link to comment Share on other sites More sharing options...
Temechon Posted December 2, 2014 Share Posted December 2, 2014 Or you can create your own method 'importLight' and do a pull request The importMesh is only used to import a specific mesh (like David said it) Quote Link to comment Share on other sites More sharing options...
RaananW Posted December 2, 2014 Share Posted December 2, 2014 I think he can use the SceneLoader.Append() method of the scene loader. This way he enjoys both worlds - he has his already created scene but can still import an entire scene to it, including light and camera (I am not sure what will happen with the active camera, it's worth a try!) Quote Link to comment Share on other sites More sharing options...
Soulangel Posted December 3, 2014 Author Share Posted December 3, 2014 Hi, First, I want to thank you for your answer. Then, I understand the difference between the LoadScene (in charge to create a scene) and ImportMesh (add a mesh into an existing scene).But, in my point of view, the loader alogithme should be the same, because some just need to load a scene, while the other manage objects with specific mesh and need to import mesh, will create an instance of their class (like me). For instance: I have a rover with equipments including a camera and spots. However, thanks to @raananw, the append Method solve my problem regards, Soul Quote Link to comment Share on other sites More sharing options...
RaananW Posted December 3, 2014 Share Posted December 3, 2014 I am happy it helped.The append function is rather new, i think a month or two ago someone suggest to implement it (here in the forum, you can try searching). It's rather new and (i believe) not yet documented. I guess that with version 2 the documentation will be a bit better. (@Deltakosh, @davrous und Co., if any help is needed with documentation, please let me know, I would be happy to start documenting classes and their functions, I think everyone will benefit) Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 3, 2014 Share Posted December 3, 2014 @raananw: It is expected that there was a new official documentation, but we have no news about it. We wait patiently.This probably will be when version 2.0 will be complete (I love version 2 has come with export Unity3d to Babylon ). but I think Deltakosh tell us more about this (new official documentation). GOOOOD NEWS!!!!!!!!!!! I found a way to pay for a better documentation directly integrated into babylonjs.com ! Expect more news soon!here:http://www.html5gamedevs.com/topic/2640-documentation/?p=50797 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.