@gmetrixr/rjson
Version:
(R)ecursive Json
24 lines (23 loc) • 870 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const r_1 = require("../../../r");
/**
* Assign the default height of 0.85M to scenes where scene_viewer_height = undefined
* All existing scenes assume a height of 0.85M
*/
class Migration {
execute(projectJson) {
const pJson = projectJson;
const projectF = r_1.r.project(pJson);
const scenes = projectF.getAllDeepChildrenWithFilter(r_1.RT.scene, s => s.props.scene_type === r_1.sn.SceneType.six_dof);
for (const s of scenes) {
const sceneF = r_1.r.scene(s);
if (!sceneF.get(r_1.rtp.scene.scene_viewer_height)) {
sceneF.set(r_1.rtp.scene.scene_viewer_height, 1.2);
}
}
projectF.set(r_1.rtp.project.version, 137);
}
}
const migration = new Migration();
exports.default = migration;