Load from JSON.
(cls, path: str)
| 250 | |
| 251 | @classmethod |
| 252 | def load(cls, path: str) -> 'CameraPath': |
| 253 | """Load from JSON.""" |
| 254 | with open(path) as f: |
| 255 | data = json.load(f) |
| 256 | return cls( |
| 257 | keyframes=data['keyframes'], |
| 258 | total_frames=data['total_frames'], |
| 259 | interpolation=data.get('interpolation', 'smoothstep'), |
| 260 | ) |
| 261 | |
| 262 | |
| 263 | # --------------------------------------------------------------------------- |
no outgoing calls
no test coverage detected