@@ -293,7 +293,13 @@ int ParseMeshSubGeom(const pxr::UsdPrim &_prim,
293
293
294
294
ignition::math::Pose3d pose;
295
295
ignition::math::Vector3d scale (1 , 1 , 1 );
296
- GetTransform (child, _usdData, pose, scale, _link->Name ());
296
+ std::string linkName = pxr::TfStringify (_prim.GetPath ());
297
+ auto found = linkName.find (_link->Name ());
298
+ if (found != std::string::npos)
299
+ {
300
+ linkName = linkName.substr (0 , found + _link->Name ().size ());
301
+ }
302
+ GetTransform (child, _usdData, pose, scale, linkName);
297
303
_scale *= scale;
298
304
visSubset.SetRawPose (pose);
299
305
_link->AddVisual (visSubset);
@@ -386,15 +392,21 @@ UsdErrors ParseMesh(
386
392
387
393
ignition::math::Pose3d pose;
388
394
ignition::math::Vector3d scale (1 , 1 , 1 );
389
- std::string linkName = _link->Name ();
395
+ std::string linkName = pxr::TfStringify (_prim.GetPath ());
396
+ auto found = linkName.find (_link->Name ());
397
+ if (found != std::string::npos)
398
+ {
399
+ linkName = linkName.substr (0 , found + _link->Name ().size ());
400
+ }
401
+
390
402
size_t nSlash = std::count (linkName.begin (), linkName.end (), ' /' );
391
403
if (nSlash == 1 )
392
404
{
393
405
GetTransform (_prim, _usdData, pose, scale, " /" );
394
406
}
395
407
else
396
408
{
397
- GetTransform (_prim, _usdData, pose, scale, _link-> Name () );
409
+ GetTransform (_prim, _usdData, pose, scale, linkName );
398
410
}
399
411
400
412
_pose = pose;
@@ -522,7 +534,7 @@ void ParseCylinder(
522
534
_geom.SetType (sdf::GeometryType::CYLINDER);
523
535
524
536
c.SetRadius (radius * _metersPerUnit * _scale.X ());
525
- c.SetLength (height * _metersPerUnit * _scale.Y ());
537
+ c.SetLength (height * _metersPerUnit * _scale.Z ());
526
538
527
539
_geom.SetCylinderShape (c);
528
540
}
@@ -632,9 +644,9 @@ UsdErrors ParseUSDLinks(
632
644
pxr::UsdModelAPI (parent).GetKind (&kindOfSchema);
633
645
}
634
646
635
- if (_prim.HasAPI <pxr::UsdPhysicsRigidBodyAPI>()
636
- || pxr::KindRegistry::IsA (kindOfSchema, pxr::KindTokens->model )
637
- || !collisionEnabled)
647
+ if (( _prim.HasAPI <pxr::UsdPhysicsRigidBodyAPI>()
648
+ || pxr::KindRegistry::IsA (kindOfSchema, pxr::KindTokens->model ))
649
+ && !collisionEnabled)
638
650
{
639
651
double metersPerUnit = data.second ->MetersPerUnit ();
640
652
@@ -696,7 +708,15 @@ UsdErrors ParseUSDLinks(
696
708
697
709
ignition::math::Pose3d poseCol;
698
710
ignition::math::Vector3d scaleCol (1 , 1 , 1 );
699
- GetTransform (_prim, _usdData, poseCol, scaleCol, _link->Name ());
711
+ std::string linkName = pxr::TfStringify (_prim.GetPath ());
712
+ auto found = linkName.find (_link->Name ());
713
+ if (found != std::string::npos)
714
+ {
715
+ linkName = linkName.substr (0 , found + _link->Name ().size ());
716
+ }
717
+ GetTransform (_prim, _usdData, poseCol, scaleCol, linkName);
718
+
719
+ scaleCol *= _scale;
700
720
701
721
double metersPerUnit = data.second ->MetersPerUnit ();
702
722
0 commit comments