nittrus Posted September 22, 2016 Share Posted September 22, 2016 BABYLON.SceneSerializer.SerializeMesh isn't including the most important bit for meshes, the geometry! I make a cube and then use BABYLON.SceneSerializer.SerializeMesh(cube) and output to console, sure enough no geometry, thus when I use the importer it spits out no geometry found warning.. var thebox = BABYLON.Mesh.CreateBox("thebox", 10, scene); thebox.position.x=thebox.position.z=112; thebox.position.y=5; thebox.id='thebox'; thebox.receiveShadows = true; var box = BABYLON.SceneSerializer.SerializeMesh(thebox); That is all I use, shouldn't the geometry be included in the output of SerializeMesh? I am using Babylon 2.4.0 Here is the JSON stringified output of the serialized mesh that I stored into a file that I'm trying to load from. {"geometries":{"boxes":[],"spheres":[],"cylinders":[],"toruses":[],"grounds":[],"planes":[],"torusKnots":[],"vertexData":[]},"meshes":[{"name":"thebox","id":"thebox","position":[112,5,112],"rotationQuaternion":[0,0,0,1],"scaling":[1,1,1],"localMatrix":{"0":1,"1":0,"2":0,"3":0,"4":0,"5":1,"6":0,"7":0,"8":0,"9":0,"10":1,"11":0,"12":0,"13":0,"14":0,"15":1},"isEnabled":true,"isVisible":true,"infiniteDistance":false,"pickable":true,"receiveShadows":true,"billboardMode":0,"visibility":1,"checkCollisions":true,"geometryId":"98a28707-f3ba-4062-bfc4-47ca8830cf79","subMeshes":[{"materialIndex":0,"verticesStart":0,"verticesCount":24,"indexStart":0,"indexCount":36}],"physicsMass":0,"physicsFriction":0.2,"physicsImpostor":2,"instances":[],"animations":[],"ranges":[],"layerMask":268435455}]} No vertexData or geometry matching the geometryId.. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 22, 2016 Share Posted September 22, 2016 Hello using bjs 2.5, I can see values in vertexData: http://www.babylonjs-playground.com/#28G6UT#2 Quote Link to comment Share on other sites More sharing options...
nittrus Posted September 22, 2016 Author Share Posted September 22, 2016 1 minute ago, Deltakosh said: Hello using bjs 2.5, I can see values in vertexData: http://www.babylonjs-playground.com/#28G6UT#2 Oh so was this a regression in 2.4? Thanks! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 22, 2016 Share Posted September 22, 2016 Undoubtedly Quote Link to comment Share on other sites More sharing options...
nittrus Posted September 22, 2016 Author Share Posted September 22, 2016 2 minutes ago, Deltakosh said: Undoubtedly I figured considering I found another post for 2.2 where that issue had been addressed, glad it's not just me, lol Thanks, migrated to alpha 2.5, now lets see if everything still works, considering I'm not using much yet it should.. Quote Link to comment Share on other sites More sharing options...
nittrus Posted September 22, 2016 Author Share Posted September 22, 2016 Scratch that, still showing I'm using 2.4.0, I downloaded from github under dist/preview release but that seems to be 2.4.0 not 2.5 alpha, where do I find 2.5? I suppose I could save it from the PG source.. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 22, 2016 Share Posted September 22, 2016 Here: https://github.com/BabylonJS/Babylon.js/tree/master/dist/preview release Quote Link to comment Share on other sites More sharing options...
nittrus Posted September 22, 2016 Author Share Posted September 22, 2016 2 minutes ago, Deltakosh said: Here: https://github.com/BabylonJS/Babylon.js/tree/master/dist/preview release Well sadly 2.5 is no go "Unable to load player/girl.babylon" which is the main character model and previously loaded fine in 2.4.0 Quote Link to comment Share on other sites More sharing options...
nittrus Posted September 22, 2016 Author Share Posted September 22, 2016 I just noticed the irony here.. before I couldn't serialize because the lack of something, now the BABYLON.SceneLoader.ImportMesh don't work in 2.5 alpha LOL, the exact opposite issue! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 23, 2016 Share Posted September 23, 2016 it should work. How do you export it? from blender? Can you share your blender file if this is the case Quote Link to comment Share on other sites More sharing options...
nittrus Posted September 23, 2016 Author Share Posted September 23, 2016 31 minutes ago, Deltakosh said: it should work. How do you export it? from blender? Can you share your blender file if this is the case I exported it awhile back using the Blender .babylon exporter, it's been working fine up until I try to load it in using 2.5 alpha I tried to paste the contents of the .babylon file and locked up my browser for 15 minutes lol, so I've attached it instead. girl.babylon Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 26, 2016 Share Posted September 26, 2016 can you try to reexport it with the latest blender exporter? That should fix the issue Quote Link to comment Share on other sites More sharing options...
nittrus Posted September 26, 2016 Author Share Posted September 26, 2016 1 minute ago, Deltakosh said: can you try to reexport it with the latest blender exporter? That should fix the issue Will get that setup, new machine! Once I find the time, couple hours will let you know how it goes. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
nittrus Posted September 27, 2016 Author Share Posted September 27, 2016 I am getting with the model using the new? exporter: babylon.js:51259 Uncaught TypeError: Cannot read property 'length' of undefined I did notice that the io_export_babylon.py file as the documentation for installing it mentioned that is needed, that hasn't been modified in over 3 months but the exporter zip file for 5.0 has been edited 22 days ago, I have a feeling that io_export_babylon.py isn't needed with the 5.0 bit and the documentation is thus out of date, so I haven't a clue how to install the new 5.0 plugin. Any pointers on how to go about installing the new exporter to Blender? Quote Link to comment Share on other sites More sharing options...
nittrus Posted September 27, 2016 Author Share Posted September 27, 2016 I installed 5.0 Importer after I discovered the _init_.py file was the same type of internals as the old io_export file but it is listing in the Missing script files section of the add-ons section, I am using Blender 2.77 (latest on their website) I'll try to get Blender 2.76 like the importer is made for. Quote Link to comment Share on other sites More sharing options...
nittrus Posted September 27, 2016 Author Share Posted September 27, 2016 No go for Blender 2.76 x64 on Windows 10, it doesn't show up at all under All categories searching for Babylon like it did on 2.77a, I can not find it in any category. So for some reason the exporter made for 2.76 isn't working on 2.76 for me Thanks again for the help, maybe we can figure out what's going on, wondering if it is just me or not.. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 28, 2016 Share Posted September 28, 2016 ping @gryff who can hopefully help Quote Link to comment Share on other sites More sharing options...
nittrus Posted September 28, 2016 Author Share Posted September 28, 2016 2 hours ago, Deltakosh said: ping @gryff who can hopefully help Poked gryff, thanks! Quote Link to comment Share on other sites More sharing options...
nittrus Posted September 28, 2016 Author Share Posted September 28, 2016 babylon.js:4895 Uncaught Error: Error status: 0 - Unable to load C:\Users\Nittrus\AppData\Local\galaxia\User Data\Default\store\32z32x_1.babylon This is what I get now, looking in Network on chrome dev console shows it loads it and has a preview of the file contents but for some reason it just not doing anything with it. I wish it had a better way to say what the error actually is, because that says nothing at all of any use. Quote Link to comment Share on other sites More sharing options...
gryff Posted September 29, 2016 Share Posted September 29, 2016 9 hours ago, Deltakosh said: ping @gryff who can hopefully help You called sir ;-) I've responded to a PM from nittrus and tried to show him the way to install the latest version of the exporter - v5.0.5 Maybe a new tutorial on how to install the new exporter which is a zip file - no need to unzip it Remove all old exporters from Blender then : File -> User Preferences -> Addons Tab -> Install From File -> Point to the downloaded .zip file. Any chance of getting the girl.blend file ? cheers, gryff Quote Link to comment Share on other sites More sharing options...
nittrus Posted September 29, 2016 Author Share Posted September 29, 2016 8 minutes ago, gryff said: You called sir ;-) I've responded to a PM from nittrus and tried to show him the way to install the latest version of the exporter - v5.0.5 Maybe a new tutorial on how to install the new exporter which is a zip file - no need to unzip it Remove all old exporters from Blender then : File -> User Preferences -> Addons Tab -> Install From File -> Point to the downloaded .zip file. Any chance of getting the girl.blend file ? cheers, gryff It's actually a girl.3ds file, just a free reference model I'm using for the time being. The main issue now that I am having is the exporting from BabylonJS to file then using ImportMesh to load it, not sure what's going on there.. If I can get that to work I'll be able to progress with my project! As for the girl.babylon file, no go still, I did get the exporter plugin working but the MeshLoader isn't loading in the girl.babylon file just like it's not loading in anything I save to disk like in the above posts. I get: babylon.js:51259 Uncaught TypeError: Cannot read property 'length' of undefined So frustrating oi.. I have attached the girl.3ds which I import into Blender then export using the 5.0 exporter which results in girl.babylon as attached! girl.3ds girl.babylon Quote Link to comment Share on other sites More sharing options...
nittrus Posted September 29, 2016 Author Share Posted September 29, 2016 OK this is odd, I import into Blender the girl model from the OBJ file instead and export and it exports including the textures and loads into BabylonJS fine! So for some reason it matters what type of model you import into Blender or something relating to settings contained in those formats possibly. As long as I import as OBJ or save as OBJ then export using 5.0 exporter it works! Quote Link to comment Share on other sites More sharing options...
gryff Posted September 29, 2016 Share Posted September 29, 2016 @nittrus : well personal experience over the years has taught me that that different file formats created in various types of software (from cheap to expensive) don't always play well. Different people write the importers and exporters for different pieces of software - they may not be be thinking the same way. The only other formats I have ever used (which is rarely) are .obj and .dae - and even then, recent models. Here is a .babylon that you can use to test your code - base_model It has a single mesh (called "Body") with a single material, a camera and a light.- see image below You can use it to test the BABYLON.SceneSerializer.SerializeMesh code Glad to see the .obj version works cheers, gryff Quote Link to comment Share on other sites More sharing options...
nittrus Posted September 29, 2016 Author Share Posted September 29, 2016 37 minutes ago, gryff said: @nittrus : well personal experience over the years has taught me that that different file formats created in various types of software (from cheap to expensive) don't always play well. Different people write the importers and exporters for different pieces of software - they may not be be thinking the same way. The only other formats I have ever used (which is rarely) are .obj and .dae - and even then, recent models. Here is a .babylon that you can use to test your code - base_model It has a single mesh (called "Body") with a single material, a camera and a light. You can use it to test the BABYLON.SceneSerializer.SerializeMesh code Glad to see the .obj version works cheers, gryff Yeap the Blender exporting issue is resolved! I'll try that object, will try to serialize and JSON stringify to a file and then load using ImportMesh and get back to you on the results. Quote Link to comment Share on other sites More sharing options...
nittrus Posted September 29, 2016 Author Share Posted September 29, 2016 OK didn't need to serial that or anything as it was already Babylon format, I tried to load it in, same error, I'm using BabylonJS 2.5-alpha 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.