• Content count

  • Joined

  • Last visited

  1. Animation not playing

    your blind mode hit a bulls-eye.
  2. Animation not playing

    If I put ImportMesh before executeWhenReady, the files never load. It will keep showing babylonjs default loading screen. I am not aware of how to use SceneLoader in playground. However, I have attached a simple scene with a box and sphere to replicate the issue. b.babylon has a plane, box and sphere. t.babylon has a teapot. A simple animation is attached to Sphere. Whenever camera collides with the Box, sphere moves 5000 units in x direction. If I load only b.babylon the animation plays. But If I load t.babylon also using ImportMesh then the animation doesn't work.
  3. Hi All, I am facing an issue where Door animation is not playing in a particular situation. If I am loading only one babylon file then the animation plays without any issues. But If I have multiple babylon files then the animation is not played. This is part of my js code: ===================================================================================================== if (BABYLON.Engine.isSupported()) { canvas = document.getElementById("renderCanvas"); engine = new BABYLON.Engine(canvas, true); scene = new BABYLON.Scene(engine); BABYLON.SceneLoader.Append("./", "Walls.babylon", scene); scene.executeWhenReady(function () { scene.gravity = new BABYLON.Vector3(0, -0.9,0); scene.activeCamera.ellipsoid = new BABYLON.Vector3(1000,1000,1000); scene.collisionsEnabled = true; scene.activeCamera.checkCollisions = true; //scene.activeCamera.applyGravity = true; scene.activeCamera.maxZ = 80000; // Attach camera to canvas inputs scene.activeCamera.attachControl(canvas); BABYLON.SceneLoader.ImportMesh(null, "./", "Ceiling.babylon", scene); var door1 = scene.getMeshByName("Door1");; var frameRate = 20; // Trigger Boxes var openTriggerBox = BABYLON.Mesh.CreateBox("openTriggerBox", 3000, scene); openTriggerBox.position.x = 746.9932; openTriggerBox.position.y = 1500; openTriggerBox.position.z = -4287.0; openTriggerBox.checkCollisions = true; openTriggerBox.isVisible = false; scene.activeCamera.onCollide = function (colMesh) { if (colMesh.uniqueId === openTriggerBox.uniqueId) { openTriggerBox.collisionsEnabled = false; openTriggerBox.checkCollisions = false; scene.beginDirectAnimation(hingeDoor1, [openDoor1], 0, 25 * frameRate, false); scene.beginDirectAnimation(hingeDoor2, [openDoor2], 0, 25 * frameRate, false); } } var hingeDoor1 = BABYLON.MeshBuilder.CreateBox("hinge1", {}, scene) hingeDoor1.isVisible = false; door1.parent = hingeDoor1; hingeDoor1.position.y = 2; //for door 1 to open and close var openDoor1 = new BABYLON.Animation("openDoor1", "position.x", frameRate, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); var open1_keys = []; open1_keys.push({ frame: 0, value: 0 }); open1_keys.push({ frame: 3 * frameRate, value: -1000 }); openDoor1.setKeys(open1_keys); engine.runRenderLoop(function() { scene.render(); }); ===================================================================================================== If I remove BABYLON.SceneLoader.ImportMesh(null, "./", "Ceiling.babylon", scene); line from above code then the animation works without any issues. Can anyone please point me to the mistake I am doing in this code or the solution to the problem.
  4. Hi Everyone, I have basically 2 queries: 1 - What is the format and parameters to give MirrorPlane details inside babylon Binary file? (Material has tags called "isRenderTarget", "renderTargetSize", "mirrorPlane", "renderList", so I presume by giving proper values here I can get it working) 2 - How can we convert .babylon to Binary version and viceversa? The reason I am asking these questions is, I use 3DS Max and find it difficult to get certain features(like mirror material) working. Hence, I want to edit/add the properties inside the babylon file. Though I can access these in HTML, I don't want to expose these changes.