UNPKG

@gmetrixr/rjson

Version:
21 lines (20 loc) 756 B
import { r, rtp, RT } from "../../../r"; /** * Renames scene properties * scene_yaw_correction -> scene_yaw_start * scene_pitch_correction -> scene_pitch_start (this property is kept for older projects, * get handled via runtime migration to PointTo rule) */ class Migration { execute(projectJson) { const pJson = projectJson; const projectF = r.record(pJson); for (const e of projectF.getAllDeepChildren(RT.scene)) { r.record(e).changePropertyName("scene_yaw_correction", "scene_yaw_start"); r.record(e).changePropertyName("scene_pitch_correction", "scene_pitch_start"); } projectF.set(rtp.project.version, 123); } } const migration = new Migration(); export default migration;