# SceneRecorder Apply Delta not working

**URL:** <https://forum.babylonjs.com/t/scenerecorder-apply-delta-not-working/21193>\
**Category:** Questions\
**Tags:** react\
**Created:** [May 27, 2021, 12:45pm UTC](https://forum.babylonjs.com/t/scenerecorder-apply-delta-not-working/21193 "2021-05-27T12:45:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ali.naim](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ali.naim/32/15505_2.png) [@ali.naim](https://forum.babylonjs.com/u/ali.naim)\
**Post date:** [May 27, 2021, 12:45pm UTC](https://forum.babylonjs.com/t/scenerecorder-apply-delta-not-working/21193/1 "2021-05-27T12:45:23Z")

</div>

Hello I am using Babylon version 5.0.0-alpha.22 with a react project  
Here are the dependencies:  
“@babylonjs/core”: “^5.0.0-alpha.22”,  
“@babylonjs/inspector”: “^5.0.0-alpha.22”,  
“@babylonjs/loaders”: “^5.0.0-alpha.22”,

I uploaded a glb model to the inspector, made some changes and downloaded the _diff.json_ file which holds all the changes on the model.  
In the project I load the same 3d model and put the json file (changes file) in the _src_ folder

This is how my Custom.js Component looks like

```
import { Component } from "react";

import Helper from "./Helper";

import carChanges from "./diff.json";

var scene;

var engine;

class CustomScene extends Component {

  constructor(props) {
    super(props);
    this.helperInstance = new Helper();
  }

  componentDidMount() {
    this.start();
  }

  start = () => {

    let canvas = document.getElementById("scene-canvas");

    engine = this.helperInstance.createEngine(canvas);

    scene = this.helperInstance.createScene(engine);

    this.helperInstance.loadModel(scene, "Car.glb");

    this.helperInstance.applyChanges(scene, carChanges);

    // Add Events

    window.addEventListener("resize", this.onWindowResize, false);

    // Render Loop

    engine.runRenderLoop(() => {

      scene.render();

    });

  };

  onWindowResize = (event) => {

    engine.resize();

  };

  render() {

    return (

      <div>

        <canvas id="scene-canvas"></canvas>

      </div>

    );

  }

}

export default CustomScene;

```

Helper.js class

```
import { SceneLoader, Scene, Engine } from "@babylonjs/core";

import "@babylonjs/loaders"; // for models to be uploaded to the scene

import "@babylonjs/inspector"; // for scene debug layer show

import { SceneRecorder } from "@babylonjs/core/Misc/sceneRecorder";

class Helper {

  createEngine(canvas) {

    const engine = new Engine(canvas, true);

    return engine;

  }

  createScene(engine) {

    //Create Scene

    let scene = new Scene(engine);

    scene.createDefaultCameraOrLight(true, true, true);

    scene.createDefaultEnvironment({ createGround: false, createSkybox: false });

    scene.debugLayer.show();

    return scene;

  }

  applyChanges(scene, changes) {

    console.log("Inside the apply changes function ...");

    console.log(changes);

    console.log(scene);

    // scene and changes are correct

    SceneRecorder.ApplyDelta(changes, scene);

  }

  // load a glb model in a scene

  loadModel(scene, model) {

    SceneLoader.Append(`${process.env.PUBLIC_URL}/assets/`, model, scene, (scene) => {});

  }

}

export default Helper;

```

When I apply the delta file in the inspector it works fine so I think the SceneRecorder feature is working

Is there a problem with my code and how I am using SceneRecorder?

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [May 27, 2021, 3:28pm UTC](https://forum.babylonjs.com/t/scenerecorder-apply-delta-not-working/21193/2 "2021-05-27T15:28:48Z")

</div>

Ideally we could use a repro in the PG to help because checking your code like that is not an easy task  
Did you looked at the inspector code:  
[Babylon.js/toolsTabComponent.tsx at master · BabylonJS/Babylon.js (github.com)](https://github.com/BabylonJS/Babylon.js/blob/master/inspector/src/components/actionTabs/tabs/toolsTabComponent.tsx#L276)

---

<div class="post-metadata">

**Author:** ![ali.naim](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ali.naim/32/15505_2.png) [@ali.naim](https://forum.babylonjs.com/u/ali.naim)\
**Post date:** [May 28, 2021, 7:06am UTC](https://forum.babylonjs.com/t/scenerecorder-apply-delta-not-working/21193/3 "2021-05-28T07:06:19Z")

</div>

@Deltakosh

Created a playground, the changes from the object are not being applied to the scene  
[https://playground.babylonjs.com/#9ZS92P](https://playground.babylonjs.com/#9ZS92P)

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [May 28, 2021, 5:35pm UTC](https://forum.babylonjs.com/t/scenerecorder-apply-delta-not-working/21193/4 "2021-05-28T17:35:02Z")

</div>

here we are: [ApplyDelta Not Working | Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/#9ZS92P#1)
