File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -495,8 +495,13 @@ void UsdMaya_ReadJob::_ConvertUpAxisAndUnits(const UsdStageRefPtr& stage)
495
495
496
496
// Convert units if required and different between Maya and USD.
497
497
const bool convertUnits = mArgs .unit ;
498
- conversion.mayaMetersPerUnit
499
- = UsdMayaUtil::ConvertMDistanceUnitToUsdGeomLinearUnit (MDistance::internalUnit ());
498
+ // Note: when changing preference, we need to compare to the UI units.
499
+ // When adding scaling transforms, we need to compare to internal units.
500
+ const MDistance::Unit mayaUnits
501
+ = (mArgs .axisAndUnitMethod == UsdMayaJobImportArgsTokens->overwritePrefs )
502
+ ? MDistance::uiUnit ()
503
+ : MDistance::internalUnit ();
504
+ conversion.mayaMetersPerUnit = UsdMayaUtil::ConvertMDistanceUnitToUsdGeomLinearUnit (mayaUnits);
500
505
conversion.usdMetersPerUnit = UsdGeomGetStageMetersPerUnit (stage);
501
506
conversion.needUnitsConversion
502
507
= (convertUnits && (conversion.mayaMetersPerUnit != conversion.usdMetersPerUnit ));
Original file line number Diff line number Diff line change @@ -375,7 +375,7 @@ void setLayerUpAxisAndUnits(const SdfLayerRefPtr& layer)
375
375
= UsdMayaUtil::ConvertMDistanceUnitToUsdGeomLinearUnit (MDistance::internalUnit ());
376
376
377
377
// Note: code similar to what UsdGeomSetStageUpAxis -> UsdStage::SetMetadata end-up doing,
378
- // but without having to have a stage. We basically set metadat on the virtual root object
378
+ // but without having to have a stage. We basically set metadata on the virtual root object
379
379
// of the layer.
380
380
layer->SetField (
381
381
PXR_NS::SdfPath::AbsoluteRootPath (), PXR_NS::UsdGeomTokens->metersPerUnit , metersPerUnit);
You can’t perform that action at this time.
0 commit comments