Save to JSON.
(self, path: str)
| 230 | return self.get_camera(idx) |
| 231 | |
| 232 | def save(self, path: str): |
| 233 | """Save to JSON.""" |
| 234 | data = { |
| 235 | 'total_frames': self.total_frames, |
| 236 | 'interpolation': self.interpolation, |
| 237 | 'keyframes': [ |
| 238 | { |
| 239 | 'frame': kf['frame'], |
| 240 | 'eye': kf['eye'].tolist(), |
| 241 | 'center': kf['center'].tolist(), |
| 242 | 'up': kf['up'].tolist(), |
| 243 | 'fov': kf['fov'], |
| 244 | } |
| 245 | for kf in self.keyframes |
| 246 | ], |
| 247 | } |
| 248 | with open(path, 'w') as f: |
| 249 | json.dump(data, f, indent=2) |
| 250 | |
| 251 | @classmethod |
| 252 | def load(cls, path: str) -> 'CameraPath': |
nothing calls this directly
no outgoing calls
no test coverage detected