diff --git a/pxr/imaging/hd/camera.cpp b/pxr/imaging/hd/camera.cpp index 32bc8c5325..330b819db9 100644 --- a/pxr/imaging/hd/camera.cpp +++ b/pxr/imaging/hd/camera.cpp @@ -45,7 +45,7 @@ HdCamera::HdCamera(SdfPath const &id) , _exposureIso(100.0f) , _exposureFStop(1.0f) , _exposureResponsivity(1.0f) - , _exposureScale(1.0f) + , _linearExposureScale(1.0f) , _lensDistortionType(HdCameraTokens->standard) , _lensDistortionK1(0.0f) , _lensDistortionK2(0.0f) @@ -271,11 +271,11 @@ HdCamera::Sync(HdSceneDelegate * sceneDelegate, _exposureResponsivity = vExposureResponsivity.Get(); } - const VtValue vExposureScale = + const VtValue vLinearExposureScale = sceneDelegate->GetCameraParamValue( id, HdCameraTokens->linearExposureScale); - if (!vExposureScale.IsEmpty()) { - _exposureScale = vExposureScale.Get(); + if (!vLinearExposureScale.IsEmpty()) { + _linearExposureScale = vLinearExposureScale.Get(); } const VtValue vLensDistortionType = diff --git a/pxr/imaging/hd/camera.h b/pxr/imaging/hd/camera.h index 6c54f2cdbe..1f24fad50a 100644 --- a/pxr/imaging/hd/camera.h +++ b/pxr/imaging/hd/camera.h @@ -61,7 +61,7 @@ PXR_NAMESPACE_OPEN_SCOPE (exposureIso) \ (exposureFStop) \ (exposureResponsivity) \ - (linearExposureScale) \ + (linearExposureScale) \ \ /* how to match window with different aspect */ \ (windowPolicy) \ @@ -245,7 +245,7 @@ class HdCamera : public HdSprim /// /// This the same as the value stored in the exposure attribute on the /// underlying camera. Note that in most cases, you will want to use - /// GetExposureScale() instead of this method, as it is the computed + /// GetLinearExposureScale() instead of this method, as it is the computed /// end result of all related exposure attributes. /// GetExposure() is retained as-is for backward compatibility. float GetExposure() const { @@ -257,8 +257,8 @@ class HdCamera : public HdSprim /// Scaling the image brightness by this value will cause the various /// exposure controls on \ref UsdGeomCamera to behave like those of a real /// camera to control the exposure of the image. - float GetExposureScale() const { - return _exposureScale; + float GetLinearExposureScale() const { + return _linearExposureScale; } TfToken GetLensDistortionType() const { @@ -344,7 +344,7 @@ class HdCamera : public HdSprim float _exposureIso; float _exposureFStop; float _exposureResponsivity; - float _exposureScale; + float _linearExposureScale; // lens distortion TfToken _lensDistortionType; diff --git a/pxr/imaging/hd/cameraSchema.cpp b/pxr/imaging/hd/cameraSchema.cpp index e3c73b8710..b1b20af282 100644 --- a/pxr/imaging/hd/cameraSchema.cpp +++ b/pxr/imaging/hd/cameraSchema.cpp @@ -152,7 +152,7 @@ HdCameraSchema::GetExposureResponsivity() const } HdFloatDataSourceHandle -HdCameraSchema::GetExposureScale() const +HdCameraSchema::GetLinearExposureScale() const { return _GetTypedDataSource( HdCameraSchemaTokens->linearExposureScale); @@ -213,7 +213,7 @@ HdCameraSchema::BuildRetained( const HdFloatDataSourceHandle &exposureIso, const HdFloatDataSourceHandle &exposureFStop, const HdFloatDataSourceHandle &exposureResponsivity, - const HdFloatDataSourceHandle &exposureScale, + const HdFloatDataSourceHandle &linearExposureScale, const HdBoolDataSourceHandle &focusOn, const HdFloatDataSourceHandle &dofAspect, const HdContainerDataSourceHandle &splitDiopter, @@ -311,9 +311,9 @@ HdCameraSchema::BuildRetained( _values[_count++] = exposureResponsivity; } - if (exposureScale) { + if (linearExposureScale) { _names[_count] = HdCameraSchemaTokens->linearExposureScale; - _values[_count++] = exposureScale; + _values[_count++] = linearExposureScale; } if (focusOn) { @@ -480,10 +480,10 @@ HdCameraSchema::Builder::SetExposureResponsivity( } HdCameraSchema::Builder & -HdCameraSchema::Builder::SetExposureScale( - const HdFloatDataSourceHandle &exposureScale) +HdCameraSchema::Builder::SetLinearExposureScale( + const HdFloatDataSourceHandle &linearExposureScale) { - _exposureScale = exposureScale; + _linearExposureScale = linearExposureScale; return *this; } @@ -548,7 +548,7 @@ HdCameraSchema::Builder::Build() _exposureIso, _exposureFStop, _exposureResponsivity, - _exposureScale, + _linearExposureScale, _focusOn, _dofAspect, _splitDiopter, @@ -656,7 +656,7 @@ HdCameraSchema::GetExposureResponsivityLocator() /* static */ const HdDataSourceLocator & -HdCameraSchema::GetExposureScaleLocator() +HdCameraSchema::GetLinearExposureScaleLocator() { static const HdDataSourceLocator locator = GetDefaultLocator().Append( diff --git a/pxr/imaging/hd/cameraSchema.h b/pxr/imaging/hd/cameraSchema.h index b5c4645aa7..edfe673d1f 100644 --- a/pxr/imaging/hd/cameraSchema.h +++ b/pxr/imaging/hd/cameraSchema.h @@ -147,7 +147,7 @@ class HdCameraSchema : public HdSchema HdFloatDataSourceHandle GetExposureResponsivity() const; HD_API - HdFloatDataSourceHandle GetExposureScale() const; + HdFloatDataSourceHandle GetLinearExposureScale() const; HD_API HdBoolDataSourceHandle GetFocusOn() const; @@ -218,9 +218,9 @@ class HdCameraSchema : public HdSchema HD_API static const HdDataSourceLocator &GetExposureResponsivityLocator(); - /// Prim-level relative data source locator to locate exposureScale. + /// Prim-level relative data source locator to locate linearExposureScale. HD_API - static const HdDataSourceLocator &GetExposureScaleLocator(); + static const HdDataSourceLocator &GetLinearExposureScaleLocator(); /// Prim-level relative data source locator to locate namespacedProperties. HD_API @@ -257,7 +257,7 @@ class HdCameraSchema : public HdSchema const HdFloatDataSourceHandle &exposureIso, const HdFloatDataSourceHandle &exposureFStop, const HdFloatDataSourceHandle &exposureResponsivity, - const HdFloatDataSourceHandle &exposureScale, + const HdFloatDataSourceHandle &linearExposureScale, const HdBoolDataSourceHandle &focusOn, const HdFloatDataSourceHandle &dofAspect, const HdContainerDataSourceHandle &splitDiopter, @@ -326,8 +326,8 @@ class HdCameraSchema : public HdSchema Builder &SetExposureResponsivity( const HdFloatDataSourceHandle &exposureResponsivity); HD_API - Builder &SetExposureScale( - const HdFloatDataSourceHandle &exposureScale); + Builder &SetLinearExposureScale( + const HdFloatDataSourceHandle &linearExposureScale); HD_API Builder &SetFocusOn( const HdBoolDataSourceHandle &focusOn); @@ -366,7 +366,7 @@ class HdCameraSchema : public HdSchema HdFloatDataSourceHandle _exposureIso; HdFloatDataSourceHandle _exposureFStop; HdFloatDataSourceHandle _exposureResponsivity; - HdFloatDataSourceHandle _exposureScale; + HdFloatDataSourceHandle _linearExposureScale; HdBoolDataSourceHandle _focusOn; HdFloatDataSourceHandle _dofAspect; HdContainerDataSourceHandle _splitDiopter; diff --git a/pxr/imaging/hd/hdSchemaDefs.py b/pxr/imaging/hd/hdSchemaDefs.py index 5628a4de81..b87640d924 100644 --- a/pxr/imaging/hd/hdSchemaDefs.py +++ b/pxr/imaging/hd/hdSchemaDefs.py @@ -1052,7 +1052,7 @@ ('exposureIso', T_FLOAT, dict(ADD_LOCATOR = True)), ('exposureFStop', T_FLOAT, dict(ADD_LOCATOR = True)), ('exposureResponsivity', T_FLOAT, dict(ADD_LOCATOR = True)), - ('exposureScale', T_FLOAT, dict(ADD_LOCATOR = True)), + ('linearExposureScale', T_FLOAT, dict(ADD_LOCATOR = True)), ('focusOn', T_BOOL, {}), ('dofAspect', T_FLOAT, {}), ('splitDiopter', 'HdSplitDiopterSchema', {}), diff --git a/pxr/usd/usdGeom/wrapCamera.cpp b/pxr/usd/usdGeom/wrapCamera.cpp index d2aef3fa55..4cc0a02035 100644 --- a/pxr/usd/usdGeom/wrapCamera.cpp +++ b/pxr/usd/usdGeom/wrapCamera.cpp @@ -360,7 +360,8 @@ WRAP_CUSTOM { .def("SetFromCamera", &UsdGeomCamera::SetFromCamera, (arg("camera"), arg("time") = UsdTimeCode::Default())) - .def("ComputeLinearExposureScale", &UsdGeomCamera::ComputeLinearExposureScale, + .def("ComputeLinearExposureScale", + &UsdGeomCamera::ComputeLinearExposureScale, (arg("time") = UsdTimeCode::Default())) ; } diff --git a/pxr/usdImaging/usdImaging/cameraAdapter.cpp b/pxr/usdImaging/usdImaging/cameraAdapter.cpp index d3e04e0ac1..77435fbae6 100644 --- a/pxr/usdImaging/usdImaging/cameraAdapter.cpp +++ b/pxr/usdImaging/usdImaging/cameraAdapter.cpp @@ -243,7 +243,7 @@ UsdImagingCameraAdapter::Get(UsdPrim const& prim, return vShutterClose; } else if (key == HdCameraTokens->exposure) { // The raw exponential compensation attribute. - // See "exposureScale" below for the computed linear multiplier ratio. + // See "linearExposureScale" below for the computed linear multiplier. VtValue vExposureExponent; cam.GetExposureAttr().Get(&vExposureExponent, time); // conversion n/a return vExposureExponent; @@ -264,7 +264,7 @@ UsdImagingCameraAdapter::Get(UsdPrim const& prim, cam.GetExposureResponsivityAttr().Get(&vExposureResponsivity, time); // conversion n/a return vExposureResponsivity; } else if (key == HdCameraTokens->linearExposureScale) { - // The computed linear exposure multiplier ratio + // The computed linear exposure multiplier. return VtValue(cam.ComputeLinearExposureScale(time)); } diff --git a/pxr/usdImaging/usdImaging/dataSourceCamera.cpp b/pxr/usdImaging/usdImaging/dataSourceCamera.cpp index 593f9415dd..771a3f6a3a 100644 --- a/pxr/usdImaging/usdImaging/dataSourceCamera.cpp +++ b/pxr/usdImaging/usdImaging/dataSourceCamera.cpp @@ -109,13 +109,13 @@ class _Vec4fArrayToVec4dArrayDataSource typename HdTypedSampledDataSource>::Handle _dataSource; }; -class _CameraExposureScaleDataSource +class _CameraLinearExposureScaleDataSource : public HdTypedSampledDataSource { public: - HD_DECLARE_DATASOURCE(_CameraExposureScaleDataSource); + HD_DECLARE_DATASOURCE(_CameraLinearExposureScaleDataSource); - _CameraExposureScaleDataSource( + _CameraLinearExposureScaleDataSource( const SdfPath &sceneIndexPath, UsdGeomCamera usdCamera, const UsdImagingDataSourceStageGlobals &stageGlobals) @@ -123,8 +123,8 @@ class _CameraExposureScaleDataSource , _usdCamera(usdCamera) , _stageGlobals(stageGlobals) { - static const HdDataSourceLocator exposureScaleLocator = - HdCameraSchema::GetExposureScaleLocator(); + static const HdDataSourceLocator linearExposureScaleLocator = + HdCameraSchema::GetLinearExposureScaleLocator(); static const std::vector inputNames = { UsdGeomTokens->exposure, @@ -141,7 +141,7 @@ class _CameraExposureScaleDataSource prim.GetAttribute(inputName), _stageGlobals, _sceneIndexPath, - exposureScaleLocator)); + linearExposureScaleLocator)); } } @@ -204,7 +204,7 @@ HdDataSourceBaseHandle UsdImagingDataSourceCamera::Get(const TfToken &name) { if (name == HdCameraSchemaTokens->linearExposureScale) { - return _CameraExposureScaleDataSource::New( + return _CameraLinearExposureScaleDataSource::New( _sceneIndexPath, _usdCamera, _stageGlobals); } @@ -327,37 +327,37 @@ UsdImagingDataSourceCameraPrim::Invalidate( locators.insert( HdCameraSchema::GetShutterCloseLocator()); } else if (usdName == UsdGeomTokens->exposure) { - // "exposure" maps unchanged to "exposure", and is an - // input to the computed value stored at "exposureScale" + // "exposure" maps unchanged to "exposure", and is an input + // to the computed value stored at "linearExposureScale" locators.insert( HdCameraSchema::GetExposureLocator()); locators.insert( - HdCameraSchema::GetExposureScaleLocator()); + HdCameraSchema::GetLinearExposureScaleLocator()); } else if (usdName == UsdGeomTokens->exposureTime) { - // "exposure:time" maps to "exposureTime", and is an - // input to the computed value stored at "exposureScale" + // "exposure:time" maps to "exposureTime", and is an input + // to the computed value stored at "linearExposureScale" locators.insert( HdCameraSchema::GetExposureTimeLocator()); locators.insert( - HdCameraSchema::GetExposureScaleLocator()); + HdCameraSchema::GetLinearExposureScaleLocator()); } else if (usdName == UsdGeomTokens->exposureIso) { // similar to exposureTime locators.insert( HdCameraSchema::GetExposureIsoLocator()); locators.insert( - HdCameraSchema::GetExposureScaleLocator()); + HdCameraSchema::GetLinearExposureScaleLocator()); } else if (usdName == UsdGeomTokens->exposureFStop) { // similar to exposureTime locators.insert( HdCameraSchema::GetExposureFStopLocator()); locators.insert( - HdCameraSchema::GetExposureScaleLocator()); + HdCameraSchema::GetLinearExposureScaleLocator()); } else if (usdName == UsdGeomTokens->exposureResponsivity) { // similar to exposureTime locators.insert( HdCameraSchema::GetExposureResponsivityLocator()); locators.insert( - HdCameraSchema::GetExposureScaleLocator()); + HdCameraSchema::GetLinearExposureScaleLocator()); } else { locators.insert( HdCameraSchema::GetDefaultLocator().Append(