@@ -45,6 +45,19 @@ void CameraKeyframes::read(Input& input)
4545 input.readObjects (" path" , track.value );
4646 }
4747
48+ if (input.version_greater_equal (1 , 1 , 15 ))
49+ {
50+ // read origin key frames
51+ uint32_t num_origins = input.readValue <uint32_t >(" origins" );
52+ origins.resize (num_origins);
53+ for (auto & origin : origins)
54+ {
55+ input.matchPropertyName (" origin" );
56+ input.read (1 , &origin.time );
57+ input.read (1 , &origin.value );
58+ }
59+ }
60+
4861 // read position key frames
4962 uint32_t num_positions = input.readValue <uint32_t >(" positions" );
5063 positions.resize (num_positions);
@@ -103,6 +116,19 @@ void CameraKeyframes::write(Output& output) const
103116 output.writeObjects (" path" , track.value );
104117 }
105118
119+ if (output.version_greater_equal (1 , 1 , 15 ))
120+ {
121+ // write origin key frames
122+ output.writeValue <uint32_t >(" origins" , origins.size ());
123+ for (const auto & origin : origins)
124+ {
125+ output.writePropertyName (" origin" );
126+ output.write (1 , &origin.time );
127+ output.write (1 , &origin.value );
128+ output.writeEndOfLine ();
129+ }
130+ }
131+
106132 // write position key frames
107133 output.writeValue <uint32_t >(" positions" , positions.size ());
108134 for (const auto & position : positions)
@@ -123,15 +149,6 @@ void CameraKeyframes::write(Output& output) const
123149 output.writeEndOfLine ();
124150 }
125151
126- // write scale key frames
127- for (const auto & scale : fieldOfViews)
128- {
129- output.writePropertyName (" fov" );
130- output.write (1 , &scale.time );
131- output.write (1 , &scale.value );
132- output.writeEndOfLine ();
133- }
134-
135152 // write field of view key frames
136153 output.writeValue <uint32_t >(" fieldOfViews" , fieldOfViews.size ());
137154 for (const auto & fov : fieldOfViews)
0 commit comments