jdurrant Posted May 6, 2017 Share Posted May 6, 2017 I'm using the preview release of Babylon (3.0. alpha) and the 5.3.-1 exporter in Blender. The Blender scene includes shape keys attached to a mesh called "Cloth": When I export to a babylon file, this information appears to be saved correctly. There is a "MorphTargetManager" entry in the file JSON that looks like this: "MorphTargetManager": { "id": "Cloth", "targets": [ { "name": "Draped", "position": [lots of numbers...], "influence": 0 }, { "name": "testtest", "position": [lots of numbers...], "influence": 0 } ] } I then load the babylon file with BABYLON in the browser, but I can't for the life of me figure out how to access this saved MorphTargetManager. Here are some things I tried: BABYLON.scene.morphTargetManagers; ==> [] BABYLON.scene.getMorphTargetManagerById("Cloth"); ==> null BABYLON.scene.getMorphTargetManagerById(0); ==> null (After setting the "Cloth" mesh to clothMesh...) clothMesh.morphTargetManager; ==> undefined (but present when I inspect the mesh object...) I feel like all the parts are there, I just can't figure out how to access the MorphTargetManager that I think should be present when I import the babylon file. Any help you can offer would be appreciated! Thanks! JackFalcon 1 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted May 8, 2017 Share Posted May 8, 2017 Do not really know how to access them, but would suggest calling through mesh. This is implemented wrong. I am placing this inside of a meshes tags. A morphTargetmanager is a high level thing within the JSON file, and then leashed up to a mesh. This is very different from my implementation of shapekeys. The export design will need to change. Thanks for testing. JackFalcon 1 Quote Link to comment Share on other sites More sharing options...
jdurrant Posted May 8, 2017 Author Share Posted May 8, 2017 Thanks for your help, JCPalmer. Just to clarify, you mean I should save the different shape keys as separate meshes (in blender) and then programmatically create a morphTargetManager? Can you provide a code outline? Also, would you mind pointing me in the direction of your implementation of shapekeys? It seems the one I'm using now isn't ready for prime time. Thanks. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted May 8, 2017 Share Posted May 8, 2017 No, you should not need to anything differently to the blend. I was speaking of the JSON organization. My implementation though farther along in the morph area is an completely different animation system, wiith its own workflow & dynamic deployment using computer generated Javascript. It is undergoing a bunch of changes that I am just finalizing to allow geometry & texture read ahead. I am think to be done around June 1st. Will be beginning network testing of a scene this week. Will post on demos section as completed. Will not get to changing anything for the JSON implementation till this milestone is achieved, (plus I do not know what to do yet). gryff 1 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted May 16, 2017 Share Posted May 16, 2017 Ok, @jdurrantwith my scene posted on demos, I changed the .JSON exporter to deal with morph targets properly. I ran the flying carpet test scene through the sandbox. I know morph targets is now getting parsed, since I had a spelling of a property wrong, and it failed at first. I PR'ed but with Deltakosh on vacation, you could just pull the zip file from my repo. Quote Link to comment Share on other sites More sharing options...
voggu kalyan Posted June 27, 2017 Share Posted June 27, 2017 Quote a small doubt how to get morph targets from shape keys. i had made a blender human model and i used shape keys for it .when i exported i didn't get the vertices , but i got the array. can you help me. human.blend 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.