[Be Solved] How to save the newly added 3D object to the array without clicking on a specific object?

Hi Everyone,
I want to store Boxtest1, Boxtest2, Boxtest3 in the array without clicking on a specific object, how do I modify it?

option.onClick(function () {

		var object = editor.selected;
		if (object === null) {

			alert('No object selected');


		var output = object.toJSON();

		try {

			output = JSON.stringify(output, parseNumber, '\t');
			output = output.replace(/[\n\t]+([\d\.e\-\[\]]+)/g, '$1');

		} catch (e) {

			output = JSON.stringify(output);


In addition, I want to know how to get the list of objects in the scene in the upper right corner.
螢幕擷取畫面 2020-11-17 155358

in Menubar.Room.js


editor is an object containing attributes such as scene and camera.
editor.scene.children is an array containing objects in the scene.

1 Like