reddozen Posted May 27, 2014 Author Share Posted May 27, 2014 Collada Animation:It's not likely that it will come up with anyone else before it's fixed, but here's the bug reported to Blender.https://developer.blender.org/T40374 I'll pick back up on this once they get it resolved in Blender. Octree:I guess I''ll work on the octree stuff for now. Anyone have an idea what's going wrong with this? No matter where I initialize the octree. It basically shows none of my models. Quote Link to comment Share on other sites More sharing options...
gryff Posted May 27, 2014 Share Posted May 27, 2014 Soooo... gryff... now I'm getting triplication. So now I can stop worrying about men in white coats coming to take me away Read the report you filed The issue of the frames imported as I said above was due to the frame rate setting - older versions were set to 24fps newer versions set to 30fps - so that is not an issue. Good luck - will be watching the result. cheers, gryff Quote Link to comment Share on other sites More sharing options...
reddozen Posted May 27, 2014 Author Share Posted May 27, 2014 I added the image and updated the report. Now if we can figure out the octrees and accessing the models after they've been created. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 28, 2014 Share Posted May 28, 2014 For the octree you have to construct it AFTER having loaded every mesh Quote Link to comment Share on other sites More sharing options...
reddozen Posted May 29, 2014 Author Share Posted May 29, 2014 For the octree you have to construct it AFTER having loaded every mesh That worked. I'm guessing there's no way to know for sure once the whole scene is loaded through BABYLON.SceneLoader.ImportMesh?How would that work with incremental loading since everything isn't loaded from the start? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 31, 2014 Share Posted May 31, 2014 for this kind of things, you can ask scene.isReady() Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 31, 2014 Share Posted May 31, 2014 Or even better: scene.executeWhenReady(func) Quote Link to comment Share on other sites More sharing options...
reddozen Posted May 31, 2014 Author Share Posted May 31, 2014 Scene.isReady doesn't seem to work for this. I'll try scene.executeWhenReady(func) This still causes nothing to render with BABYLON.SceneLoader.ImportMesh()// Once the scene is loaded, just register a render loop to render itif (scene.isReady()){ //scene.createOrUpdateSelectionOctree(); engine.runRenderLoop(function() { scene.render(); scene.createOrUpdateSelectionOctree(); }}EDIT:scene.executeWhenReady(func) seems to work. Now I'll play with it some. Quote Link to comment Share on other sites More sharing options...
reddozen Posted June 17, 2014 Author Share Posted June 17, 2014 Back to this... I have a monster that loads now... no errors int he console, but I can't get the animation to start. Tap the back arrow key and you'll see the monster. I even tried calling this from the execute when ready section, but you get an error "TypeError: b is null"scene.beginAnimation(scene.getMeshByName("Boss_Pukui"), 0, 250, true); Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 18, 2014 Share Posted June 18, 2014 Are you sure this returns an object:scene.getMeshByName("Boss_Pukui") ? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 18, 2014 Share Posted June 18, 2014 From my point of view your object has no animations (mesh.animations.length == 0) Quote Link to comment Share on other sites More sharing options...
reddozen Posted June 18, 2014 Author Share Posted June 18, 2014 Are you sure this returns an object:scene.getMeshByName("Boss_Pukui") ? That's my point... I can't seem to reference an object int he scene by name. From my point of view your object has no animations (mesh.animations.length == 0) weird... I exported it from blender, and there's 250 frames of data in the *.babylon file... Quote Link to comment Share on other sites More sharing options...
gryff Posted June 18, 2014 Share Posted June 18, 2014 Red, well if the"monster is that pig-looking thing - I seemed to load right inside it ! I got no errors apart from "The character encoding of the HTML document was not declared ... " and a warning about "Synchronous XMLHttpRequest on the main thread is deprecated ..." Want to PM a link to its .blend file for the monster? Ohh, and reducing camera speed might help - I career all over the place. cheers, gryff Quote Link to comment Share on other sites More sharing options...
reddozen Posted June 18, 2014 Author Share Posted June 18, 2014 yea, the scene is very much so a work in progress.It's more a test than anything. I'll send you a link to the blend file. Quote Link to comment Share on other sites More sharing options...
gryff Posted June 18, 2014 Share Posted June 18, 2014 Well red, I opened the .blend file in Blender, exported the .babylon file then set it up withBABYLON.SceneLoader.Load("", "Boss_Pukui.babylon", engine, function (newScene) {....});Worked fine. Inspection of the babylon file shows a 250 frame animation as you said. Will investigate further using the "BABYLON.SceneLoader.ImportMesh" option. cheers, gryff Quote Link to comment Share on other sites More sharing options...
reddozen Posted June 18, 2014 Author Share Posted June 18, 2014 Yea, it loads in the scene for me, it just doesn't animate.Maybe I'm doing something wrong? Quote Link to comment Share on other sites More sharing options...
gryff Posted June 19, 2014 Share Posted June 19, 2014 Well red, I tried using the same type of code as I used for my Desk and Book animation experiment : And here is the result : Pukui. Click on the cubes to try and start the animation and in my FF web console I get :TypeError: b is undefinedI have no idea what that means. Edit: with the correct syntax as outlined by DK below this is gone and it works like a charm. I added a few lines to try and debug you will see them in the ImportMeshBABYLON.SceneLoader.ImportMesh("", "", "Boss_Pukui.babylon", newScene, function (newMeshes,skeletons) { thePig = newMeshes[0]; mySkeleton[0] = skeletons[0]; console.log(thePig); console.log(thePig.name); console.log(thePig.animations); //newScene.beginAnimation(mySkeleton[0], 1, 250, false, 1); //thePig.position.x = 10; });and the results show up in the web console - most significantly is the empty animations array. If I use the "thePig.position.x = 10;" - that works. Maybe I'm doing something wrong? Well if you are - I'm must be doing it too. But as I'm using essentially the same code as the desk and book, I'm not sure what. Will post again if I have a blinding flash of inspiration. cheers, gryff Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 19, 2014 Share Posted June 19, 2014 Hehe the right signature is:BABYLON.SceneLoader.ImportMesh("", "", "Boss_Pukui.babylon", newScene, function (newMeshes,particleSystems, skeletons) { Quote Link to comment Share on other sites More sharing options...
gryff Posted June 19, 2014 Share Posted June 19, 2014 And now it works like a charm. TY DK. (Syntax will get me every time it can ) cheers, gryff GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
reddozen Posted June 19, 2014 Author Share Posted June 19, 2014 awesome... it works.now for the other problems...1) can I control the frame speed?2) the exporter for blender seems to have messed up the model's animations. if you look at his standing animation his legs suck up into his body and deform him (looks like this is happening at several points in the animation string). Could this be due to the merged animation matrix I defined from 3DS? He looks and plays correctly in 3DS and Blender (aside from the animations being too fast). His crown seems to rotate wrong too. it's just supposed to spin on his head, but instead, it's rotating on an arc (if that makes sense). Gryff,I figured out the XYZ "duplication" coming out of 3DS. It was actually defining each independent rotation of the bone separately per animation frame. If you merge the animation matrix on export to open collada, you only get one XYZ set. DK,Is merging the matrix the right thing to do? should the babylon blender export merge them on it's own if it sees them? should the babylon blender export support the multiple independent rotations, per bone, per frame of animation? I foresee others having similar problems, so it may be worth defining the scope so people will know. Quote Link to comment Share on other sites More sharing options...
gryff Posted June 19, 2014 Share Posted June 19, 2014 1) can I control the frame speed? The last digit in this line ("1") controls the playback rate set it to .5 for examplenewScene.beginAnimation(mySkeleton[0], 1, 250, false, 1);By the way, what was the original framerate for the animation? I exported from Blender at 30fps - which maybe why it seems fast. 2) the exporter for blender seems to have messed up the model's animations. It is a very curious rig It has a lot of "Dummy" bones. Blender recognizes them, though they have no bones shape, and I have no idea what the exporter does with them. If you look at them in Blender they don't actually move any vertex directly but seem to act more like a control bone - controlling other bones - yet they are labeled as deform bones. You might want to do a Google search on "fbx, dummy bones and 3dMax" as they seem to originate in Max and can cause issues with import and export. The other suggestion I have is maybe try the fbx exporter that DK has been working on. I gather it now supports animations. Also take a look at my Desk example again - as the doors and drawers are animated just by selecting the translation/rotation for a single bone. cheers, gryff Quote Link to comment Share on other sites More sharing options...
reddozen Posted June 19, 2014 Author Share Posted June 19, 2014 Officially each animation (there's like 7 all pieced together) has it's own frame rate. The exporter (modified version of UEviewer) doesn't seem to export the official rate for each animation. It's fine though as long as I can control it, I'll just manually set it up when I define the animations available for each monster. The speed will have to fluctuate anyway based on speed power ups for walking or attacking anyway. That's odd about the dummy bones, but there may not be anything I can really do about them given the exporter / 3DS importer I'm going to have to use to get them converted (without modifying hundreds of models by hand... no thanks)... I think the FBX exporter supports animations, but not bones yet. DK will have to clarify. The thing is, the animation plays fine in both 3DS and Blender without the distortion issues... so I'm not sure why Babylon would be any different unless there's something odd going on in the export script from Blender. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 19, 2014 Share Posted June 19, 2014 FBX exporter does not support animations neither bones. For animations I suggest blender or 3dsmax For bones, I'm still working on support for 3ds max. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 19, 2014 Share Posted June 19, 2014 Ah, I have however already export to FBX with 3ds max to import in Unity 3D and animation was well there.But I believe the problem was bind the modifier 'physic' should not use and used instead the modifier 'skin'. Quote Link to comment Share on other sites More sharing options...
reddozen Posted June 19, 2014 Author Share Posted June 19, 2014 Ah, I have however already export to FBX with 3ds max to import in Unity 3D and animation was well there.But I believe the problem was bind the modifier 'physic' should not use and used instead the modifier 'skin'. Where is that option on 3DS? 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.