@@ -156,27 +156,27 @@ bool writeCamera( const IECoreScene::Camera *camera, const pxr::UsdStagePtr &sta
156156 auto usdCamera = pxr::UsdGeomCamera::Define ( stage, path );
157157 if ( camera->getProjection () == " orthographic" )
158158 {
159- usdCamera.GetProjectionAttr ().Set ( pxr::UsdGeomTokens->orthographic );
159+ usdCamera.GetProjectionAttr ().Set ( pxr::UsdGeomTokens->orthographic , time );
160160
161161 // For ortho cameras, USD uses aperture units of tenths of scene units
162- usdCamera.GetHorizontalApertureAttr ().Set ( 10 .0f * camera->getAperture ()[0 ] );
163- usdCamera.GetVerticalApertureAttr ().Set ( 10 .0f * camera->getAperture ()[1 ] );
164- usdCamera.GetHorizontalApertureOffsetAttr ().Set ( 10 .0f * camera->getApertureOffset ()[0 ] );
165- usdCamera.GetVerticalApertureOffsetAttr ().Set ( 10 .0f * camera->getApertureOffset ()[1 ] );
162+ usdCamera.GetHorizontalApertureAttr ().Set ( 10 .0f * camera->getAperture ()[0 ], time );
163+ usdCamera.GetVerticalApertureAttr ().Set ( 10 .0f * camera->getAperture ()[1 ], time );
164+ usdCamera.GetHorizontalApertureOffsetAttr ().Set ( 10 .0f * camera->getApertureOffset ()[0 ], time );
165+ usdCamera.GetVerticalApertureOffsetAttr ().Set ( 10 .0f * camera->getApertureOffset ()[1 ], time );
166166 }
167167 else if ( camera->getProjection () == " perspective" )
168168 {
169- usdCamera.GetProjectionAttr ().Set ( pxr::UsdGeomTokens->perspective );
169+ usdCamera.GetProjectionAttr ().Set ( pxr::UsdGeomTokens->perspective , time );
170170
171171 // We store focalLength and aperture in arbitary units. USD uses tenths
172172 // of scene units
173173 float scale = 10 .0f * camera->getFocalLengthWorldScale ();
174174
175- usdCamera.GetFocalLengthAttr ().Set ( camera->getFocalLength () * scale );
176- usdCamera.GetHorizontalApertureAttr ().Set ( camera->getAperture ()[0 ] * scale );
177- usdCamera.GetVerticalApertureAttr ().Set ( camera->getAperture ()[1 ] * scale );
178- usdCamera.GetHorizontalApertureOffsetAttr ().Set ( camera->getApertureOffset ()[0 ] * scale );
179- usdCamera.GetVerticalApertureOffsetAttr ().Set ( camera->getApertureOffset ()[1 ] * scale );
175+ usdCamera.GetFocalLengthAttr ().Set ( camera->getFocalLength () * scale, time );
176+ usdCamera.GetHorizontalApertureAttr ().Set ( camera->getAperture ()[0 ] * scale, time );
177+ usdCamera.GetVerticalApertureAttr ().Set ( camera->getAperture ()[1 ] * scale, time );
178+ usdCamera.GetHorizontalApertureOffsetAttr ().Set ( camera->getApertureOffset ()[0 ] * scale, time );
179+ usdCamera.GetVerticalApertureOffsetAttr ().Set ( camera->getApertureOffset ()[1 ] * scale, time );
180180 }
181181 else
182182 {
@@ -189,9 +189,9 @@ bool writeCamera( const IECoreScene::Camera *camera, const pxr::UsdStagePtr &sta
189189 );
190190 }
191191
192- usdCamera.GetClippingRangeAttr ().Set ( pxr::GfVec2f ( camera->getClippingPlanes ().getValue () ) );
193- usdCamera.GetFStopAttr ().Set ( camera->getFStop () );
194- usdCamera.GetFocusDistanceAttr ().Set ( camera->getFocusDistance () );
192+ usdCamera.GetClippingRangeAttr ().Set ( pxr::GfVec2f ( camera->getClippingPlanes ().getValue () ), time );
193+ usdCamera.GetFStopAttr ().Set ( camera->getFStop (), time );
194+ usdCamera.GetFocusDistanceAttr ().Set ( camera->getFocusDistance (), time );
195195
196196 if ( camera->hasShutter () )
197197 {
@@ -201,8 +201,8 @@ bool writeCamera( const IECoreScene::Camera *camera, const pxr::UsdStagePtr &sta
201201 // / and Houdini plugin sources, I've been unable to find evidence for
202202 // / anyone else doing this though, so maybe it's one of those things
203203 // / everyone is just getting wrong?
204- usdCamera.GetShutterOpenAttr ().Set ( (double )camera->getShutter ()[0 ] );
205- usdCamera.GetShutterCloseAttr ().Set ( (double )camera->getShutter ()[1 ] );
204+ usdCamera.GetShutterOpenAttr ().Set ( (double )camera->getShutter ()[0 ], time );
205+ usdCamera.GetShutterCloseAttr ().Set ( (double )camera->getShutter ()[1 ], time );
206206 }
207207
208208 return true ;
0 commit comments