Zino54220 Posted March 3, 2018 Share Posted March 3, 2018 Hi everyone, I need your help a new time... I updated my BabylonJs version from 2.2 to 3.1.1 and I have a problem with an import skeleton : here the code (from the doc) calls which is very simple : function importSquelette(nomSkelAtelier, chemVersFichierSkelAtelier, nomFichierSkelAtelier, laScene) { BABYLON.SceneLoader.ImportMesh(nomSkelAtelier, chemVersFichierSkelAtelier, nomFichierSkelAtelier, laScene, function (newMeshesSkel, particleSystems, skeletons) { var dude = newMeshesSkel[0]; //dude.rotation.y = Math.PI; dude.position = new BABYLON.Vector3(0, 0, 10); } ); } parameters values : - nomSkelAtelier = 'Armature_Striker_AZ_9' - chemVersFichierSkelAtelier = '../Scripts/Bll_IFC/Mesh/MeshSkelette/' - nomFichierSkelAtelier = 'Striker_AZ_9.babylon' - lascene = the scene loaded before I specify that : - the scene.babylon file and the skeleton.babylon file aren't in the same folder. - the exporter for Blender was the version 5.5 - the version of Blender is 2.79 And here the consol log when i click to the button which call the import skeleton function: How can I fix it ? I try to finish a game fight robot and import skeleton is the main part of the game .... Thanks ! Quote Link to comment Share on other sites More sharing options...
Zino54220 Posted March 5, 2018 Author Share Posted March 5, 2018 So a little point of my research... I tried different version of Babylon JS and : - the version 3.1.0 does the same thing. - the version 3.0.7 (with exporter 5.4.0) gives no error in consol but doesn't do the job, always give an empty array in call back function : I tried to set up the name of my skeleton mesh but no more effects... Here all the parameters of my skeleton from Blender 2.79 : - the version 2.5.0 give no error but make not the job, always a empty array in call back function like for the version 3.0.7. There is a problem with exporter ? or this version of Blender ?? ... Unfortunately, if I can't import my skeleton mesh, I can't finish my game fight ... I will try to get the old version of exporter compatible with Babylon Js 2.2.0 and retry again to retrieve a function available. Quote Link to comment Share on other sites More sharing options...
Guest Posted March 5, 2018 Share Posted March 5, 2018 Pinging @JCPalmer or @V!nc3r Quote Link to comment Share on other sites More sharing options...
Zino54220 Posted March 5, 2018 Author Share Posted March 5, 2018 Thank you very much (again...) Deltakosh Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 5, 2018 Share Posted March 5, 2018 First, Blender exporter version is currently 5.6. There is the last version of the single source file in the repo, if you are stuck at old versions of Blender. 2nd, turn on your JSON logging detail to see what is being done by adding this line before your import. Do not know what version of BJS this was added: BABYLON.SceneLoader.loggingLevel = BABYLON.SceneLoader.DETAILED_LOGGING; Referencing a mesh by index is pretty weak code. Better to use scene.getMeshByName('BlenderName'). The exporter, Blender, or importer could all change to give a different order. ImportMesh args are not readable for me, so you could only be asking for a single mesh, but even then children meshes are also loaded. Quote Link to comment Share on other sites More sharing options...
Zino54220 Posted March 6, 2018 Author Share Posted March 6, 2018 Hi "@JCPalmer", So ... 1° I set up the exporter Blender with the version 5.6.0 and remade the export of my skeleton. 2° I set the babylon file with the version 3.1.1 and (after ...) 3.0.7 of babylon.js 3° I added the line and load BabylonJS: BABYLON.SceneLoader.loggingLevel = BABYLON.SceneLoader.DETAILED_LOGGING; 4° I modify the import skeleton function with your advices like this : function importSquelette(nomSkelAtelier, chemVersFichierSkelAtelier, nomFichierSkelAtelier, laScene) { BABYLON.SceneLoader.loggingLevel = BABYLON.SceneLoader.DETAILED_LOGGING; BABYLON.SceneLoader.ImportMesh(nomSkelAtelier, chemVersFichierSkelAtelier, nomFichierSkelAtelier, laScene, function (newMeshesSkel, particleSystems, skeletons) { //var dude = newMeshesSkel[0]; var skeleton = laScene.getMeshByName('Striker_AZ_9'); //dude.rotation.y = Math.PI; //dude.position = new BABYLON.Vector3(0, 0, 10); skeleton.position = new BABYLON.Vector3(0, 0, 10); } ); } 5° I got the same things with this result in consol : For BabylonJS 3.1.1 For BabylonJS 3.0.7 There is a specific option to enable in Blender before export or maybe I must made a animation for the skeleton or anything like this before made export ? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 6, 2018 Share Posted March 6, 2018 Given that different versions of BJS produce different results, my first thought is this is not directly an export problem. Having a more robust check shows that the mesh you were expecting is just not there. Due to the number of time zone apart, here are a number of things to try: 1- Include the .log file from the export. I guess load logging does not work with importMesh. It works with scene.Append. 2- Probably want include the .babylon, if possible. Quote Link to comment Share on other sites More sharing options...
Zino54220 Posted March 6, 2018 Author Share Posted March 6, 2018 Here the content of log file (I just modify the path texture directory with '...' instead my name). Exporter version: 5.6.0, Blender version: 2.79 (sub 0) ========= Conversion from Blender to Babylon.js ========= Scene settings used: selected layers only: false inline textures: false Positions Precision : 4 Normals Precision : 3 UVs Precision : 3 Vert Color Precision: 3 Mat Weight Precision: 2 texture directory: C:\Users\...\Documents\Blender\IFC\Squelette\Skeleton Striker AZ 9\Squelette_BabylonJS\ Python World class constructor completed WARNING: No active camera has been assigned, or is not in a currently selected Blender layer processing begun of skeleton: Striker_AZ_9, id: 0 processing begun of bone: torse3, index: 0 processing begun of bone: torse2, index: 1 processing begun of bone: torse1, index: 2 processing begun of bone: head, index: 3 processing begun of bone: epaule.L, index: 4 processing begun of bone: brasHaut.L, index: 5 processing begun of bone: brasBas.L, index: 6 processing begun of bone: mains.L, index: 7 processing begun of bone: mains_index1.L, index: 8 processing begun of bone: mains_index2.L, index: 9 processing begun of bone: mains_index3.L, index: 10 processing begun of bone: mains_majeure1.L, index: 11 processing begun of bone: mains_majeure2.L, index: 12 processing begun of bone: mains_majeure3.L, index: 13 processing begun of bone: mains_annulaire1.L, index: 14 processing begun of bone: mains_annulaire2.L, index: 15 processing begun of bone: mains_annulaire3.L, index: 16 processing begun of bone: mains_oriculaire1.L, index: 17 processing begun of bone: mains_oriculaire2.L, index: 18 processing begun of bone: mains_oriculaire3.L, index: 19 processing begun of bone: mains_pouce1.L, index: 20 processing begun of bone: mains_pouce2.L, index: 21 processing begun of bone: epaule.R, index: 22 processing begun of bone: brasHaut.R, index: 23 processing begun of bone: brasBas.R, index: 24 processing begun of bone: mains.R, index: 25 processing begun of bone: mains_index1.R, index: 26 processing begun of bone: mains_index2.R, index: 27 processing begun of bone: mains_index3.R, index: 28 processing begun of bone: mains_majeure1.R, index: 29 processing begun of bone: mains_majeure2.R, index: 30 processing begun of bone: mains_majeure3.R, index: 31 processing begun of bone: mains_annulaire1.R, index: 32 processing begun of bone: mains_annulaire2.R, index: 33 processing begun of bone: mains_annulaire3.R, index: 34 processing begun of bone: mains_oriculaire1.R, index: 35 processing begun of bone: mains_oriculaire2.R, index: 36 processing begun of bone: mains_oriculaire3.R, index: 37 processing begun of bone: mains_pouce1.R, index: 38 processing begun of bone: mains_pouce2.R, index: 39 processing begun of bone: cuisse.L, index: 40 processing begun of bone: tibia.L, index: 41 processing begun of bone: pied.L, index: 42 processing begun of bone: cuisse.R, index: 43 processing begun of bone: tibia.R, index: 44 processing begun of bone: pied.R, index: 45 processing begun of mesh: Striker_AZ_9_Main.L processing begun of Standard material: RobocopBlack Diffuse texture found "Kd" Image texture found, type: diffuseTexture, mapped using: "UVMap" processing begun of Standard material: CircuitIntegre Diffuse texture found "Texture.002" Image texture found, type: diffuseTexture, mapped using: "UVMap" processing begun of multimaterial: Striker_AZ_9.Multimaterial#0 num positions : 236 num normals : 236 num uvs : 472 num uvs2 : 0 num colors : 0 num indices : 558 Skeleton stats: Total Influencers: 578 Avg # of influencers per vertex: 2.4492 Highest # of influencers observed: 6, num vertices with this: 6 exported as 6 influencers num skeletonWeights and skeletonIndices: 1888 processing begun of mesh: Striker_AZ_9_AvantBras.L registered as also a user of material: RobocopBlack num positions : 164 num normals : 164 num uvs : 328 num uvs2 : 0 num colors : 0 num indices : 498 Skeleton stats: Total Influencers: 275 Avg # of influencers per vertex: 1.6768 Highest # of influencers observed: 2, num vertices with this: 111 exported as 2 influencers num skeletonWeights and skeletonIndices: 656 processing begun of mesh: Striker_AZ_9_BrasHaut.L registered as also a user of material: RobocopBlack registered as also a user of material: CircuitIntegre processing begun of multimaterial: Striker_AZ_9.Multimaterial#1 num positions : 273 num normals : 273 num uvs : 546 num uvs2 : 0 num colors : 0 num indices : 933 Skeleton stats: Total Influencers: 409 Avg # of influencers per vertex: 1.4982 Highest # of influencers observed: 2, num vertices with this: 136 exported as 2 influencers num skeletonWeights and skeletonIndices: 1092 processing begun of mesh: Striker_AZ_9_Cuisse.L registered as also a user of material: RobocopBlack registered as also a user of material: CircuitIntegre processing begun of multimaterial: Striker_AZ_9.Multimaterial#2 num positions : 148 num normals : 148 num uvs : 296 num uvs2 : 0 num colors : 0 num indices : 474 Skeleton stats: Total Influencers: 235 Avg # of influencers per vertex: 1.5878 Highest # of influencers observed: 2, num vertices with this: 87 exported as 2 influencers num skeletonWeights and skeletonIndices: 592 processing begun of mesh: Striker_AZ_9_Tibia.L registered as also a user of material: RobocopBlack registered as also a user of material: CircuitIntegre processing begun of multimaterial: Striker_AZ_9.Multimaterial#3 num positions : 109 num normals : 109 num uvs : 218 num uvs2 : 0 num colors : 0 num indices : 342 Skeleton stats: Total Influencers: 152 Avg # of influencers per vertex: 1.3945 Highest # of influencers observed: 2, num vertices with this: 43 exported as 2 influencers num skeletonWeights and skeletonIndices: 436 processing begun of mesh: Striker_AZ_9_Pied.L registered as also a user of material: RobocopBlack registered as also a user of material: CircuitIntegre processing begun of multimaterial: Striker_AZ_9.Multimaterial#4 num positions : 111 num normals : 111 num uvs : 222 num uvs2 : 0 num colors : 0 num indices : 294 Skeleton stats: Total Influencers: 158 Avg # of influencers per vertex: 1.4234 Highest # of influencers observed: 2, num vertices with this: 47 exported as 2 influencers num skeletonWeights and skeletonIndices: 444 processing begun of mesh: Striker_AZ_9_Cuisse.R registered as also a user of material: RobocopBlack registered as also a user of material: CircuitIntegre processing begun of multimaterial: Striker_AZ_9.Multimaterial#5 num positions : 148 num normals : 148 num uvs : 296 num uvs2 : 0 num colors : 0 num indices : 474 Skeleton stats: Total Influencers: 242 Avg # of influencers per vertex: 1.6351 Highest # of influencers observed: 2, num vertices with this: 94 exported as 2 influencers num skeletonWeights and skeletonIndices: 592 processing begun of mesh: Striker_AZ_9_Tibia.R registered as also a user of material: RobocopBlack registered as also a user of material: CircuitIntegre processing begun of multimaterial: Striker_AZ_9.Multimaterial#6 num positions : 109 num normals : 109 num uvs : 218 num uvs2 : 0 num colors : 0 num indices : 342 Skeleton stats: Total Influencers: 157 Avg # of influencers per vertex: 1.4404 Highest # of influencers observed: 2, num vertices with this: 48 exported as 2 influencers num skeletonWeights and skeletonIndices: 436 processing begun of mesh: Striker_AZ_9_Pied.D registered as also a user of material: RobocopBlack registered as also a user of material: CircuitIntegre processing begun of multimaterial: Striker_AZ_9.Multimaterial#7 num positions : 111 num normals : 111 num uvs : 222 num uvs2 : 0 num colors : 0 num indices : 294 Skeleton stats: Total Influencers: 154 Avg # of influencers per vertex: 1.3874 Highest # of influencers observed: 2, num vertices with this: 43 exported as 2 influencers num skeletonWeights and skeletonIndices: 444 processing begun of mesh: Striker_AZ_9_BrasHaut.R registered as also a user of material: RobocopBlack registered as also a user of material: CircuitIntegre processing begun of multimaterial: Striker_AZ_9.Multimaterial#8 num positions : 273 num normals : 273 num uvs : 546 num uvs2 : 0 num colors : 0 num indices : 933 Skeleton stats: Total Influencers: 409 Avg # of influencers per vertex: 1.4982 Highest # of influencers observed: 2, num vertices with this: 136 exported as 2 influencers num skeletonWeights and skeletonIndices: 1092 processing begun of mesh: Striker_AZ_9_AvantBras.R registered as also a user of material: RobocopBlack num positions : 164 num normals : 164 num uvs : 328 num uvs2 : 0 num colors : 0 num indices : 498 Skeleton stats: Total Influencers: 275 Avg # of influencers per vertex: 1.6768 Highest # of influencers observed: 2, num vertices with this: 111 exported as 2 influencers num skeletonWeights and skeletonIndices: 656 processing begun of mesh: Striker_AZ_9_Torse registered as also a user of material: RobocopBlack registered as also a user of material: CircuitIntegre processing begun of Standard material: BlackRobotSup processing begun of Standard material: RepareBoulette Diffuse texture found "Kd" Image texture found, type: diffuseTexture, mapped using: "UVMap" processing begun of multimaterial: Striker_AZ_9.Multimaterial#9 num positions : 904 num normals : 904 num uvs : 1808 num uvs2 : 0 num colors : 0 num indices : 2634 Skeleton stats: Total Influencers: 2846 Avg # of influencers per vertex: 3.1482 Highest # of influencers observed: 6, num vertices with this: 1 exported as 6 influencers num skeletonWeights and skeletonIndices: 7232 processing begun of mesh: Striker_AZ_9_Tete registered as also a user of material: RobocopBlack processing begun of Standard material: MaterialMasque processing begun of multimaterial: Striker_AZ_9.Multimaterial#10 num positions : 430 num normals : 430 num uvs : 860 num uvs2 : 0 num colors : 0 num indices : 1572 Skeleton stats: Total Influencers: 458 Avg # of influencers per vertex: 1.0651 Highest # of influencers observed: 4, num vertices with this: 1 exported as 4 influencers num skeletonWeights and skeletonIndices: 1720 processing begun of mesh: Striker_AZ_9_Main.R registered as also a user of material: RobocopBlack registered as also a user of material: CircuitIntegre processing begun of multimaterial: Striker_AZ_9.Multimaterial#11 num positions : 236 num normals : 236 num uvs : 472 num uvs2 : 0 num colors : 0 num indices : 558 Skeleton stats: Total Influencers: 578 Avg # of influencers per vertex: 2.4492 Highest # of influencers observed: 6, num vertices with this: 6 exported as 6 influencers num skeletonWeights and skeletonIndices: 1888 ========= Writing of scene file started ========= ========= Writing of scene file completed ========= ========= end of processing ========= elapsed time: 0 min, 1.7835 secs For the .babylon file, can I share you with private message ? If you want too, i can share your the .blend file of the skeleton. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 6, 2018 Share Posted March 6, 2018 Not necessary for .babylon or .blend just yet, based on your log file. First you do not have a mesh named 'Striker_AZ_9', so the getMeshByName should never work. That is a skeleton, and a skeleton does not have a position anyway. Which mesh do you wish to change the position of? Hopefully, a parent of all the others. I have not really convinced that this is a bug. processing begun of skeleton: Striker_AZ_9, id: 0 Quote Link to comment Share on other sites More sharing options...
Zino54220 Posted March 6, 2018 Author Share Posted March 6, 2018 A little more explication ... I have a biped mesh cuted in several parts. Like this : 14 meshes in all. After that, I made my skeleton. Like that : 46 bones in all. Here the name of the object in Blender : After, I had reset the center of each meshes with (with CTRL + A -> Location, and CTRL + A -> Rotation & Scale in Blender) and attached all the meshes to the skeleton with CTRL - P ->Armatur deform -> Automatic Weight. Here, we can see the hierarchy of all objects and the correct parenting after the operation : All is good after that in pose mode in Blender. After export, in my web MVC project, I imported the skeleton in the scene with the function describes in the doc. Then, in the rollback function, when I got my skeleton by index, I imported each mesh to attached them to my skeleton But now, the rollback function always give me an empty array, If I hadn't my skeleton , I can't attached each mesh to it. I started this little project few years ago and in the older version of babylon (like 2.2 with the Blender 2.73 or 2.75 ...) , this system worked. The method has been changed ? Quote Link to comment Share on other sites More sharing options...
Zino54220 Posted March 9, 2018 Author Share Posted March 9, 2018 Hi everyone, JCPalmer had right, I made a mistake : In my first project, I had a skeleton composed by one mesh and fourteen parts of meshes armor, so when I imported the name of skeleton (wich was like the name of object in Blender), it worked. For my actual case, I simply imported one of the fourteen mesh of my skeleton to get it and after, in the rollback function, imported others meshs. Thanks everybody. GameMonetize 1 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.