@@ -101,7 +101,6 @@ def tearDown(self):
101101
102102class TestAnimation (VisualizerTest ):
103103 def runTest (self ):
104- self .vis .delete ()
105104 v = self .vis ["shapes" ]
106105 v .set_transform (tf .translation_matrix ([1. , 0 , 0 ]))
107106 v ["cube" ].set_object (g .Box ([0.1 , 0.2 , 0.3 ]))
@@ -112,3 +111,21 @@ def runTest(self):
112111 with animation .at_frame (v , 30 ) as frame_vis :
113112 frame_vis .set_transform (tf .translation_matrix ([2 , 0 , 0 ]).dot (tf .rotation_matrix (np .pi / 2 , [0 , 0 , 1 ])))
114113 v .set_animation (animation )
114+
115+
116+ class TestCameraAnimation (VisualizerTest ):
117+ def runTest (self ):
118+ v = self .vis ["shapes" ]
119+ v .set_transform (tf .translation_matrix ([1. , 0 , 0 ]))
120+ v ["cube" ].set_object (g .Box ([0.1 , 0.2 , 0.3 ]))
121+
122+ animation = meshcat .animation .Animation ()
123+ with animation .at_frame (v , 0 ) as frame_vis :
124+ frame_vis .set_transform (tf .translation_matrix ([0 , 0 , 0 ]))
125+ with animation .at_frame (v , 30 ) as frame_vis :
126+ frame_vis .set_transform (tf .translation_matrix ([2 , 0 , 0 ]).dot (tf .rotation_matrix (np .pi / 2 , [0 , 0 , 1 ])))
127+ with animation .at_frame (v , 0 ) as frame_vis :
128+ frame_vis ["/Cameras/default/rotated/<object>" ].set_property ("zoom" , "number" , 1 )
129+ with animation .at_frame (v , 30 ) as frame_vis :
130+ frame_vis ["/Cameras/default/rotated/<object>" ].set_property ("zoom" , "number" , 0.5 )
131+ v .set_animation (animation )
0 commit comments