Dad72 Posted March 3, 2016 Author Share Posted March 3, 2016 Ok, because previously you said that it was necessary to export the mesh with bones on one side and the bones and the animation of the other. I use the word bug, because it does not function as you said. Ok, I'll do like this. eboo 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 3, 2016 Share Posted March 3, 2016 I must admit I was not super clear Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 3, 2016 Author Share Posted March 3, 2016 I understand DK, I think if you are overloading the work, you must be a tired. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 4, 2016 Author Share Posted March 4, 2016 I create a PG. But it does not work. and it looks like we can not use SceneLoader.Append in the playground, the scene becomes blue http://www.babylonjs-playground.com/#GA8XI#6 On the playground, you can see the animation of walking is not replaced and this is what I want to do. Quote Link to comment Share on other sites More sharing options...
gryff Posted March 4, 2016 Share Posted March 4, 2016 @Dad72 : I looked at your .babylon files to find something like this - a definition of the "ranges" : Quote "ranges":[{"name":"base06_02x30","from":1,"to":179}] That code snippet is from a blender export, using BE4.4.1, of a file containing a single animation. I could not find any "ranges" in your files. So is the code line : skeletonsPerso[0].copyAnimationRange(BipWalk, "walk", true);// add walk just failing quietly? Also, I am getting four of these lines in my console" Quote Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://www.babylon.actifgames.com/anim/walk.babylon.manifest?1457100183077. (Reason: CORS header 'Access-Control-Allow-Origin' missing). Not sure if any of that helps cheers, gryff Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 4, 2016 Author Share Posted March 4, 2016 Ok, so it will not work with the export from 3ds max? So another try. same, no success. http://www.babylonjs-playground.com/#GA8XI#8 For errors of Cross-Origin is to manifest files that I do not use. So no problem. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 4, 2016 Share Posted March 4, 2016 Just create your own range on the skeleton, not bones. Call it "everything", and give it a from of 1 and a to of whatever the last frame is. Copy the "everything" animation range using the skeleton version of copyAnimationRange, not a the [0] bone. Bone has a copyAnimationRange() method, but it is not meant to be called in user code. Sorry, do not have time to edit your playground . For future searching, better to explain here anyway. whenReady{ var srcSkeleton = scene.getS... var destSkeleton = scene.getS... srcSkeleton.createAnimationRange("everything", 1, 666); destSkeleton.copyAnimationRange(srcSkeleton, "everything"); destSkeleton.beginAnimation("everything"); } Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 4, 2016 Author Share Posted March 4, 2016 Ah ok, I begin to understand the operation. It is a complex can I find, but it works. Thank you JCPalmer By cons I would like to understand why my character is deformed? what could happen this? http://www.babylonjs-playground.com/#GA8XI#9 So we can see that 2 animation are playing at the same time (idle and walk) Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 4, 2016 Author Share Posted March 4, 2016 I'm looking, but I really do not understand why the character is deformed. No copy of the animation, it is not deformed. Someone has an idea why? it's very strange. just the top of the corp is deformed? http://www.babylonjs-playground.com/#GA8XI#10 Quote Link to comment Share on other sites More sharing options...
gryff Posted March 4, 2016 Share Posted March 4, 2016 @dad72 - take a look in your file "walk.babylon" and search for "Bip01 Spine1". You will see that there are two property animations for that bone - position and scaling Here is the scaling data: {"name":"scaling animation","property":"scaling","dataType":1,"loopBehavior":1,"framePerSecond":30, "keys":[{"frame":0,"values":[1.1025,0.9798,1.1493]},{"frame":13,"values":[1.075,1.0057,1.1484]},{"frame":14,"values":[1.1486,1.0074,1.073]},{"frame":17,"values":[1.1494,1.01,1.0694]},{"frame":26,"values":[1.1478,1.0072,1.0739]},{"frame":27,"values":[1.0764,1.0053,1.1474]},{"frame":40,"values":[1.1025,0.9798,1.1493]}] No other other bone I looked at had animation for this property. A number of the other bones also have a scaling animation - but I'm not sure how significant the animation values are. The "Bip01 Neck" does not have a scaling animation. Hope that helps. cheers, gryff Dad72 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 5, 2016 Author Share Posted March 5, 2016 It's strange. Yet the walking animation is not brought to scale in 3ds max. I'll look at this more ready. Gryff thank you for research. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 5, 2016 Author Share Posted March 5, 2016 Ok, I understood why. for the character I was using a heightpoly model with 57 bones and for animated, I used a lowpoly model with 34 bones that had a different number of bones. This explains the previous problem. Here it works correctly: http://www.babylonjs-playground.com/#GA8XI#12 Thank you for your help everyone. webGLmmk and GameMonetize 2 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 5, 2016 Share Posted March 5, 2016 Good. While my test scene worked under 2.4-alpha. I managed to break it when I got rid of all animation in the meshes skeleton. Got the "spaghetti monster". Have managed to fix that. Am coming out with a PR hopefully by Monday with fixes, and with logging in SceneLoader. It will be turned on by default. It will show summary stats like # of bones, so anyone looking at the logs could see that mis-match. Also thinking about more messages in copyAnimationRange to alert to issue. Have also added a producer tag for the .babylon file, which will always be on the console. Playgrounds are fine, but logs are pretty important if BJS is to be taken serious. You cannot always share proprietary geometry. This makes BJS unsuitable be used by consultants. I have been out of the consulting business longer than many here have been programming. Having to ask the client permission to show your actual work to determine a problem would make you look like a complete light weight. Not looking for work right now, but that new format, g something, would probably what the client wanted. Doubt it logs. Will worry about that later. TOB is being refactored to be multi file source. Though it is very OO, being 1 gigantic file is a limiting factor. The architecture would actually support JS / JSON / and the G thing. Not going to do that right now, but probably not going to add new stuff to the JSON format single source file for much longer. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 7, 2016 Share Posted March 7, 2016 I think this is glTF and we handle it already: https://github.com/BabylonJS/Babylon.js/tree/master/loaders/glTF Adding logs is a good idea... Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 7, 2016 Share Posted March 7, 2016 I was talking about TOB being a glTF producer. Not really seriously considering yet, just saying it could handled with the 2 pass architecture. Logging wise, I have put most of the logging in each major class, just like the parse is. In the form of a toString. Here is skeletons example: /** * @param {boolean} fullDetails - support for multiple levels of logging within scene loading */ public toString(fullDetails? : boolean) : string { var ret = "Name: " + this.name + ", nBones: " + this.bones.length; ret += ", nAnimationRanges: " + (this._ranges ? Object.keys(this._ranges).length : "none"); if (fullDetails){ ret += ", Ranges: {" var first = true; for (var name in this._ranges) { if (!first){ ret + ", "; first = false; } ret += name; } ret += "}"; } return ret; } I have put in trapping in the loader methods. Have so many major classes checked out. My dog is sick & needs attention, so going to do a commit PR with what I got so far. You just cannot keep this many files checked out at once. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 7, 2016 Share Posted March 7, 2016 No rush... Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 7, 2016 Share Posted March 7, 2016 If someone else commits a file I have a toString in, I have to put my file aside, revert my changes, merge, and manually put my change back. Quote Link to comment Share on other sites More sharing options...
natewallis Posted June 11, 2018 Share Posted June 11, 2018 Hi all, I realise its been a couple years since this was posted - just wondering what the current state of play is in regards to the original post? I am researching whether babylon.js will allow me to load my character model and apply different animations to it based on user interaction.. Cheers.. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 11, 2018 Author Share Posted June 11, 2018 I did it on 2 projects that are day under development. To do that : 1) You load your dummy model that contains the animations with ImportMesh, then you create animations skeleton.createAnimationRange ('walk', keyStart, KeyEnd). This dummy model can be disposed afterwards. 2) You load the other models without animations which contains the same number of bones as the dummy model and you copy the animations there with skeleton.copyAnimationRange (skeleton, 'walk', true); 3) You play the animations following the user interaction by calling the animation you need by name with skeleton.beginAnimation ('' walk ', true, 1.0); 4) If later you want to add animation, you do it on the dummy model only and in the code, you add the animations with createAnimationRange () and copyAnimationRange (). You can have a class that will allow you to easily add your animations. The goal is to use a single dummy character with new animations and load them on all the other characters and following the interactions of the user call the appropriate animation by are name contained in copyAnimationRange () Here is a small PG example: http://www.babylonjs-playground.com/#GA8XI#111 Quote Link to comment Share on other sites More sharing options...
natewallis Posted June 11, 2018 Share Posted June 11, 2018 Hi - thanks for the response. Looks good to me. Have you discovered any limitations to this process yet? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 11, 2018 Author Share Posted June 11, 2018 No I have not yet find any real limit. 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.