@@ -293,7 +293,13 @@ int ParseMeshSubGeom(const pxr::UsdPrim &_prim,
293293
294294 ignition::math::Pose3d pose;
295295 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);
297303 _scale *= scale;
298304 visSubset.SetRawPose (pose);
299305 _link->AddVisual (visSubset);
@@ -386,15 +392,21 @@ UsdErrors ParseMesh(
386392
387393 ignition::math::Pose3d pose;
388394 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+
390402 size_t nSlash = std::count (linkName.begin (), linkName.end (), ' /' );
391403 if (nSlash == 1 )
392404 {
393405 GetTransform (_prim, _usdData, pose, scale, " /" );
394406 }
395407 else
396408 {
397- GetTransform (_prim, _usdData, pose, scale, _link-> Name () );
409+ GetTransform (_prim, _usdData, pose, scale, linkName );
398410 }
399411
400412 _pose = pose;
@@ -522,7 +534,7 @@ void ParseCylinder(
522534 _geom.SetType (sdf::GeometryType::CYLINDER);
523535
524536 c.SetRadius (radius * _metersPerUnit * _scale.X ());
525- c.SetLength (height * _metersPerUnit * _scale.Y ());
537+ c.SetLength (height * _metersPerUnit * _scale.Z ());
526538
527539 _geom.SetCylinderShape (c);
528540}
@@ -632,9 +644,9 @@ UsdErrors ParseUSDLinks(
632644 pxr::UsdModelAPI (parent).GetKind (&kindOfSchema);
633645 }
634646
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)
638650 {
639651 double metersPerUnit = data.second ->MetersPerUnit ();
640652
@@ -696,7 +708,15 @@ UsdErrors ParseUSDLinks(
696708
697709 ignition::math::Pose3d poseCol;
698710 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;
700720
701721 double metersPerUnit = data.second ->MetersPerUnit ();
702722
0 commit comments