Get Source Object Properties on Event

Hi Guys, For example, the following code will modify the color when clicking on a predefined mesh. How can I know what the original color of the mesh was in order to return it to the previous state?

this.sphere.actionManager = new ActionManager(this.scene);

        this.sphere.actionManager.registerAction(
            new InterpolateValueAction(
                ActionManager.OnPickTrigger,
                this.light,
                'diffuse',
                Color3.Black(),
                1000
            )
        );

Hi @gladiator-media

This is outside scope of babylon.js. You need to maintain such knowledge in your code. If you were building an editor/configurator kind of app and would like user to be able to revert back to default, you need to keep the original value in your app. Similarly, if you want user to be able to undo to step back the changes, you need to keep the change history.

2 Likes