Zino54220 Posted July 24, 2014 Share Posted July 24, 2014 Hi Gentlement! I have a big problem since I updated Babylon.js v1.9 to v1.12... When I Imported a mesh now, I get this in debuger : I replace all files of the old exporter by the exporter v0.99 in Blender "script" -> "addons" file and remade the mesh export but nothing... What's the ..... !!! Should I make a special handling with Blender ??? Help please!!! Zino Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 24, 2014 Share Posted July 24, 2014 The signature of setVerticesData has changed Bad < 1.11xxx.setVerticesData(positions, BABYLON.VertexBuffer.PositionKind, true);xxx.setVerticesData(normals, BABYLON.VertexBuffer.NormalKind, true); OK 1.11 and +xxx.setVerticesData(BABYLON.VertexBuffer.PositionKind, positions, true);xxx.setVerticesData(BABYLON.VertexBuffer.NormalKind, normals, true); Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted July 24, 2014 Share Posted July 24, 2014 Actually, it is really 1.12 where it changed, just like the warning says. Also, that is just a warning, 1.12 & 1.13 switch the order internally, if found the old way. Just to also clear up, that v 0.99 refers to the version of Tower of Babel. There are 2 Blender exporters in Git right now. You would have also had to gone into Blender preferences, and turned it on to use TOB. The thing is I am not sure you have a final 1.12 version, because a .babylon DOES not even understand what parameter order is. That is babylonFileLoader.js problem. I am pretty sure the order was switched in that module, before 1.12 went final. Quote Link to comment Share on other sites More sharing options...
Zino54220 Posted July 25, 2014 Author Share Posted July 25, 2014 Thanks for your answers... So I had the exporter Tower of Babel in Blender and when I exporte my mesh I have many files (.babylon, .js, .log, .ts and .png). But always the same result in my scene with the same messages in debug... It's always the file .babylon to put in the BABYLON.SceneLoader.ImportMesh(...) function ?? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted July 25, 2014 Share Posted July 25, 2014 Yes, the .babylon is always used for Sceneloader. The .js & .ts are for inline code, which does not need the loader. Both require 1.13. You only need 1, but all 3 are generated. If you looked at the babylon.js you are using do you see this in line 1?/*! Babylon 2014-06-24 */If not, you need to get the final 1.12. I suspect you do, because I just double checked the git history for babylon.babylonFileLoader.js which is called by SceneLoader. There is a commit on 06-24, and the arguments are specified (kind, data, updateable). Those warnings should not happen. This still may not fix, but getting a known build to be final is pretty important. Quote Link to comment Share on other sites More sharing options...
Zino54220 Posted July 25, 2014 Author Share Posted July 25, 2014 Yes I have the ligne /*! Babylon 2014-06-24 */ in my babylon.1.12.js file... I use the babylon.1.13-beta but same result... I don't understand what can I do .... Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 25, 2014 Share Posted July 25, 2014 Have change you the signature of setVerticesData in your code. This is the error I see in your console. Quote Link to comment Share on other sites More sharing options...
Zino54220 Posted July 25, 2014 Author Share Posted July 25, 2014 Yes I Have. Thanks to you, I don't have BJS signature warning anymore... But I always haven't my mesh and the [WebGLRenderinContext]GL_ERROR... is still here whereas it wasn't before with the precent version... I'm very sad Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 25, 2014 Share Posted July 25, 2014 Also try clearing your cache and test. It happens that solve problems. otherwise post your scene with a link. Quote Link to comment Share on other sites More sharing options...
Zino54220 Posted July 26, 2014 Author Share Posted July 26, 2014 So I have news.... The problem is not the SceneLoader.ImporteMesh(...) but a function which link the mesh with a skeleton that I get in this forum... Here this function :// Monte un objet 3d (mesh) sur un squelette (skeleton)function monterObjSurSkel(obj,ske,boneName){ var matricesWeights = new Array(); var floatIndices = new Array(); var boneIndice = -1; for (var i = 0; i < ske.bones.length; i++) { if (ske.bones[i].name == boneName) { boneIndice=i; break; } } if (boneIndice == -1) {return;} for (var ii = 0; ii < obj._totalVertices; ii++) { matricesWeights[ii*4+0] = 1.0; matricesWeights[ii*4+1] = 0.0; matricesWeights[ii*4+2] = 0.0; matricesWeights[ii*4+3] = 0.0; floatIndices[ii*4+0] = boneIndice; floatIndices[ii*4+1] = boneIndice; floatIndices[ii*4+2] = boneIndice; floatIndices[ii*4+3] = boneIndice; } obj.skeleton = ske; obj.setVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind, matricesWeights, false); obj.setVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind, floatIndices, false);}Thanks to Dad72, I corrected the setVerticesData warnings... Before the 1.12 version, the two last code's lines were :obj.setVerticesData(matricesWeights, BABYLON.VertexBuffer.MatricesWeightsKind, false);obj.setVerticesData(floatIndices, BABYLON.VertexBuffer.MatricesIndicesKind, false);I don't see where is the problem in this function.... Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 26, 2014 Share Posted July 26, 2014 I use this same function with the same code and I have no problem. I think that the problem is that assign you in the signature of function (obj, ske, boneName) Display also your code SceneLoader.ImportMesh(...) Quote Link to comment Share on other sites More sharing options...
Zino54220 Posted July 26, 2014 Author Share Posted July 26, 2014 Here my code of mesh's import :var nomBlenderPiece = tabParamsPiece[i].NomBlender; var chemVersFichierPiece = tabParamsPiece[i].ChemVersFichier; var nomFichierPiece = tabParamsPiece[i].NomFichier; var piece; var nomOs = tabParamsPiece[i].NomOs; var pos = tabMeshImportes.indexOf(nomBlenderPiece); if(pos == -1) { var skelAtelier = scene.getMeshByID(nameLastSkelAtelier); if(skelAtelier != null) { // Import the mesh BABYLON.SceneLoader.ImportMesh(nomBlenderPiece, "../../" + chemVersFichierPiece, nomFichierPiece, scene, function (newMeshes) { piece = setupMeshWithPosFix(piece,newMeshes,posXSkel, posYSkel+3.5, posZSkel-2.0); piece.name = nomBlenderPiece; monterObjSurSkel(newMeshes[0], skelAtelier.skeleton, nomOs); }); tabMeshImportes.push(nomBlenderPiece); } }This code was good before... Thanks you very much Dad72 for your help Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 26, 2014 Share Posted July 26, 2014 This should better work BABYLON.SceneLoader.ImportMesh(nomBlenderPiece, "../../" + chemVersFichierPiece, nomFichierPiece, scene, function (newMeshes, particleSystems, skeletons) { piece = setupMeshWithPosFix(piece,newMeshes,posXSkel, posYSkel+3.5, posZSkel-2.0);piece.name = nomBlenderPiece;monterObjSurSkel(newMeshes[0], skeletons[0], nomOs); }); Quote Link to comment Share on other sites More sharing options...
Zino54220 Posted July 26, 2014 Author Share Posted July 26, 2014 Yes it's work but my mesh is not link to the skeleton and it's normal because I want that the mesh be link to skelAtelier and the mesh hasn't a skeleton so is useless to put "skeleton" in parameter no ?? Why when I use skelAtelier.skeleton that's doesn't work ?? In debug, the parameter "skeleton" of skelAtelier looks correct.... PS : Is not skeleton[0] in your example Dad72 ??? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 26, 2014 Share Posted July 26, 2014 yes skeleton[0] (désoler j'ai oublier le 0: j'ai corriger le post) andmonterObjSurSkel(skelAtelier, skeleton[0], nomOs);Vous voulez attacher "skelAtelier" sur le squelette "skeleton[0]" ayant le nom de l'os "nomOs". It'll work like this Quote Link to comment Share on other sites More sharing options...
Zino54220 Posted July 26, 2014 Author Share Posted July 26, 2014 Yes, with this code my mesh appears but it 's not link to the good skeleton... SkelAtelier is a mesh with a skeleton and I want link the newMesh with the skeleton of skelAtelier. This code worked with the Babylon.1.9... Quote Link to comment Share on other sites More sharing options...
Zino54220 Posted July 26, 2014 Author Share Posted July 26, 2014 I have an idea... I will try to remade the export of the skeleton with the version 1.12 of the Babylon exporter because it was done with the 1.9 version. Quote Link to comment Share on other sites More sharing options...
Zino54220 Posted July 26, 2014 Author Share Posted July 26, 2014 I remade the skeleton export with the version 1.12 but nothing else... However, I see this in debug : My mesh hasn't the property "_totalVertices" so it doesn't pass in for loop... That's normal ?? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 26, 2014 Share Posted July 26, 2014 Indeed, there is of the above changes, because at mee this works does more evenly.This has be replace by something else. yes : getTotalVertices() for 1.12 remplace obj._totalVertices par obj.getTotalVertices() Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted July 26, 2014 Share Posted July 26, 2014 In babylon.mesh.ts I see: public getTotalVertices(): number { if (!this._geometry) { return 0; } return this._geometry.getTotalVertices(); }If _totalVertices existed before, it does not now Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 26, 2014 Share Posted July 26, 2014 But this does not resolve the problem.... Quote Link to comment Share on other sites More sharing options...
Zino54220 Posted July 26, 2014 Author Share Posted July 26, 2014 Yeah !! Well done Dad72! this function is good for me :// Monte un objet "obj", sur un squelette "ske" selon l'os "bone"function monterObjSurSkel(obj,ske,boneName){ var matricesWeights = new Array(); var floatIndices = new Array(); var boneIndice = -1; for (var i = 0; i < ske.bones.length; i++) { if (ske.bones[i].name == boneName) { boneIndice=i; break; } } if (boneIndice == -1) {return;} for (var ii = 0; ii < obj.getTotalVertices(); ii++) { matricesWeights[ii*4+0] = 1.0; matricesWeights[ii*4+1] = 0.0; matricesWeights[ii*4+2] = 0.0; matricesWeights[ii*4+3] = 0.0; floatIndices[ii*4+0] = boneIndice; floatIndices[ii*4+1] = boneIndice; floatIndices[ii*4+2] = boneIndice; floatIndices[ii*4+3] = boneIndice; } obj.skeleton = ske; obj.setVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind, matricesWeights, false); obj.setVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind, floatIndices, false);} Quote Link to comment Share on other sites More sharing options...
Zino54220 Posted July 27, 2014 Author Share Posted July 27, 2014 Thanks you very much Dad72 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 27, 2014 Share Posted July 27, 2014 You are welcome 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.