amorgan Posted January 27, 2015 Share Posted January 27, 2015 I have imported my mesh with a skeleton and animation. The Mesh comes in correctly, but once I play the animation all of the normals get inverted? I am using v2.0 beta (just downloaded fresh)? It is the same model here: http://www.html5gamedevs.com/topic/12002-blender-and-animations/ Any ideas? Quote Link to comment Share on other sites More sharing options...
gryff Posted January 27, 2015 Share Posted January 27, 2015 Very odd behaviour amorgan I have created two examples to show the effect so the coders can see the effect: 1. Animation not allowed to play 2. Animation allowed to play once The babylon file created with Blender 2.73 with the babylon exporter 1.62 cheers, gryff amorgan 1 Quote Link to comment Share on other sites More sharing options...
amorgan Posted January 27, 2015 Author Share Posted January 27, 2015 Has anyone had a moment to take a look at this? I am not sure if this is a Bablyon issue or a Blender issue, though I don't know what the issue could be if it originates from Blender. Thank you. Quote Link to comment Share on other sites More sharing options...
gryff Posted January 28, 2015 Share Posted January 28, 2015 The above two examples are done with babylon.2.0-beta.js (downloaded last Saturday - Jan 24th 2015 - from github) This is the same babylon file used in the above two examples but using babylon.1.14.js 3. Animation Playing It seems to work fine I am not sure if this is a Bablyon issue or a Blender issue Well amorgan, to me there seem to be two options: a.) There is an issue with the exporter - which seems unlikely as the file behaves the way it should with babylon v1.14. b.) There is an issue with babylon 2 . Be nice if a babylon coder took a look at this thread. cheers, gryff Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 28, 2015 Share Posted January 28, 2015 Sorry, I do not use blender. but if it works with 1.14 and it does not work with 2.0 it is actually possible that this is a problem that version 2.0. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 28, 2015 Share Posted January 28, 2015 I am also having a problem with bone animation. The test .blend Gryff made suddenly went weird once animation started. I thought it was me doing something in exporter. I have been getting frequent updates to 2.0. Think it started last Thursday. Did not report, because I thought it was me, but this does seem to fit with an external (to me) change. Quote Link to comment Share on other sites More sharing options...
amorgan Posted January 28, 2015 Author Share Posted January 28, 2015 Well makes me feel better, hopefully DK or someone can take a look at this. Thanks for everyone's help so far! Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 28, 2015 Share Posted January 28, 2015 Some more color:I found a Jan 5, babylon 2.0 on my system. Replaced my Jan 23 version with it, and it now animates correctly. Put it back to Jan 23 and problem. Thought the problem showed up the day before though, Jan 22. Also, not experiencing a normals problem. See picture Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 28, 2015 Share Posted January 28, 2015 Found another on Jan 22, 632.6 kb, a little smaller than the Jan 23 file. Still have the problem. Using Github, got the file with the tag '/*! Babylon 2015-01-20 */'. Still the error. I have not been re-running my entire battery of test with every version I get. Do not actually care much about bones, since I have not actually been do dev there. Was going to check earlier files, but nothing before that. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 28, 2015 Share Posted January 28, 2015 Crap! Gryff can you send me the .babylon file you used? Quote Link to comment Share on other sites More sharing options...
gryff Posted January 28, 2015 Share Posted January 28, 2015 Your wish is my command Figure.zip I hope it is not serious. cheers, gryff Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 28, 2015 Share Posted January 28, 2015 Investigating gryff and amorgan 2 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 28, 2015 Share Posted January 28, 2015 Hey, score a big one for paranoia! The entire volume backup process I do using truecrypt got me a repository with a babylon.2.0-alpha.js with the date Jan 20. Want me to try to walk back last known working comit? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 28, 2015 Share Posted January 28, 2015 Well, just double checking I could actually do it. Bisected & tried Jan 11, still worked. Will check till no longer works. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 28, 2015 Share Posted January 28, 2015 Jan 19, 2015 1:03:51 PM, Performance improvements is the culprit Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 28, 2015 Share Posted January 28, 2015 classes changed in that release:Color4.prototype.copyFromQuaternion.IdentityMatrix.prototype.decomposeMatrix.ComposeTools.SignTools.CreateScreenshotAsyncLoop_DepthCullingState var partialLoadEngine constructorEngine.prototype.createCubeTextureEngine.prototype.createCubeTextureSpotLight.prototype.getAbsolutePositionSpotLight.prototype.computeTransformedPositionDirectionalLight.prototype.getAbsolutePositionDirectionalLight.prototype.computeTransformedPositionShadowGenerator.prototype.isReadyScene.prototype.getNodeByNameMesh.prototype.simplifyParticle.prototype.copyToParticleSystem.prototype.recycleParticleAnimation.prototype.matrixInterpolateFunctionAnimation.prototype._interpolate Getting tired. More if asked for Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 28, 2015 Share Posted January 28, 2015 Ok thanks JCPalmer, sounds like a good point to start with Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 28, 2015 Share Posted January 28, 2015 ok and it's a win!! The matrixInterpolate stuff introduced by kpko. So far I'll revert the matrix interpolation code to previous version Quote Link to comment Share on other sites More sharing options...
kpko Posted January 28, 2015 Share Posted January 28, 2015 Hi guys, I'm currently investigating this issue. I had a similar problem while testing with one of my own models exported from Blender, but since the meshes and animations which come with the babylon samples are working with the interpolation functions, I would have not believed the bug was introduced by my code and I did something wrong in Blender itself. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 28, 2015 Share Posted January 28, 2015 Thanks a lot Kpko! So far I commented the interpolation so things should now work well Quote Link to comment Share on other sites More sharing options...
kpko Posted January 28, 2015 Share Posted January 28, 2015 Hi again, I think I found a clue leading to the problem. I looked into the file exported by Blender:... "skeletons": [ { "name": "Skeleton", "id": 0, "bones": [ { "name": "pelvis", "index": 0, "matrix": [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0, 4, -0.1425, 1 ],...If you have no rotation, the scale values of the matrix (the values at position 0 (scale x), 5 (scale y) and 10 (scale z)) would be X: 1, Y: 1 and Z: -1. This could lead to the flipped normals problem. These values are created from the Blender exporter which I'm not very familiar with. Maybe my code did reveal that issue because I multiply with those matrices when I do the interpolation. I'm still looking into this issue, but could anyone who knows the Blender exporter tell me where the value "-1" is coming from? Just to be sure :-) Thank you very much for flagging this bug :-) amorgan 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 28, 2015 Share Posted January 28, 2015 I.m not sure this is related to exporter because rendering works with the same .babylon file so far Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 28, 2015 Share Posted January 28, 2015 Maybe my code did reveal that issue because I multiply with those matrices when I do the interpolation. I'm still looking into this issue, but could anyone who knows the Blender exporter tell me where the value "-1" is coming from? Just to be sure :-) Cannot help you directly. Code is below. Matrix_world comes from skeleton.matrix_world. I did not write this part. @staticmethoddef get_matrix(bone, matrix_world): SystemMatrix = mathutils.Matrix.Scale(-1, 4, mathutils.Vector((0, 0, 1))) * mathutils.Matrix.Rotation(math.radians(-90), 4, 'X') if (bone.parent): return (SystemMatrix * matrix_world * bone.parent.matrix).inverted() * (SystemMatrix * matrix_world * bone.matrix) else: return SystemMatrix * matrix_world * bone.matrixI can say that when I first saw this issue, that I diffed my in-line code generated (similar to .babylon file). I found that Blender 2.72 generated different values for some position, normals, indices, skeleton weight, & skeleton indices than 2.69. None of the bones matrices or animations changed. This is why I thought it was something I had done in an unreleased version of the exporter. It did not make any sense that it rendered ok without animation, though. Gave me a head ache & was not in production, so I worked on something else. Think that 2.72 must of just generated things in a different vertex order. Quote Link to comment Share on other sites More sharing options...
kpko Posted January 28, 2015 Share Posted January 28, 2015 I.m not sure this is related to exporter because rendering works with the same .babylon file so far Yeah, I'm not sure too, that was just the first thing that caught my attention.. As far as I know, -1 at this position defines a negative scale at z axis, given you have no rotation: https://www.opengl.org/discussion_boards/showthread.php/159215-Is-it-possible-to-extract-rotation-translation-scale-given-a-matrix To begin, your scale matrix is of the form Code :[sx 0 0 0]| 0 sy 0 0|| 0 0 sz 0|[ 0 0 0 1] which is really difficult to extract when a rotation was applied:[ ax*ax*(1-c)+c ax*ay*(1-c)+az*s ax*az*(1-c)-ay*s 0]|ax*ay*(1-c)-az*s ay*ay*(1-c)+c ay*az*(1-c)+ax*s 0||ax*az*(1-c)+ay*s ay*az*(1-c)-ax*s az*az*(1-c)+c 0|[ 0 0 0 1] Quote Link to comment Share on other sites More sharing options...
amorgan Posted January 29, 2015 Author Share Posted January 29, 2015 Thanks for being on top of this guys! I tested the newest version with mine and of course it works. I know you guys have more stuff to work on, but thank you! On the note of animations and blender, does the exporter support multiple animations? I have made multiple animations with the Action Manager and have attached them to Fake Users, but are not showing up anywhere in the imported model. I can make another forum post if needed. Edit: Also wanted to note that I now have two meshes that are attached to my bones and only the first mesh is moving with my animation? 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.