jdnichollsc Posted December 31, 2014 Share Posted December 31, 2014 Hi friends! I try to export a .obj from Blender to Babylon.js but I'm detecting an error. .obj file => http://www.nicholls.co/canvas/threejs/TommyEnsayoTexturas.OBJ Blender demo => http://www.nicholls.co/canvas/babylon/ PD: With Three.js it works well => http://www.nicholls.co/canvas/threejs/ Any help will be much appreciated and Sorry for my bad english Thanks in advance, Nicholls Quote Link to comment Share on other sites More sharing options...
gryff Posted January 1, 2015 Share Posted January 1, 2015 Hi Nicholls, welcome to the forum I tried the demo, and it does look odd. So I downloaded your.obj file and imported it into Blender, exported it as a .babylon file, then tested it in the Babylon sandbox - worked fine (see attached image) Now the file I imported just has a default material, and in your demo it seems to have multiple materials, so it would be useful if I could have a look at your .blend file to make sure you have not altered the file in some way that is producing the odd result. Ohh and as a comment, do you really need a little figure that has 365,000+ triangles ? cheers, gryff Quote Link to comment Share on other sites More sharing options...
jdnichollsc Posted January 1, 2015 Author Share Posted January 1, 2015 Hi Gryff, Thanks for the welcome and for your quickly response! I tested also in the Babylon sandbox, but... http://screencast.com/t/Bxho0FoXvjq .babylon file expoted from Blender 2.72b => http://www.nicholls.co/canvas/babylon/demo.babylon Can you tell me please the steps you followed to export the file to .babylon? Thanks again! Quote Link to comment Share on other sites More sharing options...
gryff Posted January 2, 2015 Share Posted January 2, 2015 Can you tell me please the steps you followed to export the file to .babylon? Nothing special Nicholls - just imported the object file then exported as a .babylon file. The imported object just has a default white material. Now the demo you posted has multiple materials (and textures?), so I would like to have a look at your .blend file - see what you did to add those materials. If you could post the .blend file somewhere it would help. cheers, gryff Quote Link to comment Share on other sites More sharing options...
jdnichollsc Posted January 2, 2015 Author Share Posted January 2, 2015 Hi Gryff, In my demo also imported the .obj file and then exported as a .babylon file (I haven't changed anything in Blender) Please look at my attachments Thanks! Tommy.zip Quote Link to comment Share on other sites More sharing options...
gryff Posted January 2, 2015 Share Posted January 2, 2015 Nicholls - this is what you are looking for (takes a few seconds to load): Nick's Creature So a couple of questions for you: 1. What version of Blender are you using?2. What version of the Babylon exporter are you using? (In Blender, go to File->User Preferences->Addons, then type "babylon" into the search box, then click on the little arrow at the left of results you get - you should see the author and version) I will delete the link after a week as the file is huge (and I changed the .bmp texture to a .png to reduce the overhead - by 30!) cheers, gryff Quote Link to comment Share on other sites More sharing options...
jdnichollsc Posted January 2, 2015 Author Share Posted January 2, 2015 Wowww, haha excellent Gryff! Regarding your questions 1. Blender 2.72b (64 bits) 2. Version 1.3.1 (https://github.com/BabylonJS/Babylon.js/tree/master/Exporters/Blender) PD: Would you explain me how to install the addon to see if I'm doing wrong? (I give install from the file and select io_export_babylon.py) Thanks for your help and happy new year my friend! Quote Link to comment Share on other sites More sharing options...
jdnichollsc Posted January 2, 2015 Author Share Posted January 2, 2015 I also tried exporting the .babylon file using command line tool, but it shows me an error Babylon.js Exporters (BabylonExporter.zip) => https://github.com/BabylonJS/Babylon.js/tree/master/Exporters Regards, Nicholls Quote Link to comment Share on other sites More sharing options...
gryff Posted January 2, 2015 Share Posted January 2, 2015 TY for the version info Juan My version setup in image below. This is from my 32 bit Windows XP machine. Blender is only supported to v2.71 on XP. I will try the whole process on Windows 7 with Blender 2.72 later today (not sure when exactly as my daughter is visiting today). As you can see, my version of the exporter is v1.4. Would you explain me how to install the addon to see if I'm doing wrong? (I give install from the file and select io_export_babylon.py) That is exactly how I do it. But I think we are getting closer to an answer. cheers, gryff jdnichollsc 1 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 2, 2015 Share Posted January 2, 2015 The version 1.4 was the very last one committed with the original code base. (I have put aside a copy of this on my system). When David switched to the Tower of Babel code base, he probably should have set the version to 1.5, but left it at TOB's 1.1. Nicholls has the current repository version. The new code base produces a log file, which the old one did not. It is usually very small. Please post it, as it is much better for diagnostics, than just looking at the output. Also, I have experience strange things with materials. Usually when multiple exports occur in the same session. Textures get duplicated. This happened with both code bases. Please try doing all your importing from whatever .obj is, then save to .blend. Exit Blender, restart & export from a clean instance of Blender. In my recent examination of the MHX2 scripts, I see they are doing this reload every run. May need to look into this. In any case post your log file. This is why .log files are so important. I probably would never have noticed this without it. Quote Link to comment Share on other sites More sharing options...
gryff Posted January 2, 2015 Share Posted January 2, 2015 Hi Jeff, here is the log file: Babylon.js Exporter version: 1.3.1, Blender version: 2.72 (sub 0)========= Conversion from Blender to Babylon.js ========= Python World class constructor completed processing begun of material: demo_w7.defaultMat.001 Diffuse texture found processing begun of light (HEMI): Hemi processing begun of mesh: Group6846 num positions : 65533 num normals : 65533 num uvs : 131066 num uvs2 : 0 num colors : 0 num indices : 193479 WARNING: The following mesh has exceeded the maximum # of vertex elements & will be broken into multiple Babylon meshes: Group6846 processing begun of mesh: Group68461 num positions : 65534 num normals : 65534 num uvs : 131068 num uvs2 : 0 num colors : 0 num indices : 190104 processing begun of mesh: Group68462 num positions : 65534 num normals : 65534 num uvs : 131068 num uvs2 : 0 num colors : 0 num indices : 193266 processing begun of mesh: Group68463 num positions : 65534 num normals : 65534 num uvs : 131068 num uvs2 : 0 num colors : 0 num indices : 192588 processing begun of mesh: Group68464 num positions : 65535 num normals : 65535 num uvs : 131070 num uvs2 : 0 num colors : 0 num indices : 191580 processing begun of mesh: Group68465 num positions : 45692 num normals : 45692 num uvs : 91384 num uvs2 : 0 num colors : 0 num indices : 134919 processing begun of light (POINT): Lamp processing begun of camera (FreeCamera): Camera========= Writing of scene file started ================== Writing of scene file completed ================== end of processing ========= I suspect this is the issue: WARNING: The following mesh has exceeded the maximum # of vertex elements & will be broken into multiple Babylon meshes: Group6846 Juan's model has a lot of verts 360,000+ ( see my link above the fps and verts count are displayed on screen). What I find curious is that I removed v1.3.1 of the exporter and installed v1.4 for my Blender v2.72 (Windows 7) . No warnings, and the creature displays fine on my local server. The old exporter works fine - or appears to - that I don't understand As I said Juan, we are getting closer. cheers, gryff Quote Link to comment Share on other sites More sharing options...
jdnichollsc Posted January 2, 2015 Author Share Posted January 2, 2015 Where do I can download version 1.4? PD: I'm trying to export on a 64 bit Windows 8.1 Thanks JCPalmer and Gryff Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 2, 2015 Share Posted January 2, 2015 Gryff, Thanks. The TOB code base is the future as it is far more modular / object oriented. That said, uncommon conditions that I did not have a .blend to test with (you actually built most of the base case .blends) would have to just be discovered as reported. Never had a .blend that triggered this. Have downloaded the .blend from above. Will attempt to get new code base to work, & commit with a 1.5 version #. Nicholls, would you mind donating the .blend to the set of base base, test, .blends (published in the Extension repository)? If you wish to use last version of the old code base(1.4) while you wait, select the text from here & paste into a file. https://github.com/BabylonJS/Babylon.js/blob/afb1811033b00d39a5ab4592c7ddce9a559e0b8b/Exporters/Blender/io_export_babylon.py Quote Link to comment Share on other sites More sharing options...
gryff Posted January 2, 2015 Share Posted January 2, 2015 Well Jeff, as you put it That said, uncommon conditions that I did not have a .blend to test with (you actually built most of the base case .blends) would have to just be discovered as reported. and 360,000+ verts is a very "uncommon condition" for a little character like that. I would normally think of 10-30,000 verts - and perhaps even lower. That kind of vertex number I've only ever seen for still renders. cheers, gryff Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 2, 2015 Share Posted January 2, 2015 Gryff, The reason the 1.4 version did not show any warnings is because that version never showed any warnings, or a log file. It is the exporter itself which produces the message that warnings were generated. The old code base usually produced the same sub-optimal output as the new, but did so completely silently. This silence can things very opaque. Quote Link to comment Share on other sites More sharing options...
jdnichollsc Posted January 2, 2015 Author Share Posted January 2, 2015 Hi guys! I try to export with 1.4 version and it works well http://www.nicholls.co/canvas/babylon/ JCPalmer, I would be happy to donate this .blend (I have attached the file previously), Thanks for your help Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 2, 2015 Share Posted January 2, 2015 Well had my first go at producing output (.js , will get .babylon format to work later), BUT output was so massive that it crashed every editor trying to view it. This was going to be a real pain to test, but I remembered that the value for the test for "too many vertices" had been turned into a constant. I might not have to test that the real, 65K, max works all the way to the browser, just that splitting a mesh works. Temporarily dropped down the limit to 1000, and ran with a .blend that would produce multiple meshes parented together:MAX_VERTEX_ELEMENTS = 1000 #65535Did not get the same result, but the shadow is messed up. If I can use this test, then will not need to put .blend in repository, but thanks for offering. Will do a final check with your .blend jdnichollsc 1 Quote Link to comment Share on other sites More sharing options...
gryff Posted January 2, 2015 Share Posted January 2, 2015 I try to export with 1.4 version and it works well Great Juan! Just remember that JCP will likely have a solution very soon. Then, all the "extras" will be available. And of course think about characters with fewer polys Jeff, I ran across this a couple of days ago: To Add-on developers: Some changes were made to the Python API, make sure to check them out and update your Add-ons if necessary! That is comment about addons for Blender 2.73 - currently in "Release Candidate" status. No idea how it will impact the exporter. Release Notes 2.73 (Scroll down to addons.) You maybe want to keep an eye on it. cheers, gryff jdnichollsc 1 Quote Link to comment Share on other sites More sharing options...
jdnichollsc Posted January 2, 2015 Author Share Posted January 2, 2015 haha Gryff thank you very much for your help!! I will follow your recommendations and I'll be very slope because I'm doing an article Babylon.js in Spanish http://www.nicholls.co/blog/post/Iniciando-con-Babylonjs Regards Quote Link to comment Share on other sites More sharing options...
gryff Posted January 2, 2015 Share Posted January 2, 2015 Juan, I see "Enlaces Interestantes". You might want to add a link to this page Babylon.Js Examples. Let people see what can actually be done with BJS. cheers, gryff jdnichollsc 1 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 2, 2015 Share Posted January 2, 2015 The shadow casting of split meshes was a new bug. The original bug was that the code for generating instances got confused when the mesh was split. The javascript output does not support instances, so it not show the same problem. Both fixed, & in a pull request for .babylon output. Have not committed & pushed up a new version of TOB (.js / .ts format) to Extensions yet. EDIT: Gryff, I have not done anything with 2.73. I expect if there is an issue, someone will report it. Not looking at pre-production Blender. MHx 2, maybe, but not Blender. jdnichollsc 1 Quote Link to comment Share on other sites More sharing options...
gryff Posted January 4, 2015 Share Posted January 4, 2015 Juan, Jeff has updated the BJS github page and has posted a new version of the Blender exporter (v1.5.0). I tested it with Blender 2.72 and your little character. I still get the warning about splitting meshes - but it works fine. The little dude is there in all his glory. You may want to update your exporter. Nice turnaround Jeff cheers, gryff jdnichollsc 1 Quote Link to comment Share on other sites More sharing options...
jdnichollsc Posted January 13, 2015 Author Share Posted January 13, 2015 Wowww! Excellent excellent work! Thanks Jeff and Gryff for the help Regards, Nicholls Quote Link to comment Share on other sites More sharing options...
jdnichollsc Posted January 13, 2015 Author Share Posted January 13, 2015 Guys, one question... How can I create a addon to export Blender animation 2D to Phaser? I want to create a tween timeline such as http://greensock.com/timelinelite and to make sites like this http://flashvhtml.com/ Regards, Nicholls 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.