satguru Posted January 31, 2016 Share Posted January 31, 2016 animation get corrupted when serialized. see http://ssatguru.appspot.com/babylonjs/animtest/test.html This is a simple scene playing the dude walk animation. clck save button to serialize the scene click load button to load the serialized scene back in. see what happens to the animation see the html source for the code Quote Link to comment Share on other sites More sharing options...
Davin Posted January 31, 2016 Share Posted January 31, 2016 Having exactly the same issue when exporting animations from blender -- i'll try some older versions of the export tool, perhaps its related. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 31, 2016 Share Posted January 31, 2016 you have to reset bones to pose before saving I think Quote Link to comment Share on other sites More sharing options...
satguru Posted January 31, 2016 Author Share Posted January 31, 2016 any easy way to reset bone ? Quote Link to comment Share on other sites More sharing options...
satguru Posted January 31, 2016 Author Share Posted January 31, 2016 ok I think i figured it out The following works for me for (Skeleton skel : scene.skeletons){ for (Bone bone : skel.bones){ bone.updateMatrix(bone.getBaseMatrix()); } } BaseMatrix seems to contain the Rest pose. So reset each bone in each skeleton to BaseMatrix Quote Link to comment Share on other sites More sharing options...
satguru Posted January 31, 2016 Author Share Posted January 31, 2016 sorry that was java Here's javascript for (var i = 0; i < scene.skeletons.length; i++) { var skel = scene.skeletons; { for (var j = 0; j < skel.bones.length; j++) { var bone = skel.bones[j]; { bone.updateMatrix(bone.getBaseMatrix()); } } } } GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
satguru Posted February 5, 2016 Author Share Posted February 5, 2016 This solution no longer works in 2.3 What changed ? Quote Link to comment Share on other sites More sharing options...
satguru Posted February 5, 2016 Author Share Posted February 5, 2016 Here is the 2.2 demo. Click save than load. http://ssatguru.appspot.com/babylonjs/animtest/testanim2.2.html Here is the 2.3 demo http://ssatguru.appspot.com/babylonjs/animtest/testanim2.3.html Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 5, 2016 Share Posted February 5, 2016 can you reproduce it in the playground? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 5, 2016 Share Posted February 5, 2016 We introduced this btw: https://github.com/BabylonJS/Babylon.js/blob/master/src/Bones/babylon.bone.ts#L52 it could be helpful Quote Link to comment Share on other sites More sharing options...
satguru Posted February 5, 2016 Author Share Posted February 5, 2016 I did see that . Good to see explicit support for rest pose. Unfortunately that did not help. I think we are loosing the baseMatrix here https://github.com/BabylonJS/Babylon.js/blob/master/src/Bones/babylon.bone.ts#L70 Little hard to reproduce this in playground, as we need to dispose of the scene, but I will try Regards Quote Link to comment Share on other sites More sharing options...
satguru Posted February 6, 2016 Author Share Posted February 6, 2016 I did some more testing. I found that if I change https://github.com/BabylonJS/Babylon.js/blob/master/src/Bones/babylon.bone.ts#L69 from public updateMatrix(matrix: Matrix): void { this._baseMatrix = matrix.clone(); this._skeleton._markAsDirty(); this._updateDifferenceMatrix(); } to public updateMatrix(matrix: Matrix): void { //this._baseMatrix = matrix.clone(); this._matrix = matrix.clone(); this._skeleton._markAsDirty(); this._updateDifferenceMatrix(); } then it works. The problem was that the local Matrix wasn't getting updated, Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 6, 2016 Share Posted February 6, 2016 and what about: public updateMatrix(matrix: Matrix): void { this._baseMatrix = matrix.clone(); this._matrix = matrix.clone(); this._skeleton._markAsDirty(); this._updateDifferenceMatrix(); } Because for me, updateMatrix should set a new base as well Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 6, 2016 Share Posted February 6, 2016 If this works, I'll update the code Quote Link to comment Share on other sites More sharing options...
satguru Posted February 6, 2016 Author Share Posted February 6, 2016 Yep, that works too. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 6, 2016 Share Posted February 6, 2016 Update on its way! Quote Link to comment Share on other sites More sharing options...
satguru Posted February 7, 2016 Author Share Posted February 7, 2016 Nice. I see the change in "src". How long before it ends up in "dist" and cdn ? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 8, 2016 Share Posted February 8, 2016 already in dist/preview release for CDN not before 2.4 will be out Quote Link to comment Share on other sites More sharing options...
satguru Posted February 9, 2016 Author Share Posted February 9, 2016 hmm.. Isn't that a long wait for a bug fix? Some might have concerns using a preview release as it could be unstable. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 9, 2016 Share Posted February 9, 2016 I do not update current release but as this is an open source framework you can fix it on your side We cannot have the same commitments as a paid project. There must be some drawbacks This one is easy to fix and I understand your point but sometimes it changes a lot of things and I do not want to go into a full cyle of testing/regression checks/npm update/nuget updates/yeoman updates/cdn updates Quote Link to comment Share on other sites More sharing options...
satguru Posted February 9, 2016 Author Share Posted February 9, 2016 Yep, makes sense. 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.