Kilombo Posted July 23, 2014 Share Posted July 23, 2014 Good afternoon everyone, I'm trying to beginAnimation with one imported mesh from blender, but something is going wrong cause nothing happens.Supposely, the animation is started when a ship is destroyed, can some one take a look? I'm missing something for sure.The animation consists on the ship beeing destroyed, so I putted a particle system on the mesh and added a modifier (explosion) (in blender of course), it's supposed to work. But it's not....unit.prototype.setMesh = function (mesh){ this.mesh = mesh; this.mesh.position.x = this.getShipPosx(); this.mesh.position.z = this.getShipPosz(); this.mesh.rotation.y = this.getShipRotation(); this.mesh.position.y = 0; if (this.destroy === true){ console.log("chega aqui"); scenes[0].beginAnimation(ship, 0, 100, true); console.log(ship); this.destroy = false; }};unit.prototype.setDamage = function(power) { if (this.shieldSize > 0){ this.shieldSize = this.shieldSize - power; } else if (this.shieldSize < 0){ this.shieldSize = 0; } else { this.armor = this.armor - power; } if (this.armor <= 0){ this.armor = 0; this.destroy = true; this.setMesh(this.mesh); }};unit.prototype.load3D = function(name,imageFileName,posx,posz,roty,meshid,type,octree){ var temp = this; BABYLON.SceneLoader.ImportMesh(name, "Assets/babylonreadyfiles/", imageFileName, scenes[0], function(newMeshes) { ship = newMeshes[0].clone(); ship.scaling.x = constants.shipScale; ship.scaling.y = constants.shipScale; ship.scaling.z = constants.shipScale; ship.actionManager = new BABYLON.ActionManager(scenes[0]); if (selfchecker === 0) { selfchecker = 1; temp.setShipPos(posx,posz,roty); //temp.loadParticlesEngine(newMeshes[0]); }; makeOverOut(ship,meshid,type); octree.dynamicContent.push(ship); octree.useOctreeForCollisions; //newMeshes[0].checkCollisions = true; temp.setMesh(ship); });}; Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 23, 2014 Share Posted July 23, 2014 Are you sure animations are in the .babylon file? At first glance your code sounds good to me Quote Link to comment Share on other sites More sharing options...
Kilombo Posted July 23, 2014 Author Share Posted July 23, 2014 I Dk, Does the animation importer supports the blender particle system and the explode modifier? I'm starting to think that can be something relationed with that. Cause when I check in the console log (with console.log(this.mesh)) it returns "animations: Array[0]", so... there's no animation exported Do you know of some problem relationed with this features ? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 23, 2014 Share Posted July 23, 2014 That's the problem we do not export particles animations:https://github.com/BabylonJS/Babylon.js/blob/master/Exporters/Blender/readme.md Quote Link to comment Share on other sites More sharing options...
Kilombo Posted July 23, 2014 Author Share Posted July 23, 2014 That's the problem we do not export particles animations:https://github.com/BabylonJS/Babylon.js/blob/master/Exporters/Blender/readme.mdToo bad , This would be really a cool feature, imagine how easy it to explode one imported mesh with this feature Thanks anyway. I have to do a work around. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted July 27, 2014 Share Posted July 27, 2014 This has caused me to alter Tower of Babel (not moved up yet), defensively so far. I have now added a 13th warning type. In the first pass through all of the objects in scene.objects. If the object.type is not a 'CAMERA', 'LAMP', 'ARMATURE', 'MESH', or 'EMPTY' (Materials are not objects), then it now actively says it is being ignored: TowerOfBabel.log('WARNING: following object is not currently exportable thus ignored: ' + object.name) This should at least not silently leave one wondering when something does not transfer over. I have tested it with a .blend file that has lattices & the message works. I looked through the 350 odd .blends that Blender support has & I find no example of particlesytems, let alone ones that animate it. There is some stuff called particles in the hair section, but not sure if they are the same. If you produce the simplest possible .blend you can that has this & append it to this thread as a sample.blend.txt, I will at least take a look at it. It would not be prior to getting shapekeys through, so no hurry. Jeff 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.