Pryme8 Posted March 30, 2016 Share Posted March 30, 2016 unfortunately I think its just in how babylon imports object files. I might have to look at the importer and hunt down whats happening for us. But honestly my only fix that I could find was separating all my submeshs into different obj files and that is not a valid method. I have a sneaking suspicion its a importer bug honestly because I have been able to reproduce it predictably and the work around i found leans tword that. I am not familiar with the importer script but I know right where I will go to start and that is going to be the loop over the submeshs, I bet there is a object extension or clone that is not happening correctly or an array is not getting cleared out before the next iteration of a loop hence why the indices and point counts are showing up weird in the output but seem to have a direct relation to their wrongness in numbers. Numa 1 Quote Link to comment Share on other sites More sharing options...
Numa Posted March 30, 2016 Author Share Posted March 30, 2016 That sounds right Pryme. Should I open a bug somewhere? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 30, 2016 Share Posted March 30, 2016 /** * This function set the data for each triangle. * Data are position, normals and uvs * If a tuple of (position, normal) is not set, add the data into the corresponding array * If the tuple already exist, add only their indice * * @param indicePositionFromObj Integer The index in positions array * @param indiceUvsFromObj Integer The index in uvs array * @param indiceNormalFromObj Integer The index in normals array * @param positionVectorFromOBJ Vector3 The value of position at index objIndice * @param textureVectorFromOBJ Vector3 The value of uvs * @param normalsVectorFromOBJ Vector3 The value of normals at index objNormale */ var setData = (indicePositionFromObj: number, indiceUvsFromObj: number, indiceNormalFromObj: number, positionVectorFromOBJ: BABYLON.Vector3, textureVectorFromOBJ: BABYLON.Vector2, normalsVectorFromOBJ: BABYLON.Vector3) => { I think this may very well indeed be needing of a bug post yes seeing how I have seen this error pop up for several users and no direct answer has ever really been found the goto is for people to tell one to update the bounding info, but it never works. Id see what one of the more advanced Guru's say though! I have have an inkling this is where we need to start looking, see how it says if the tuple exists, add its indice... if it already exists then it already has an indice right why would we be pushing another one? Quote Link to comment Share on other sites More sharing options...
Numa Posted March 30, 2016 Author Share Posted March 30, 2016 There is also a function called addPreviousObjMesh(), looks pretty suspicious hehe! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 30, 2016 Share Posted March 30, 2016 You can export a .babylon from blender: http://doc.babylonjs.com/exporters/Working_with_Blender Quote Link to comment Share on other sites More sharing options...
Numa Posted March 30, 2016 Author Share Posted March 30, 2016 @deltakosh thanks I'll keep that in mind. What about that bug though? It would be great if someone could have a look at that or hint at a quick fix. We're really keen on using Babylon if we could just get past the import stage. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 30, 2016 Share Posted March 30, 2016 I guess this is a bug with obj importer. Summoning @Temechon Numa and Pryme8 2 Quote Link to comment Share on other sites More sharing options...
Temechon Posted March 31, 2016 Share Posted March 31, 2016 It seems indeed like all meshes are concat... I'm on it. Quote Link to comment Share on other sites More sharing options...
Temechon Posted March 31, 2016 Share Posted March 31, 2016 Bug found and crushed : https://github.com/BabylonJS/Babylon.js/pull/1074 Numa and RaananW 2 Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 31, 2016 Share Posted March 31, 2016 Merged :-) Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 31, 2016 Share Posted March 31, 2016 8 hours ago, Temechon said: Bug found and crushed : https://github.com/BabylonJS/Babylon.js/pull/1074 Figured it had to be the arrays were being concatenated, thank you so much for this fix! this was a huge hitch in my development but thought I was just doing things wrong. It was not until people kept posting the same problem that it triggered duh bug... Temechon were you the original author on the OBJ importer? You might be the guy I need msg about an interesting idea. Quote Link to comment Share on other sites More sharing options...
Numa Posted March 31, 2016 Author Share Posted March 31, 2016 It works Thank you so much!!! Quote Link to comment Share on other sites More sharing options...
Temechon Posted March 31, 2016 Share Posted March 31, 2016 The OBJ importer has been made by someone in my team, who left... So I'm the official responsible of it GameMonetize and Pryme8 2 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 31, 2016 Share Posted March 31, 2016 how do we reverse this process? I want to export a obj created in BJS, with uv unwrap settings. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted March 31, 2016 Share Posted March 31, 2016 DARN! I was SO hoping he wanted to reverse the process, and take over full custodianship of the objLoader! Well, hrmph! Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 31, 2016 Share Posted March 31, 2016 umm, its a little over my head... Ive never studied the structure of 3d Objects... but if its needed, Ill start becoming competent and take a little pressure off teme. It looks like after his fix though, there will not be not much change needed. Maybe ill write us up a FBX importer then... Quote Link to comment Share on other sites More sharing options...
Temechon Posted April 1, 2016 Share Posted April 1, 2016 You have an OBJ serializer available here: https://github.com/BabylonJS/Babylon.js/tree/master/serializers/OBJ Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted April 1, 2016 Share Posted April 1, 2016 51 minutes ago, Temechon said: You have an OBJ serializer available here: https://github.com/BabylonJS/Babylon.js/tree/master/serializers/OBJ when exporting with this, if I have the objects material rendering edges will they show up in the MTL? and can i convert the MTL to a flat image and back? Quote Link to comment Share on other sites More sharing options...
Temechon Posted April 1, 2016 Share Posted April 1, 2016 I have absolutely no idea... 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.