@@ -203,13 +203,7 @@ namespace sdf
203
203
jointAxis.SetMaxVelocity (vel);
204
204
}
205
205
206
- if (_prim.IsA <pxr::UsdPhysicsFixedJoint>())
207
- {
208
- _joint.SetType (sdf::JointType::FIXED);
209
-
210
- return errors;
211
- }
212
- else if (_prim.IsA <pxr::UsdPhysicsPrismaticJoint>())
206
+ if (_prim.IsA <pxr::UsdPhysicsPrismaticJoint>())
213
207
{
214
208
auto variant_physics_prismatic_joint =
215
209
pxr::UsdPhysicsPrismaticJoint (_prim);
@@ -220,9 +214,9 @@ namespace sdf
220
214
if (!errorsAxis.empty ())
221
215
{
222
216
errors.emplace_back (UsdError (
223
- sdf::usd::UsdErrorCode::SDF_TO_USD_PARSING_ERROR ,
224
- std::string ( " Errors encountered when setting xyz of prismatic" ) +
225
- " _joint axis: [" + std::string (_prim.GetName ()) + " ]" ));
217
+ sdf::usd::UsdErrorCode::USD_TO_SDF_PARSING_ERROR ,
218
+ " Errors encountered when setting xyz of prismatic "
219
+ " joint axis: [" + std::string (_prim.GetName ()) + " ]" ));
226
220
for (const auto & error : errorsAxis)
227
221
errors.emplace_back (error);
228
222
return errors;
@@ -250,9 +244,9 @@ namespace sdf
250
244
if (!errorsAxis.empty ())
251
245
{
252
246
errors.emplace_back (UsdError (
253
- sdf::usd::UsdErrorCode::SDF_TO_USD_PARSING_ERROR ,
254
- std::string ( " Errors encountered when setting xyz of revolute" ) +
255
- " _joint axis: [" + std::string (_prim.GetName ()) + " ]" ));
247
+ sdf::usd::UsdErrorCode::USD_TO_SDF_PARSING_ERROR ,
248
+ " Errors encountered when setting xyz of revolute "
249
+ " joint axis: [" + std::string (_prim.GetName ()) + " ]" ));
256
250
for (const auto & error : errorsAxis)
257
251
errors.emplace_back (error);
258
252
return errors;
@@ -268,10 +262,20 @@ namespace sdf
268
262
269
263
return errors;
270
264
}
271
- else if (_prim.IsA <pxr::UsdPhysicsJoint>())
265
+ else if (_prim.IsA <pxr::UsdPhysicsFixedJoint>() ||
266
+ _prim.IsA <pxr::UsdPhysicsJoint>())
272
267
{
273
268
_joint.SetType (sdf::JointType::FIXED);
274
269
}
270
+ else
271
+ {
272
+ errors.emplace_back (UsdError (
273
+ sdf::usd::UsdErrorCode::USD_TO_SDF_PARSING_ERROR,
274
+ " Unable to create a SDF joint from USD prim [" +
275
+ std::string (_prim.GetName ()) +
276
+ " ] because the prim is not a USD joint." ));
277
+ }
278
+
275
279
return errors;
276
280
}
277
281
}
0 commit comments