UNPKG

@gmetrixr/rjson

Version:
22 lines (21 loc) 908 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const r_1 = require("../../../r"); class Migration { execute(projectJson) { const pJson = projectJson; const projectF = r_1.r.record(pJson); const scenes = projectF.getRecords(r_1.RT.scene); for (const s of scenes) { const sceneF = r_1.r.scene(s); // @ts-ignore - required here since background is not a supported element type but we still wan tot remove it from our list const backgroundElements = sceneF.getAllDeepChildrenWithFilter(r_1.RT.element, (e) => e.props.element_type === "background"); for (const b of backgroundElements) { sceneF.deleteDeepRecord(r_1.RT.element, b.id); } } projectF.set(r_1.rtp.project.version, 118); } } const migration = new Migration(); exports.default = migration;