@@ -198,26 +198,53 @@ TEST(USDTransformsTest, ParseUSDTransform)
198
198
// ///////////////////////////////////////////////
199
199
TEST (USDTransformsTest, GetAllTransform)
200
200
{
201
- std::string filename = sdf::testing::TestFile (" usd" , " upAxisZ.usda" );
202
- auto stage = pxr::UsdStage::Open (filename);
203
- ASSERT_TRUE (stage);
201
+ {
202
+ std::string filename = sdf::testing::TestFile (" usd" , " upAxisZ.usda" );
203
+ auto stage = pxr::UsdStage::Open (filename);
204
+ ASSERT_TRUE (stage);
204
205
205
- sdf::usd::USDData usdData (filename);
206
- usdData.Init ();
206
+ sdf::usd::USDData usdData (filename);
207
+ usdData.Init ();
207
208
208
- pxr::UsdPrim prim = stage->GetPrimAtPath (
209
- pxr::SdfPath (" /shapes/ellipsoid/ellipsoid_link/ellipsoid_visual/geometry" ));
210
- ASSERT_TRUE (prim);
209
+ pxr::UsdPrim prim = stage->GetPrimAtPath (
210
+ pxr::SdfPath (" /shapes/ellipsoid/ellipsoid_link/ellipsoid_visual/geometry" ));
211
+ ASSERT_TRUE (prim);
212
+
213
+ ignition::math::Pose3d pose;
214
+ ignition::math::Vector3d scale{1 , 1 , 1 };
215
+
216
+ sdf::usd::GetTransform (prim, usdData, pose, scale, " /shapes" );
211
217
212
- ignition::math::Pose3d pose;
213
- ignition::math::Vector3d scale{1 , 1 , 1 };
218
+ EXPECT_EQ (ignition::math::Vector3d (0.4 , 0.6 , 1 ), scale);
219
+ EXPECT_EQ (
220
+ ignition::math::Pose3d (
221
+ ignition::math::Vector3d (0 , 0.03 , 0.005 ),
222
+ ignition::math::Quaterniond (IGN_DTOR (15 ), IGN_DTOR (80 ), IGN_DTOR (-55 ))),
223
+ pose);
224
+ }
225
+
226
+ {
227
+ std::string filename = sdf::testing::TestFile (" usd" , " nested_transforms.usda" );
228
+ auto stage = pxr::UsdStage::Open (filename);
229
+ ASSERT_TRUE (stage);
230
+
231
+ sdf::usd::USDData usdData (filename);
232
+ usdData.Init ();
214
233
215
- sdf::usd::GetTransform (prim, usdData, pose, scale, " /shapes" );
234
+ const pxr::UsdPrim prim = stage->GetPrimAtPath (
235
+ pxr::SdfPath (" /transforms/nested_transforms_XYZ/child_transform" ));
236
+ ASSERT_TRUE (prim);
216
237
217
- EXPECT_EQ (ignition::math::Vector3d (0.4 , 0.6 , 1 ), scale);
218
- EXPECT_EQ (
219
- ignition::math::Pose3d (
220
- ignition::math::Vector3d (0 , 0.03 , 0.005 ),
221
- ignition::math::Quaterniond (IGN_DTOR (15 ), IGN_DTOR (80 ), IGN_DTOR (-55 ))),
222
- pose);
238
+ ignition::math::Pose3d pose;
239
+ ignition::math::Vector3d scale{1 , 1 , 1 };
240
+
241
+ sdf::usd::GetTransform (prim, usdData, pose, scale, " /transforms" );
242
+
243
+ EXPECT_EQ (ignition::math::Vector3d (1 , 1 , 1 ), scale);
244
+ EXPECT_EQ (
245
+ ignition::math::Pose3d (
246
+ ignition::math::Vector3d (.01 , .01 , 0 ),
247
+ ignition::math::Quaterniond (0 , 0 , IGN_DTOR (90 ))),
248
+ pose);
249
+ }
223
250
}
0 commit comments