iiceman Posted March 7, 2015 Author Share Posted March 7, 2015 Very nice! Thank you!!! I am always suprised how fast you answer and come up with a fix Quote Link to comment Share on other sites More sharing options...
vahith Posted March 18, 2015 Share Posted March 18, 2015 hi Raanan! i tried you code in my demo playground when i loading saved scene its giving error kindly suggest me what i am doing wrong in this codethis is the reference playgroundhttp://www.babylonjs-playground.com/#VMFNH#15 Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 18, 2015 Share Posted March 18, 2015 That's odd, should have been repaired. The loader is not loading the target set.I will look into it and let you know. Quote Link to comment Share on other sites More sharing options...
vahith Posted March 18, 2015 Share Posted March 18, 2015 ok thanks @Raanan.. Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 18, 2015 Share Posted March 18, 2015 The loader is trying to get the view matrix at the constructor, which tries to load the target (which is only set later). So at certain cases it will fail. The scene is loaded correctly, the problem is that one single getViewMatrix call didn't work. I sent a PR (https://github.com/BabylonJS/Babylon.js/pull/443) setting a default target for an ArcRotate camera, which should solve this issue. At first a default value will be set, and later the correct target, if sent by the use in the scene. So target is not obligatory. default is Vector3.Zero(). Quote Link to comment Share on other sites More sharing options...
vahith Posted March 18, 2015 Share Posted March 18, 2015 hi raanan. the problem is that one single getViewMatrix call didn't work. i am not getting...so you mean i want to download new bjs from github Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 18, 2015 Share Posted March 18, 2015 The commit was just integrated, so building babylon from github well shady include the fix. You can also wait a bit until DK will update the generated version in github. Won't take long, I'm sure. vahith 1 Quote Link to comment Share on other sites More sharing options...
vahith Posted March 19, 2015 Share Posted March 19, 2015 hi raanan, now scene is loading but scene which is loading there camera and other controller are not working.. reference linkhttp://www.babylonjs-playground.com/#VMFNH#17 Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 19, 2015 Share Posted March 19, 2015 Simply reattach the controls and everything is dandy - http://www.babylonjs-playground.com/#VMFNH#19Great, it's finally working Quote Link to comment Share on other sites More sharing options...
vahith Posted March 19, 2015 Share Posted March 19, 2015 hi;should i want to download the new babylon.js from github,if yes which version i want to download... and one more thing after loading movewithcollision is not working. what i mean is...movement of meshes is not working after loading Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 19, 2015 Share Posted March 19, 2015 The Serializer is only serializing the scene. Any functionality you added (for example in the scene before or after rendering functions) will not be serialized. You will have to "recreate" your scene - attach the controls again, set the correct animations and start them (if done using code), move your light's position programmatically etc'. It will give you a scene file to load and play with. Not more than that .In your case - all of the ponter event functions will be voided if loaded in a different browser window. They won't exist. What exactly are you trying to achieve? Maybe the serializer is not exactly what you need. Maybe simply copying the code from the playground to you locally would work better! vahith 1 Quote Link to comment Share on other sites More sharing options...
vahith Posted March 19, 2015 Share Posted March 19, 2015 hi raanan; actually what i want to achieve is.. i am using BJS in html page,there i am having one button to save the scene and one button to load the scene, when i am click the save the button, i want to take the back up of scene and when i click the load it will load the save scene and there again i want to continue with that saved scene... Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 19, 2015 Share Posted March 19, 2015 So you will have to add the functionality yourself and attach it to the scene.Actions (for example) cannot be added to a scene file. Scene events (before/after render etc') too. External functions too. Look at the source of the serializer to see what it does (or doesn't) - https://github.com/BabylonJS/Babylon.js/blob/c37f4834838b88fe5dc88c0c4f66e06602c7887e/Babylon/Tools/babylon.sceneSerializer.ts I also implemented a (very simple) scene loader in the material editor - https://github.com/BabylonJS/Extensions/blob/master/MaterialEditor/MaterialEditor/canvas/CanvasController.ts#L148 , but in general you need nothing more than the scene loader vahith 1 Quote Link to comment Share on other sites More sharing options...
vahith Posted March 19, 2015 Share Posted March 19, 2015 hi raanan, I also implemented a (very simple) scene loader in the material editor - https://github.com/B...troller.ts#L148 , but in general you need nothing more than the scene loadersorry i am not getting Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 19, 2015 Share Posted March 19, 2015 What I meant was that for advanced scene loading you can see what was done in the material editor. But, as you already used the function, the Scene Loader functionality is more than enough for your use-case. vahith 1 Quote Link to comment Share on other sites More sharing options...
vahith Posted March 25, 2015 Share Posted March 25, 2015 hi raanan.. now i can able to do save and load scene...thanks for your points.. finally i done what i need.. thanks... Quote Link to comment Share on other sites More sharing options...
vahith Posted April 16, 2015 Share Posted April 16, 2015 hi all i am having some problem in loading scene..when i am loading the data it give some error likeTypeError: a is undefined...FromArray=function(a,c){return c||(c=0),new b(a[c],a[c+1],a[c+2])},b.FromArrayTo...could you suggest me what i am doing wrong.. Quote Link to comment Share on other sites More sharing options...
RaananW Posted April 16, 2015 Share Posted April 16, 2015 Some parameter is missing. Try loading the scene with the debug version of BJS, you will then be able to see which parameter is missing. Quote Link to comment Share on other sites More sharing options...
vahith Posted April 16, 2015 Share Posted April 16, 2015 hi i checked in debug version error showing in this line.. Vector3.FromArray = function (array, offset) { if (!offset) { offset = 0; } return new Vector3(array[offset], array[offset + 1], array[offset + 2]); };i am not getting which parameter i am missing Quote Link to comment Share on other sites More sharing options...
RaananW Posted April 16, 2015 Share Posted April 16, 2015 This will require debugging. The Stacktrace is important here. Think you can share the scene? Quote Link to comment Share on other sites More sharing options...
vahith Posted April 16, 2015 Share Posted April 16, 2015 hi raananw. now i able to get the saved data..but previously i given camera target id as canvas now i change target position to [0,0,0]. Now its working fine.. but my question here if i give camera target id to canvas it wont work..? Quote Link to comment Share on other sites More sharing options...
Blax Posted April 17, 2015 Share Posted April 17, 2015 hi, folks. Perhaps you knows what's kind this problem:in loaded file:"excludedMeshesIds": ["Cube.110","Cube.111"],"includedOnlyMeshesIds": ["Cube.090","Cube.091"],after loading, light have set only_excludedMeshesIds and _includedOnlyMeshesIds arrays, but not set excludedMeshes and includedOnlyMeshes arrays.i must init this manually?And next, but not important: Adding in excludedMeshes not change _excludedMeshesIds, and when i save the scene i must use excludedMeshes. Quote Link to comment Share on other sites More sharing options...
RaananW Posted April 17, 2015 Share Posted April 17, 2015 Hi Vahith,camera.target should be a Vector3. to set a mesh id you can use the camera.lockedTargetId parameter (where you can give a mesh ID to set as a locked target). @Blax,This is the correct behaviour, if you are checing the arrays right after a scene was loaded. The excludedMeshes and includedOnlyMeshes arrays are populated only during an update. which will be right after before the first frame is rendered. If you had elements in the scene file's "excludedMeshesIds" or "includedOnlyMeshesIds", they will be stored temporarily in the _excludedMeshesIds and _includedOnlyMeshesIds arrays and will be processed later. Quote Link to comment Share on other sites More sharing options...
Blax Posted April 17, 2015 Share Posted April 17, 2015 Hi Vahith,camera.target should be a Vector3. to set a mesh id you can use the camera.lockedTargetId parameter (where you can give a mesh ID to set as a locked target). @Blax,This is the correct behaviour, if you are checing the arrays right after a scene was loaded. The excludedMeshes and includedOnlyMeshes arrays are populated only during an update. which will be right after before the first frame is rendered. If you had elements in the scene file's "excludedMeshesIds" or "includedOnlyMeshesIds", they will be stored temporarily in the _excludedMeshesIds and _includedOnlyMeshesIds arrays and will be processed later. Thank you, RaananW! Sounds logical, but it not work 1. load the scene.2. set engine.runRenderLoop function, and render. Render is work (my Cube is rotating in canvas).3. check _excludedMeshesIds - all correct4. check excludedMeshes - is empty and in scene can not see any exclusion.5. if i set excludedMeshes manually - all is work, exclusion can see.Where to dig? Quote Link to comment Share on other sites More sharing options...
RaananW Posted April 17, 2015 Share Posted April 17, 2015 Can you show the scene you are trying to load? Assumptions: We are talking about a light that reflects on specific meshes.The meshes all have a materialIf those two are correct and everything is activated, there shouldn't be a reason why it doesn't work. But would be great to find the cause and fix it. 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.